expxagents 0.13.0 → 0.14.0

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.
Files changed (62) hide show
  1. package/assets/core/solution-architect.agent.md +3 -0
  2. package/dist/core/squad-loader.js +2 -8
  3. package/dist/dashboard/assets/{BufferResource-D9aUIz5c.js → BufferResource-IVUoAbNS.js} +1 -1
  4. package/dist/dashboard/assets/{CanvasRenderer-DfAInYD0.js → CanvasRenderer-ZlhtzexK.js} +1 -1
  5. package/dist/dashboard/assets/{JarvisView-D78mY8i-.js → JarvisView-Bkn01kRk.js} +1 -1
  6. package/dist/dashboard/assets/{RenderTargetSystem-DZo6ujA0.js → RenderTargetSystem-ukD3tT30.js} +1 -1
  7. package/dist/dashboard/assets/{WebGLRenderer-BKreDG7Z.js → WebGLRenderer-B0gX63D6.js} +1 -1
  8. package/dist/dashboard/assets/{WebGPURenderer-DeKuexG2.js → WebGPURenderer-CU_7qyko.js} +1 -1
  9. package/dist/dashboard/assets/{browserAll-3U5O7dnB.js → browserAll-CHvE8-zd.js} +1 -1
  10. package/dist/dashboard/assets/index-CV6VSNbn.js +400 -0
  11. package/dist/dashboard/assets/{index-DHu3wE8e.css → index-ClyttaJh.css} +1 -1
  12. package/dist/dashboard/assets/{webworkerAll-CBlDUJVW.js → webworkerAll-D1p-kqY5.js} +1 -1
  13. package/dist/dashboard/index.html +2 -2
  14. package/dist/data/opensquad.db-shm +0 -0
  15. package/dist/data/opensquad.db-wal +0 -0
  16. package/dist/server/api/__tests__/files-routes.test.d.ts +2 -0
  17. package/dist/server/api/__tests__/files-routes.test.d.ts.map +1 -0
  18. package/dist/server/api/__tests__/files-routes.test.js +85 -0
  19. package/dist/server/api/__tests__/files-routes.test.js.map +1 -0
  20. package/dist/server/api/__tests__/graph-routes.test.d.ts +2 -0
  21. package/dist/server/api/__tests__/graph-routes.test.d.ts.map +1 -0
  22. package/dist/server/api/__tests__/graph-routes.test.js +105 -0
  23. package/dist/server/api/__tests__/graph-routes.test.js.map +1 -0
  24. package/dist/server/api/__tests__/kanban-routes.test.d.ts +2 -0
  25. package/dist/server/api/__tests__/kanban-routes.test.d.ts.map +1 -0
  26. package/dist/server/api/__tests__/kanban-routes.test.js +227 -0
  27. package/dist/server/api/__tests__/kanban-routes.test.js.map +1 -0
  28. package/dist/server/api/files-routes.d.ts +5 -0
  29. package/dist/server/api/files-routes.d.ts.map +1 -0
  30. package/dist/server/api/files-routes.js +92 -0
  31. package/dist/server/api/files-routes.js.map +1 -0
  32. package/dist/server/api/graph-routes.d.ts +24 -0
  33. package/dist/server/api/graph-routes.d.ts.map +1 -0
  34. package/dist/server/api/graph-routes.js +189 -0
  35. package/dist/server/api/graph-routes.js.map +1 -0
  36. package/dist/server/api/kanban-routes.d.ts +8 -0
  37. package/dist/server/api/kanban-routes.d.ts.map +1 -0
  38. package/dist/server/api/kanban-routes.js +104 -0
  39. package/dist/server/api/kanban-routes.js.map +1 -0
  40. package/dist/server/app.d.ts.map +1 -1
  41. package/dist/server/app.js +6 -0
  42. package/dist/server/app.js.map +1 -1
  43. package/dist/server/db/migrations.d.ts.map +1 -1
  44. package/dist/server/db/migrations.js +10 -0
  45. package/dist/server/db/migrations.js.map +1 -1
  46. package/dist/server/db/schema.d.ts +1 -1
  47. package/dist/server/db/schema.d.ts.map +1 -1
  48. package/dist/server/db/schema.js +17 -0
  49. package/dist/server/db/schema.js.map +1 -1
  50. package/dist/server/scheduler/__tests__/scheduler-routes.test.js +65 -0
  51. package/dist/server/scheduler/__tests__/scheduler-routes.test.js.map +1 -1
  52. package/dist/server/scheduler/__tests__/scheduler-service.test.js +33 -0
  53. package/dist/server/scheduler/__tests__/scheduler-service.test.js.map +1 -1
  54. package/dist/server/scheduler/scheduler-routes.d.ts.map +1 -1
  55. package/dist/server/scheduler/scheduler-routes.js +44 -0
  56. package/dist/server/scheduler/scheduler-routes.js.map +1 -1
  57. package/dist/server/scheduler/scheduler-service.d.ts +8 -0
  58. package/dist/server/scheduler/scheduler-service.d.ts.map +1 -1
  59. package/dist/server/scheduler/scheduler-service.js +49 -0
  60. package/dist/server/scheduler/scheduler-service.js.map +1 -1
  61. package/package.json +1 -1
  62. package/dist/dashboard/assets/index-CahtAeF7.js +0 -400
@@ -1,400 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-3U5O7dnB.js","assets/webworkerAll-CBlDUJVW.js","assets/WebGPURenderer-DeKuexG2.js","assets/BufferResource-D9aUIz5c.js","assets/RenderTargetSystem-DZo6ujA0.js","assets/WebGLRenderer-BKreDG7Z.js","assets/CanvasRenderer-DfAInYD0.js"])))=>i.map(i=>d[i]);
2
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const gO="modulepreload",yO=function(t){return"/"+t},RS={},Kd=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){let l=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));r=l(n.map(p=>{if(p=yO(p),p in RS)return;RS[p]=!0;const m=p.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const x=document.createElement("link");if(x.rel=m?"stylesheet":gO,m||(x.as="script"),x.crossOrigin="",x.href=p,d&&x.setAttribute("nonce",d),document.head.appendChild(x),m)return new Promise((v,E)=>{x.addEventListener("load",v),x.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${p}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return r.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};function lu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Qb={exports:{}},Pp={};/**
3
- * @license React
4
- * react-jsx-runtime.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var kS;function bO(){if(kS)return Pp;kS=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,r,s){var l=null;if(s!==void 0&&(l=""+s),r.key!==void 0&&(l=""+r.key),"key"in r){s={};for(var c in r)c!=="key"&&(s[c]=r[c])}else s=r;return r=s.ref,{$$typeof:t,type:i,key:l,ref:r!==void 0?r:null,props:s}}return Pp.Fragment=e,Pp.jsx=n,Pp.jsxs=n,Pp}var OS;function xO(){return OS||(OS=1,Qb.exports=bO()),Qb.exports}var R=xO(),Jb={exports:{}},vt={};/**
11
- * @license React
12
- * react.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var DS;function vO(){if(DS)return vt;DS=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function v(K){return K===null||typeof K!="object"?null:(K=x&&K[x]||K["@@iterator"],typeof K=="function"?K:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,C={};function w(K,te,U){this.props=K,this.context=te,this.refs=C,this.updater=U||E}w.prototype.isReactComponent={},w.prototype.setState=function(K,te){if(typeof K!="object"&&typeof K!="function"&&K!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,K,te,"setState")},w.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};function k(){}k.prototype=w.prototype;function N(K,te,U){this.props=K,this.context=te,this.refs=C,this.updater=U||E}var D=N.prototype=new k;D.constructor=N,A(D,w.prototype),D.isPureReactComponent=!0;var H=Array.isArray;function z(){}var F={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function P(K,te,U){var le=U.ref;return{$$typeof:t,type:K,key:te,ref:le!==void 0?le:null,props:U}}function I(K,te){return P(K.type,te,K.props)}function V(K){return typeof K=="object"&&K!==null&&K.$$typeof===t}function X(K){var te={"=":"=0",":":"=2"};return"$"+K.replace(/[=:]/g,function(U){return te[U]})}var ne=/\/+/g;function q(K,te){return typeof K=="object"&&K!==null&&K.key!=null?X(""+K.key):te.toString(36)}function Q(K){switch(K.status){case"fulfilled":return K.value;case"rejected":throw K.reason;default:switch(typeof K.status=="string"?K.then(z,z):(K.status="pending",K.then(function(te){K.status==="pending"&&(K.status="fulfilled",K.value=te)},function(te){K.status==="pending"&&(K.status="rejected",K.reason=te)})),K.status){case"fulfilled":return K.value;case"rejected":throw K.reason}}throw K}function B(K,te,U,le,de){var ge=typeof K;(ge==="undefined"||ge==="boolean")&&(K=null);var se=!1;if(K===null)se=!0;else switch(ge){case"bigint":case"string":case"number":se=!0;break;case"object":switch(K.$$typeof){case t:case e:se=!0;break;case m:return se=K._init,B(se(K._payload),te,U,le,de)}}if(se)return de=de(K),se=le===""?"."+q(K,0):le,H(de)?(U="",se!=null&&(U=se.replace(ne,"$&/")+"/"),B(de,te,U,"",function(Le){return Le})):de!=null&&(V(de)&&(de=I(de,U+(de.key==null||K&&K.key===de.key?"":(""+de.key).replace(ne,"$&/")+"/")+se)),te.push(de)),1;se=0;var pe=le===""?".":le+":";if(H(K))for(var Ae=0;Ae<K.length;Ae++)le=K[Ae],ge=pe+q(le,Ae),se+=B(le,te,U,ge,de);else if(Ae=v(K),typeof Ae=="function")for(K=Ae.call(K),Ae=0;!(le=K.next()).done;)le=le.value,ge=pe+q(le,Ae++),se+=B(le,te,U,ge,de);else if(ge==="object"){if(typeof K.then=="function")return B(Q(K),te,U,le,de);throw te=String(K),Error("Objects are not valid as a React child (found: "+(te==="[object Object]"?"object with keys {"+Object.keys(K).join(", ")+"}":te)+"). If you meant to render a collection of children, use an array instead.")}return se}function Y(K,te,U){if(K==null)return K;var le=[],de=0;return B(K,le,"","",function(ge){return te.call(U,ge,de++)}),le}function Z(K){if(K._status===-1){var te=K._result;te=te(),te.then(function(U){(K._status===0||K._status===-1)&&(K._status=1,K._result=U)},function(U){(K._status===0||K._status===-1)&&(K._status=2,K._result=U)}),K._status===-1&&(K._status=0,K._result=te)}if(K._status===1)return K._result.default;throw K._result}var $=typeof reportError=="function"?reportError:function(K){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var te=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof K=="object"&&K!==null&&typeof K.message=="string"?String(K.message):String(K),error:K});if(!window.dispatchEvent(te))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",K);return}console.error(K)},j={map:Y,forEach:function(K,te,U){Y(K,function(){te.apply(this,arguments)},U)},count:function(K){var te=0;return Y(K,function(){te++}),te},toArray:function(K){return Y(K,function(te){return te})||[]},only:function(K){if(!V(K))throw Error("React.Children.only expected to receive a single React element child.");return K}};return vt.Activity=g,vt.Children=j,vt.Component=w,vt.Fragment=n,vt.Profiler=r,vt.PureComponent=N,vt.StrictMode=i,vt.Suspense=d,vt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,vt.__COMPILER_RUNTIME={__proto__:null,c:function(K){return F.H.useMemoCache(K)}},vt.cache=function(K){return function(){return K.apply(null,arguments)}},vt.cacheSignal=function(){return null},vt.cloneElement=function(K,te,U){if(K==null)throw Error("The argument must be a React element, but you passed "+K+".");var le=A({},K.props),de=K.key;if(te!=null)for(ge in te.key!==void 0&&(de=""+te.key),te)!ee.call(te,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&te.ref===void 0||(le[ge]=te[ge]);var ge=arguments.length-2;if(ge===1)le.children=U;else if(1<ge){for(var se=Array(ge),pe=0;pe<ge;pe++)se[pe]=arguments[pe+2];le.children=se}return P(K.type,de,le)},vt.createContext=function(K){return K={$$typeof:l,_currentValue:K,_currentValue2:K,_threadCount:0,Provider:null,Consumer:null},K.Provider=K,K.Consumer={$$typeof:s,_context:K},K},vt.createElement=function(K,te,U){var le,de={},ge=null;if(te!=null)for(le in te.key!==void 0&&(ge=""+te.key),te)ee.call(te,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(de[le]=te[le]);var se=arguments.length-2;if(se===1)de.children=U;else if(1<se){for(var pe=Array(se),Ae=0;Ae<se;Ae++)pe[Ae]=arguments[Ae+2];de.children=pe}if(K&&K.defaultProps)for(le in se=K.defaultProps,se)de[le]===void 0&&(de[le]=se[le]);return P(K,ge,de)},vt.createRef=function(){return{current:null}},vt.forwardRef=function(K){return{$$typeof:c,render:K}},vt.isValidElement=V,vt.lazy=function(K){return{$$typeof:m,_payload:{_status:-1,_result:K},_init:Z}},vt.memo=function(K,te){return{$$typeof:p,type:K,compare:te===void 0?null:te}},vt.startTransition=function(K){var te=F.T,U={};F.T=U;try{var le=K(),de=F.S;de!==null&&de(U,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(z,$)}catch(ge){$(ge)}finally{te!==null&&U.types!==null&&(te.types=U.types),F.T=te}},vt.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},vt.use=function(K){return F.H.use(K)},vt.useActionState=function(K,te,U){return F.H.useActionState(K,te,U)},vt.useCallback=function(K,te){return F.H.useCallback(K,te)},vt.useContext=function(K){return F.H.useContext(K)},vt.useDebugValue=function(){},vt.useDeferredValue=function(K,te){return F.H.useDeferredValue(K,te)},vt.useEffect=function(K,te){return F.H.useEffect(K,te)},vt.useEffectEvent=function(K){return F.H.useEffectEvent(K)},vt.useId=function(){return F.H.useId()},vt.useImperativeHandle=function(K,te,U){return F.H.useImperativeHandle(K,te,U)},vt.useInsertionEffect=function(K,te){return F.H.useInsertionEffect(K,te)},vt.useLayoutEffect=function(K,te){return F.H.useLayoutEffect(K,te)},vt.useMemo=function(K,te){return F.H.useMemo(K,te)},vt.useOptimistic=function(K,te){return F.H.useOptimistic(K,te)},vt.useReducer=function(K,te,U){return F.H.useReducer(K,te,U)},vt.useRef=function(K){return F.H.useRef(K)},vt.useState=function(K){return F.H.useState(K)},vt.useSyncExternalStore=function(K,te,U){return F.H.useSyncExternalStore(K,te,U)},vt.useTransition=function(){return F.H.useTransition()},vt.version="19.2.4",vt}var zS;function ph(){return zS||(zS=1,Jb.exports=vO()),Jb.exports}var G=ph();const sm=lu(G);var ex={exports:{}},Gp={},tx={exports:{}},nx={};/**
19
- * @license React
20
- * scheduler.production.js
21
- *
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var BS;function _O(){return BS||(BS=1,(function(t){function e(B,Y){var Z=B.length;B.push(Y);e:for(;0<Z;){var $=Z-1>>>1,j=B[$];if(0<r(j,Y))B[$]=Y,B[Z]=j,Z=$;else break e}}function n(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var Y=B[0],Z=B.pop();if(Z!==Y){B[0]=Z;e:for(var $=0,j=B.length,K=j>>>1;$<K;){var te=2*($+1)-1,U=B[te],le=te+1,de=B[le];if(0>r(U,Z))le<j&&0>r(de,U)?(B[$]=de,B[le]=Z,$=le):(B[$]=U,B[te]=Z,$=te);else if(le<j&&0>r(de,Z))B[$]=de,B[le]=Z,$=le;else break e}}return Y}function r(B,Y){var Z=B.sortIndex-Y.sortIndex;return Z!==0?Z:B.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}var d=[],p=[],m=1,g=null,x=3,v=!1,E=!1,A=!1,C=!1,w=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function D(B){for(var Y=n(p);Y!==null;){if(Y.callback===null)i(p);else if(Y.startTime<=B)i(p),Y.sortIndex=Y.expirationTime,e(d,Y);else break;Y=n(p)}}function H(B){if(A=!1,D(B),!E)if(n(d)!==null)E=!0,z||(z=!0,X());else{var Y=n(p);Y!==null&&Q(H,Y.startTime-B)}}var z=!1,F=-1,ee=5,P=-1;function I(){return C?!0:!(t.unstable_now()-P<ee)}function V(){if(C=!1,z){var B=t.unstable_now();P=B;var Y=!0;try{e:{E=!1,A&&(A=!1,k(F),F=-1),v=!0;var Z=x;try{t:{for(D(B),g=n(d);g!==null&&!(g.expirationTime>B&&I());){var $=g.callback;if(typeof $=="function"){g.callback=null,x=g.priorityLevel;var j=$(g.expirationTime<=B);if(B=t.unstable_now(),typeof j=="function"){g.callback=j,D(B),Y=!0;break t}g===n(d)&&i(d),D(B)}else i(d);g=n(d)}if(g!==null)Y=!0;else{var K=n(p);K!==null&&Q(H,K.startTime-B),Y=!1}}break e}finally{g=null,x=Z,v=!1}Y=void 0}}finally{Y?X():z=!1}}}var X;if(typeof N=="function")X=function(){N(V)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,q=ne.port2;ne.port1.onmessage=V,X=function(){q.postMessage(null)}}else X=function(){w(V,0)};function Q(B,Y){F=w(function(){B(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(B){switch(x){case 1:case 2:case 3:var Y=3;break;default:Y=x}var Z=x;x=Y;try{return B()}finally{x=Z}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(B,Y){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Z=x;x=B;try{return Y()}finally{x=Z}},t.unstable_scheduleCallback=function(B,Y,Z){var $=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?$+Z:$):Z=$,B){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=Z+j,B={id:m++,callback:Y,priorityLevel:B,startTime:Z,expirationTime:j,sortIndex:-1},Z>$?(B.sortIndex=Z,e(p,B),n(d)===null&&B===n(p)&&(A?(k(F),F=-1):A=!0,Q(H,Z-$))):(B.sortIndex=j,e(d,B),E||v||(E=!0,z||(z=!0,X()))),B},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(B){var Y=x;return function(){var Z=x;x=Y;try{return B.apply(this,arguments)}finally{x=Z}}}})(nx)),nx}var LS;function SO(){return LS||(LS=1,tx.exports=_O()),tx.exports}var ix={exports:{}},kr={};/**
27
- * @license React
28
- * react-dom.production.js
29
- *
30
- * Copyright (c) Meta Platforms, Inc. and affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var US;function EO(){if(US)return kr;US=1;var t=ph();function e(d){var p="https://react.dev/errors/"+d;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal");function s(d,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:g==null?null:""+g,children:d,containerInfo:p,implementation:m}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,p){if(d==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return kr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,kr.createPortal=function(d,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(e(299));return s(d,p,null,m)},kr.flushSync=function(d){var p=l.T,m=i.p;try{if(l.T=null,i.p=2,d)return d()}finally{l.T=p,i.p=m,i.d.f()}},kr.preconnect=function(d,p){typeof d=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,i.d.C(d,p))},kr.prefetchDNS=function(d){typeof d=="string"&&i.d.D(d)},kr.preinit=function(d,p){if(typeof d=="string"&&p&&typeof p.as=="string"){var m=p.as,g=c(m,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,v=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?i.d.S(d,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:v}):m==="script"&&i.d.X(d,{crossOrigin:g,integrity:x,fetchPriority:v,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},kr.preinitModule=function(d,p){if(typeof d=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=c(p.as,p.crossOrigin);i.d.M(d,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&i.d.M(d)},kr.preload=function(d,p){if(typeof d=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,g=c(m,p.crossOrigin);i.d.L(d,m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},kr.preloadModule=function(d,p){if(typeof d=="string")if(p){var m=c(p.as,p.crossOrigin);i.d.m(d,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else i.d.m(d)},kr.requestFormReset=function(d){i.d.r(d)},kr.unstable_batchedUpdates=function(d,p){return d(p)},kr.useFormState=function(d,p,m){return l.H.useFormState(d,p,m)},kr.useFormStatus=function(){return l.H.useHostTransitionStatus()},kr.version="19.2.4",kr}var IS;function rC(){if(IS)return ix.exports;IS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),ix.exports=EO(),ix.exports}/**
35
- * @license React
36
- * react-dom-client.production.js
37
- *
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var HS;function wO(){if(HS)return Gp;HS=1;var t=SO(),e=ph(),n=rC();function i(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)o+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var o=a,h=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,(o.flags&4098)!==0&&(h=o.return),a=o.return;while(a)}return o.tag===3?h:null}function l(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function c(a){if(a.tag===31){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function d(a){if(s(a)!==a)throw Error(i(188))}function p(a){var o=a.alternate;if(!o){if(o=s(a),o===null)throw Error(i(188));return o!==a?null:a}for(var h=a,y=o;;){var _=h.return;if(_===null)break;var T=_.alternate;if(T===null){if(y=_.return,y!==null){h=y;continue}break}if(_.child===T.child){for(T=_.child;T;){if(T===h)return d(_),a;if(T===y)return d(_),o;T=T.sibling}throw Error(i(188))}if(h.return!==y.return)h=_,y=T;else{for(var L=!1,W=_.child;W;){if(W===h){L=!0,h=_,y=T;break}if(W===y){L=!0,y=_,h=T;break}W=W.sibling}if(!L){for(W=T.child;W;){if(W===h){L=!0,h=T,y=_;break}if(W===y){L=!0,y=T,h=_;break}W=W.sibling}if(!L)throw Error(i(189))}}if(h.alternate!==y)throw Error(i(190))}if(h.tag!==3)throw Error(i(188));return h.stateNode.current===h?a:o}function m(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=m(a),o!==null)return o;a=a.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),N=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function X(a){return a===null||typeof a!="object"?null:(a=V&&a[V]||a["@@iterator"],typeof a=="function"?a:null)}var ne=Symbol.for("react.client.reference");function q(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ne?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case A:return"Fragment";case w:return"Profiler";case C:return"StrictMode";case H:return"Suspense";case z:return"SuspenseList";case P:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case E:return"Portal";case N:return a.displayName||"Context";case k:return(a._context.displayName||"Context")+".Consumer";case D:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case F:return o=a.displayName||null,o!==null?o:q(a.type)||"Memo";case ee:o=a._payload,a=a._init;try{return q(a(o))}catch{}}return null}var Q=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},$=[],j=-1;function K(a){return{current:a}}function te(a){0>j||(a.current=$[j],$[j]=null,j--)}function U(a,o){j++,$[j]=a.current,a.current=o}var le=K(null),de=K(null),ge=K(null),se=K(null);function pe(a,o){switch(U(ge,o),U(de,a),U(le,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?J1(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=J1(o),a=eS(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}te(le),U(le,a)}function Ae(){te(le),te(de),te(ge)}function Le(a){a.memoizedState!==null&&U(se,a);var o=le.current,h=eS(o,a.type);o!==h&&(U(de,a),U(le,h))}function Ge(a){de.current===a&&(te(le),te(de)),se.current===a&&(te(se),Up._currentValue=Z)}var Pe,Ie;function We(a){if(Pe===void 0)try{throw Error()}catch(h){var o=h.stack.trim().match(/\n( *(at )?)/);Pe=o&&o[1]||"",Ie=-1<h.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+Pe+a+Ie}var ut=!1;function Ue(a,o){if(!a||ut)return"";ut=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(o){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(ve){var be=ve}Reflect.construct(a,[],Ce)}else{try{Ce.call()}catch(ve){be=ve}a.call(Ce.prototype)}}else{try{throw Error()}catch(ve){be=ve}(Ce=a())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(ve){if(ve&&be&&typeof ve.stack=="string")return[ve.stack,be.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=y.DetermineComponentFrameRoot(),L=T[0],W=T[1];if(L&&W){var re=L.split(`
45
- `),me=W.split(`
46
- `);for(_=y=0;y<re.length&&!re[y].includes("DetermineComponentFrameRoot");)y++;for(;_<me.length&&!me[_].includes("DetermineComponentFrameRoot");)_++;if(y===re.length||_===me.length)for(y=re.length-1,_=me.length-1;1<=y&&0<=_&&re[y]!==me[_];)_--;for(;1<=y&&0<=_;y--,_--)if(re[y]!==me[_]){if(y!==1||_!==1)do if(y--,_--,0>_||re[y]!==me[_]){var Se=`
47
- `+re[y].replace(" at new "," at ");return a.displayName&&Se.includes("<anonymous>")&&(Se=Se.replace("<anonymous>",a.displayName)),Se}while(1<=y&&0<=_);break}}}finally{ut=!1,Error.prepareStackTrace=h}return(h=a?a.displayName||a.name:"")?We(h):""}function At(a,o){switch(a.tag){case 26:case 27:case 5:return We(a.type);case 16:return We("Lazy");case 13:return a.child!==o&&o!==null?We("Suspense Fallback"):We("Suspense");case 19:return We("SuspenseList");case 0:case 15:return Ue(a.type,!1);case 11:return Ue(a.type.render,!1);case 1:return Ue(a.type,!0);case 31:return We("Activity");default:return""}}function zn(a){try{var o="",h=null;do o+=At(a,h),h=a,a=a.return;while(a);return o}catch(y){return`
48
- Error generating stack: `+y.message+`
49
- `+y.stack}}var Bn=Object.prototype.hasOwnProperty,bn=t.unstable_scheduleCallback,wi=t.unstable_cancelCallback,ka=t.unstable_shouldYield,Lr=t.unstable_requestPaint,hn=t.unstable_now,ua=t.unstable_getCurrentPriorityLevel,_e=t.unstable_ImmediatePriority,Re=t.unstable_UserBlockingPriority,Je=t.unstable_NormalPriority,bt=t.unstable_LowPriority,kt=t.unstable_IdlePriority,yi=t.log,rr=t.unstable_setDisableYieldValue,xn=null,Zt=null;function Gn(a){if(typeof yi=="function"&&rr(a),Zt&&typeof Zt.setStrictMode=="function")try{Zt.setStrictMode(xn,a)}catch{}}var Pt=Math.clz32?Math.clz32:go,Fi=Math.log,Qn=Math.LN2;function go(a){return a>>>=0,a===0?32:31-(Fi(a)/Qn|0)|0}var is=256,Oa=262144,rs=4194304;function bi(a){var o=a&42;if(o!==0)return o;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function ae(a,o,h){var y=a.pendingLanes;if(y===0)return 0;var _=0,T=a.suspendedLanes,L=a.pingedLanes;a=a.warmLanes;var W=y&134217727;return W!==0?(y=W&~T,y!==0?_=bi(y):(L&=W,L!==0?_=bi(L):h||(h=W&~a,h!==0&&(_=bi(h))))):(W=y&~T,W!==0?_=bi(W):L!==0?_=bi(L):h||(h=y&~a,h!==0&&(_=bi(h)))),_===0?0:o!==0&&o!==_&&(o&T)===0&&(T=_&-_,h=o&-o,T>=h||T===32&&(h&4194048)!==0)?o:_}function Ee(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function ze(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function et(){var a=rs;return rs<<=1,(rs&62914560)===0&&(rs=4194304),a}function Jt(a){for(var o=[],h=0;31>h;h++)o.push(a);return o}function en(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Fe(a,o,h,y,_,T){var L=a.pendingLanes;a.pendingLanes=h,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=h,a.entangledLanes&=h,a.errorRecoveryDisabledLanes&=h,a.shellSuspendCounter=0;var W=a.entanglements,re=a.expirationTimes,me=a.hiddenUpdates;for(h=L&~h;0<h;){var Se=31-Pt(h),Ce=1<<Se;W[Se]=0,re[Se]=-1;var be=me[Se];if(be!==null)for(me[Se]=null,Se=0;Se<be.length;Se++){var ve=be[Se];ve!==null&&(ve.lane&=-536870913)}h&=~Ce}y!==0&&He(a,y,0),T!==0&&_===0&&a.tag!==0&&(a.suspendedLanes|=T&~(L&~o))}function He(a,o,h){a.pendingLanes|=o,a.suspendedLanes&=~o;var y=31-Pt(o);a.entangledLanes|=o,a.entanglements[y]=a.entanglements[y]|1073741824|h&261930}function tt(a,o){var h=a.entangledLanes|=o;for(a=a.entanglements;h;){var y=31-Pt(h),_=1<<y;_&o|a[y]&o&&(a[y]|=o),h&=~_}}function Cn(a,o){var h=o&-o;return h=(h&42)!==0?1:Gt(h),(h&(a.suspendedLanes|o))!==0?0:h}function Gt(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function fa(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function ar(){var a=Y.p;return a!==0?a:(a=window.event,a===void 0?32:ES(a.type))}function qi(a,o){var h=Y.p;try{return Y.p=a,o()}finally{Y.p=h}}var sr=Math.random().toString(36).slice(2),yt="__reactFiber$"+sr,li="__reactProps$"+sr,Ur="__reactContainer$"+sr,Bs="__reactEvents$"+sr,_l="__reactListeners$"+sr,Sl="__reactHandles$"+sr,El="__reactResources$"+sr,Da="__reactMarker$"+sr;function Ls(a){delete a[yt],delete a[li],delete a[Bs],delete a[_l],delete a[Sl]}function tn(a){var o=a[yt];if(o)return o;for(var h=a.parentNode;h;){if(o=h[Ur]||h[yt]){if(h=o.alternate,o.child!==null||h!==null&&h.child!==null)for(a=lS(a);a!==null;){if(h=a[yt])return h;a=lS(a)}return o}a=h,h=a.parentNode}return null}function nn(a){if(a=a[yt]||a[Ur]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function lr(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(i(33))}function Ir(a){var o=a[El];return o||(o=a[El]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Ln(a){a[Da]=!0}var xr=new Set,da={};function Hr(a,o){Me(a,o),Me(a+"Capture",o)}function Me(a,o){for(da[a]=o,a=0;a<o.length;a++)xr.add(o[a])}var Ve=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),xt={},Xt={};function Un(a){return Bn.call(Xt,a)?!0:Bn.call(xt,a)?!1:Ve.test(a)?Xt[a]=!0:(xt[a]=!0,!1)}function xi(a,o,h){if(Un(o))if(h===null)a.removeAttribute(o);else{switch(typeof h){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var y=o.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+h)}}function Yi(a,o,h){if(h===null)a.removeAttribute(o);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+h)}}function Ti(a,o,h,y){if(y===null)a.removeAttribute(h);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(h);return}a.setAttributeNS(o,h,""+y)}}function un(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function or(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function yo(a,o,h){var y=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var _=y.get,T=y.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return _.call(this)},set:function(L){h=""+L,T.call(this,L)}}),Object.defineProperty(a,o,{enumerable:y.enumerable}),{getValue:function(){return h},setValue:function(L){h=""+L},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function ha(a){if(!a._valueTracker){var o=or(a)?"checked":"value";a._valueTracker=yo(a,o,""+a[o])}}function wl(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var h=o.getValue(),y="";return a&&(y=or(a)?a.checked?"true":"false":a.value),a=y,a!==h?(o.setValue(a),!0):!1}function za(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var oc=/[\n"\\]/g;function Di(a){return a.replace(oc,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function as(a,o,h,y,_,T,L,W){a.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.type=L:a.removeAttribute("type"),o!=null?L==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+un(o)):a.value!==""+un(o)&&(a.value=""+un(o)):L!=="submit"&&L!=="reset"||a.removeAttribute("value"),o!=null?Us(a,L,un(o)):h!=null?Us(a,L,un(h)):y!=null&&a.removeAttribute("value"),_==null&&T!=null&&(a.defaultChecked=!!T),_!=null&&(a.checked=_&&typeof _!="function"&&typeof _!="symbol"),W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"?a.name=""+un(W):a.removeAttribute("name")}function ss(a,o,h,y,_,T,L,W){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(a.type=T),o!=null||h!=null){if(!(T!=="submit"&&T!=="reset"||o!=null)){ha(a);return}h=h!=null?""+un(h):"",o=o!=null?""+un(o):h,W||o===a.value||(a.value=o),a.defaultValue=o}y=y??_,y=typeof y!="function"&&typeof y!="symbol"&&!!y,a.checked=W?a.checked:!!y,a.defaultChecked=!!y,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(a.name=L),ha(a)}function Us(a,o,h){o==="number"&&za(a.ownerDocument)===a||a.defaultValue===""+h||(a.defaultValue=""+h)}function oi(a,o,h,y){if(a=a.options,o){o={};for(var _=0;_<h.length;_++)o["$"+h[_]]=!0;for(h=0;h<a.length;h++)_=o.hasOwnProperty("$"+a[h].value),a[h].selected!==_&&(a[h].selected=_),_&&y&&(a[h].defaultSelected=!0)}else{for(h=""+un(h),o=null,_=0;_<a.length;_++){if(a[_].value===h){a[_].selected=!0,y&&(a[_].defaultSelected=!0);return}o!==null||a[_].disabled||(o=a[_])}o!==null&&(o.selected=!0)}}function cu(a,o,h){if(o!=null&&(o=""+un(o),o!==a.value&&(a.value=o),h==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=h!=null?""+un(h):""}function Ba(a,o,h,y){if(o==null){if(y!=null){if(h!=null)throw Error(i(92));if(Q(y)){if(1<y.length)throw Error(i(93));y=y[0]}h=y}h==null&&(h=""),o=h}h=un(o),a.defaultValue=h,y=a.textContent,y===h&&y!==""&&y!==null&&(a.value=y),ha(a)}function it(a,o){if(o){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=o;return}}a.textContent=o}var bo=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Hn(a,o,h){var y=o.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?y?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":y?a.setProperty(o,h):typeof h!="number"||h===0||bo.has(o)?o==="float"?a.cssFloat=h:a[o]=(""+h).trim():a[o]=h+"px"}function rn(a,o,h){if(o!=null&&typeof o!="object")throw Error(i(62));if(a=a.style,h!=null){for(var y in h)!h.hasOwnProperty(y)||o!=null&&o.hasOwnProperty(y)||(y.indexOf("--")===0?a.setProperty(y,""):y==="float"?a.cssFloat="":a[y]="");for(var _ in o)y=o[_],o.hasOwnProperty(_)&&h[_]!==y&&Hn(a,_,y)}else for(var T in o)o.hasOwnProperty(T)&&Hn(a,T,o[T])}function ls(a){if(a.indexOf("-")===-1)return!1;switch(a){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 os=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),cc=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Is(a){return cc.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function De(){}var qe=null;function mt(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Rt=null,An=null;function jr(a){var o=nn(a);if(o&&(a=o.stateNode)){var h=a[li]||null;e:switch(a=o.stateNode,o.type){case"input":if(as(a,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),o=h.name,h.type==="radio"&&o!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Di(""+o)+'"][type="radio"]'),o=0;o<h.length;o++){var y=h[o];if(y!==a&&y.form===a.form){var _=y[li]||null;if(!_)throw Error(i(90));as(y,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(o=0;o<h.length;o++)y=h[o],y.form===a.form&&wl(y)}break e;case"textarea":cu(a,h.value,h.defaultValue);break e;case"select":o=h.value,o!=null&&oi(a,!!h.multiple,o,!1)}}}var uc=!1;function uu(a,o,h){if(uc)return a(o,h);uc=!0;try{var y=a(o);return y}finally{if(uc=!1,(Rt!==null||An!==null)&&(J(),Rt&&(o=Rt,a=An,An=Rt=null,jr(o),a)))for(o=0;o<a.length;o++)jr(a[o])}}function xo(a,o){var h=a.stateNode;if(h===null)return null;var y=h[li]||null;if(y===null)return null;h=y[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(i(231,o,typeof h));return h}var cs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cf=!1;if(cs)try{var fu={};Object.defineProperty(fu,"passive",{get:function(){Cf=!0}}),window.addEventListener("test",fu,fu),window.removeEventListener("test",fu,fu)}catch{Cf=!1}var Tl=null,Af=null,Cl=null;function Mf(){if(Cl)return Cl;var a,o=Af,h=o.length,y,_="value"in Tl?Tl.value:Tl.textContent,T=_.length;for(a=0;a<h&&o[a]===_[a];a++);var L=h-a;for(y=1;y<=L&&o[h-y]===_[T-y];y++);return Cl=_.slice(a,1<y?1-y:void 0)}function vo(a){var o=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&o===13&&(a=13)):a=o,a===10&&(a=13),32<=a||a===13?a:0}function du(){return!0}function vh(){return!1}function Vi(a){function o(h,y,_,T,L){this._reactName=h,this._targetInst=_,this.type=y,this.nativeEvent=T,this.target=L,this.currentTarget=null;for(var W in a)a.hasOwnProperty(W)&&(h=a[W],this[W]=h?h(T):T[W]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?du:vh,this.isPropagationStopped=vh,this}return g(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=du)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=du)},persist:function(){},isPersistent:du}),o}var Al={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hu=Vi(Al),La=g({},Al,{view:0,detail:0}),Nf=Vi(La),Rf,pu,fc,mu=g({},La,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yu,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==fc&&(fc&&a.type==="mousemove"?(Rf=a.screenX-fc.screenX,pu=a.screenY-fc.screenY):pu=Rf=0,fc=a),Rf)},movementY:function(a){return"movementY"in a?a.movementY:pu}}),ng=Vi(mu),zi=g({},mu,{dataTransfer:0}),ig=Vi(zi),rg=g({},La,{relatedTarget:0}),kf=Vi(rg),ag=g({},Al,{animationName:0,elapsedTime:0,pseudoElement:0}),sg=Vi(ag),gu=g({},Al,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),_h=Vi(gu),lg=g({},Al,{data:0}),Sh=Vi(lg),og={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Eh={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"},wh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cg(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=wh[a])?!!o[a]:!1}function yu(){return cg}var Th=g({},La,{key:function(a){if(a.key){var o=og[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=vo(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Eh[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yu,charCode:function(a){return a.type==="keypress"?vo(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?vo(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Ch=Vi(Th),ug=g({},mu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Of=Vi(ug),fg=g({},La,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yu}),Hs=Vi(fg),Ah=g({},Al,{propertyName:0,elapsedTime:0,pseudoElement:0}),yb=Vi(Ah),dg=g({},mu,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Ml=Vi(dg),js=g({},Al,{newState:0,oldState:0}),Mh=Vi(js),Nh=[9,13,27,32],_o=cs&&"CompositionEvent"in window,Nl=null;cs&&"documentMode"in document&&(Nl=document.documentMode);var So=cs&&"TextEvent"in window&&!Nl,Bi=cs&&(!_o||Nl&&8<Nl&&11>=Nl),bu=" ",Rh=!1;function Df(a,o){switch(a){case"keyup":return Nh.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dc(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Rl=!1;function zf(a,o){switch(a){case"compositionend":return dc(o);case"keypress":return o.which!==32?null:(Rh=!0,bu);case"textInput":return a=o.data,a===bu&&Rh?null:a;default:return null}}function hg(a,o){if(Rl)return a==="compositionend"||!_o&&Df(a,o)?(a=Mf(),Cl=Af=Tl=null,Rl=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Bi&&o.locale!=="ko"?null:o.data;default:return null}}var Pr={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 kh(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!Pr[a.type]:o==="textarea"}function Bf(a,o,h,y){Rt?An?An.push(y):An=[y]:Rt=y,o=ry(o,"onChange"),0<o.length&&(h=new hu("onChange","change",null,h,y),a.push({event:h,listeners:o}))}var hc=null,pc=null;function Oh(a){X1(a,0)}function mc(a){var o=lr(a);if(wl(o))return a}function Dh(a,o){if(a==="change")return o}var xu=!1;if(cs){var Eo;if(cs){var Mn="oninput"in document;if(!Mn){var pg=document.createElement("div");pg.setAttribute("oninput","return;"),Mn=typeof pg.oninput=="function"}Eo=Mn}else Eo=!1;xu=Eo&&(!document.documentMode||9<document.documentMode)}function mg(){hc&&(hc.detachEvent("onpropertychange",zh),pc=hc=null)}function zh(a){if(a.propertyName==="value"&&mc(pc)){var o=[];Bf(o,pc,a,mt(a)),uu(Oh,o)}}function vu(a,o,h){a==="focusin"?(mg(),hc=o,pc=h,hc.attachEvent("onpropertychange",zh)):a==="focusout"&&mg()}function kl(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return mc(pc)}function gg(a,o){if(a==="click")return mc(o)}function yg(a,o){if(a==="input"||a==="change")return mc(o)}function wo(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var Nn=typeof Object.is=="function"?Object.is:wo;function gc(a,o){if(Nn(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var h=Object.keys(a),y=Object.keys(o);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var _=h[y];if(!Bn.call(o,_)||!Nn(a[_],o[_]))return!1}return!0}function Bh(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Lh(a,o){var h=Bh(a);a=0;for(var y;h;){if(h.nodeType===3){if(y=a+h.textContent.length,a<=o&&y>=o)return{node:h,offset:o-a};a=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=Bh(h)}}function Lf(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?Lf(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function Uf(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=za(a.document);o instanceof a.HTMLIFrameElement;){try{var h=typeof o.contentWindow.location.href=="string"}catch{h=!1}if(h)a=o.contentWindow;else break;o=za(a.document)}return o}function yc(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var bg=cs&&"documentMode"in document&&11>=document.documentMode,bc=null,If=null,xc=null,Gr=!1;function Hf(a,o,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Gr||bc==null||bc!==za(y)||(y=bc,"selectionStart"in y&&yc(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),xc&&gc(xc,y)||(xc=y,y=ry(If,"onSelect"),0<y.length&&(o=new hu("onSelect","select",null,o,h),a.push({event:o,listeners:y}),o.target=bc)))}function Ol(a,o){var h={};return h[a.toLowerCase()]=o.toLowerCase(),h["Webkit"+a]="webkit"+o,h["Moz"+a]="moz"+o,h}var vc={animationend:Ol("Animation","AnimationEnd"),animationiteration:Ol("Animation","AnimationIteration"),animationstart:Ol("Animation","AnimationStart"),transitionrun:Ol("Transition","TransitionRun"),transitionstart:Ol("Transition","TransitionStart"),transitioncancel:Ol("Transition","TransitionCancel"),transitionend:Ol("Transition","TransitionEnd")},_u={},cr={};cs&&(cr=document.createElement("div").style,"AnimationEvent"in window||(delete vc.animationend.animation,delete vc.animationiteration.animation,delete vc.animationstart.animation),"TransitionEvent"in window||delete vc.transitionend.transition);function Dl(a){if(_u[a])return _u[a];if(!vc[a])return a;var o=vc[a],h;for(h in o)if(o.hasOwnProperty(h)&&h in cr)return _u[a]=o[h];return a}var vr=Dl("animationend"),Uh=Dl("animationiteration"),us=Dl("animationstart"),_c=Dl("transitionrun"),zl=Dl("transitionstart"),Ih=Dl("transitioncancel"),jf=Dl("transitionend"),Ps=new Map,Pf="abort auxClick beforeToggle 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(" ");Pf.push("scrollEnd");function Xi(a,o){Ps.set(a,o),Hr(o,[a])}var Bl=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Ci=[],To=0,Gf=0;function Ll(){for(var a=To,o=Gf=To=0;o<a;){var h=Ci[o];Ci[o++]=null;var y=Ci[o];Ci[o++]=null;var _=Ci[o];Ci[o++]=null;var T=Ci[o];if(Ci[o++]=null,y!==null&&_!==null){var L=y.pending;L===null?_.next=_:(_.next=L.next,L.next=_),y.pending=_}T!==0&&Ff(h,_,T)}}function Su(a,o,h,y){Ci[To++]=a,Ci[To++]=o,Ci[To++]=h,Ci[To++]=y,Gf|=y,a.lanes|=y,a=a.alternate,a!==null&&(a.lanes|=y)}function Sc(a,o,h,y){return Su(a,o,h,y),Ec(a)}function Ul(a,o){return Su(a,null,null,o),Ec(a)}function Ff(a,o,h){a.lanes|=h;var y=a.alternate;y!==null&&(y.lanes|=h);for(var _=!1,T=a.return;T!==null;)T.childLanes|=h,y=T.alternate,y!==null&&(y.childLanes|=h),T.tag===22&&(a=T.stateNode,a===null||a._visibility&1||(_=!0)),a=T,T=T.return;return a.tag===3?(T=a.stateNode,_&&o!==null&&(_=31-Pt(h),a=T.hiddenUpdates,y=a[_],y===null?a[_]=[o]:y.push(o),o.lane=h|536870912),T):null}function Ec(a){if(50<Go)throw Go=0,Fo=null,Error(i(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var Il={};function xg(a,o,h,y){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ur(a,o,h,y){return new xg(a,o,h,y)}function fr(a){return a=a.prototype,!(!a||!a.isReactComponent)}function fs(a,o){var h=a.alternate;return h===null?(h=ur(a.tag,o,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=o,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&65011712,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,o=a.dependencies,h.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h.refCleanup=a.refCleanup,h}function Ki(a,o){a.flags&=65011714;var h=a.alternate;return h===null?(a.childLanes=0,a.lanes=o,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=h.childLanes,a.lanes=h.lanes,a.child=h.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=h.memoizedProps,a.memoizedState=h.memoizedState,a.updateQueue=h.updateQueue,a.type=h.type,o=h.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function Eu(a,o,h,y,_,T){var L=0;if(y=a,typeof a=="function")fr(a)&&(L=1);else if(typeof a=="string")L=rO(a,h,le.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case P:return a=ur(31,h,o,_),a.elementType=P,a.lanes=T,a;case A:return Gs(h.children,_,T,o);case C:L=8,_|=24;break;case w:return a=ur(12,h,o,_|2),a.elementType=w,a.lanes=T,a;case H:return a=ur(13,h,o,_),a.elementType=H,a.lanes=T,a;case z:return a=ur(19,h,o,_),a.elementType=z,a.lanes=T,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case N:L=10;break e;case k:L=9;break e;case D:L=11;break e;case F:L=14;break e;case ee:L=16,y=null;break e}L=29,h=Error(i(130,a===null?"null":typeof a,"")),y=null}return o=ur(L,h,o,_),o.elementType=a,o.type=y,o.lanes=T,o}function Gs(a,o,h,y){return a=ur(7,a,y,o),a.lanes=h,a}function qf(a,o,h){return a=ur(6,a,null,o),a.lanes=h,a}function vg(a){var o=ur(18,null,null,0);return o.stateNode=a,o}function Ua(a,o,h){return o=ur(4,a.children!==null?a.children:[],a.key,o),o.lanes=h,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var Hh=new WeakMap;function _r(a,o){if(typeof a=="object"&&a!==null){var h=Hh.get(a);return h!==void 0?h:(o={value:a,source:o,stack:zn(o)},Hh.set(a,o),o)}return{value:a,source:o,stack:zn(o)}}var Ia=[],Co=0,wu=null,wc=0,Fr=[],Sr=0,ds=null,hs=1,ps="";function Fs(a,o){Ia[Co++]=wc,Ia[Co++]=wu,wu=a,wc=o}function jh(a,o,h){Fr[Sr++]=hs,Fr[Sr++]=ps,Fr[Sr++]=ds,ds=a;var y=hs;a=ps;var _=32-Pt(y)-1;y&=~(1<<_),h+=1;var T=32-Pt(o)+_;if(30<T){var L=_-_%5;T=(y&(1<<L)-1).toString(32),y>>=L,_-=L,hs=1<<32-Pt(o)+_|h<<_|y,ps=T+a}else hs=1<<T|h<<_|y,ps=a}function Yf(a){a.return!==null&&(Fs(a,1),jh(a,1,0))}function Hl(a){for(;a===wu;)wu=Ia[--Co],Ia[Co]=null,wc=Ia[--Co],Ia[Co]=null;for(;a===ds;)ds=Fr[--Sr],Fr[Sr]=null,ps=Fr[--Sr],Fr[Sr]=null,hs=Fr[--Sr],Fr[Sr]=null}function Tu(a,o){Fr[Sr++]=hs,Fr[Sr++]=ps,Fr[Sr++]=ds,hs=o.id,ps=o.overflow,ds=a}var Ai=null,vn=null,zt=!1,qs=null,Mi=!1,Vf=Error(i(519));function Ot(a){var o=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Cu(_r(o,a)),Vf}function Xf(a){var o=a.stateNode,h=a.type,y=a.memoizedProps;switch(o[yt]=a,o[li]=y,h){case"dialog":Bt("cancel",o),Bt("close",o);break;case"iframe":case"object":case"embed":Bt("load",o);break;case"video":case"audio":for(h=0;h<Op.length;h++)Bt(Op[h],o);break;case"source":Bt("error",o);break;case"img":case"image":case"link":Bt("error",o),Bt("load",o);break;case"details":Bt("toggle",o);break;case"input":Bt("invalid",o),ss(o,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":Bt("invalid",o);break;case"textarea":Bt("invalid",o),Ba(o,y.value,y.defaultValue,y.children)}h=y.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||o.textContent===""+h||y.suppressHydrationWarning===!0||$1(o.textContent,h)?(y.popover!=null&&(Bt("beforetoggle",o),Bt("toggle",o)),y.onScroll!=null&&Bt("scroll",o),y.onScrollEnd!=null&&Bt("scrollend",o),y.onClick!=null&&(o.onclick=De),o=!0):o=!1,o||Ot(a,!0)}function _g(a){for(Ai=a.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:Ai=Ai.return}}function Ao(a){if(a!==Ai)return!1;if(!zt)return _g(a),zt=!0,!1;var o=a.tag,h;if((h=o!==3&&o!==27)&&((h=o===5)&&(h=a.type,h=!(h!=="form"&&h!=="button")||Ub(a.type,a.memoizedProps)),h=!h),h&&vn&&Ot(a),_g(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));vn=sS(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));vn=sS(a)}else o===27?(o=vn,Fc(a.type)?(a=Gb,Gb=null,vn=a):vn=o):vn=Ai?Ts(a.stateNode.nextSibling):null;return!0}function Mo(){vn=Ai=null,zt=!1}function Ph(){var a=qs;return a!==null&&(er===null?er=a:er.push.apply(er,a),qs=null),a}function Cu(a){qs===null?qs=[a]:qs.push(a)}var Gh=K(null),Ys=null,Wi=null;function Vs(a,o,h){U(Gh,o._currentValue),o._currentValue=h}function pa(a){a._currentValue=Gh.current,te(Gh)}function Xs(a,o,h){for(;a!==null;){var y=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,y!==null&&(y.childLanes|=o)):y!==null&&(y.childLanes&o)!==o&&(y.childLanes|=o),a===h)break;a=a.return}}function Kf(a,o,h,y){var _=a.child;for(_!==null&&(_.return=a);_!==null;){var T=_.dependencies;if(T!==null){var L=_.child;T=T.firstContext;e:for(;T!==null;){var W=T;T=_;for(var re=0;re<o.length;re++)if(W.context===o[re]){T.lanes|=h,W=T.alternate,W!==null&&(W.lanes|=h),Xs(T.return,h,a),y||(L=null);break e}T=W.next}}else if(_.tag===18){if(L=_.return,L===null)throw Error(i(341));L.lanes|=h,T=L.alternate,T!==null&&(T.lanes|=h),Xs(L,h,a),L=null}else L=_.child;if(L!==null)L.return=_;else for(L=_;L!==null;){if(L===a){L=null;break}if(_=L.sibling,_!==null){_.return=L.return,L=_;break}L=L.return}_=L}}function jl(a,o,h,y){a=null;for(var _=o,T=!1;_!==null;){if(!T){if((_.flags&524288)!==0)T=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var L=_.alternate;if(L===null)throw Error(i(387));if(L=L.memoizedProps,L!==null){var W=_.type;Nn(_.pendingProps.value,L.value)||(a!==null?a.push(W):a=[W])}}else if(_===se.current){if(L=_.alternate,L===null)throw Error(i(387));L.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(a!==null?a.push(Up):a=[Up])}_=_.return}a!==null&&Kf(o,a,h,y),o.flags|=262144}function Tc(a){for(a=a.firstContext;a!==null;){if(!Nn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function No(a){Ys=a,Wi=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Ni(a){return Fh(Ys,a)}function Au(a,o){return Ys===null&&No(a),Fh(a,o)}function Fh(a,o){var h=o._currentValue;if(o={context:o,memoizedValue:h,next:null},Wi===null){if(a===null)throw Error(i(308));Wi=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else Wi=Wi.next=o;return h}var Sg=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(h,y){a.push(y)}};this.abort=function(){o.aborted=!0,a.forEach(function(h){return h()})}},Eg=t.unstable_scheduleCallback,qh=t.unstable_NormalPriority,Ze={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yh(){return{controller:new Sg,data:new Map,refCount:0}}function Li(a){a.refCount--,a.refCount===0&&Eg(qh,function(){a.controller.abort()})}var Ro=null,Vh=0,Ks=0,Ha=null;function Cc(a,o){if(Ro===null){var h=Ro=[];Vh=0,Ks=Mb(),Ha={status:"pending",value:void 0,then:function(y){h.push(y)}}}return Vh++,o.then(Xh,Xh),o}function Xh(){if(--Vh===0&&Ro!==null){Ha!==null&&(Ha.status="fulfilled");var a=Ro;Ro=null,Ks=0,Ha=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function Kh(a,o){var h=[],y={status:"pending",value:null,reason:null,then:function(_){h.push(_)}};return a.then(function(){y.status="fulfilled",y.value=o;for(var _=0;_<h.length;_++)(0,h[_])(o)},function(_){for(y.status="rejected",y.reason=_,_=0;_<h.length;_++)(0,h[_])(void 0)}),y}var wg=B.S;B.S=function(a,o){jc=hn(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&Cc(a,o),wg!==null&&wg(a,o)};var Pl=K(null);function ms(){var a=Pl.current;return a!==null?a:sn.pooledCache}function Ac(a,o){o===null?U(Pl,Pl.current):U(Pl,o.pool)}function Wf(){var a=ms();return a===null?null:{parent:Ze._currentValue,pool:a}}var Gl=Error(i(460)),Mu=Error(i(474)),ja=Error(i(542)),Nu={then:function(){}};function Tg(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Wh(a,o,h){switch(h=a[h],h===void 0?a.push(o):h!==o&&(o.then(De,De),o=h),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,Zh(a),a;default:if(typeof o.status=="string")o.then(De,De);else{if(a=sn,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=o,a.status="pending",a.then(function(y){if(o.status==="pending"){var _=o;_.status="fulfilled",_.value=y}},function(y){if(o.status==="pending"){var _=o;_.status="rejected",_.reason=y}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,Zh(a),a}throw rt=o,Gl}}function ko(a){try{var o=a._init;return o(a._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(rt=h,Gl):h}}var rt=null;function Zf(){if(rt===null)throw Error(i(459));var a=rt;return rt=null,a}function Zh(a){if(a===Gl||a===ja)throw Error(i(483))}var Fl=null,ql=0;function $f(a){var o=ql;return ql+=1,Fl===null&&(Fl=[]),Wh(Fl,a,o)}function Ru(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function ku(a,o){throw o.$$typeof===x?Error(i(525)):(a=Object.prototype.toString.call(o),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function Mc(a){function o(ue,oe){if(a){var he=ue.deletions;he===null?(ue.deletions=[oe],ue.flags|=16):he.push(oe)}}function h(ue,oe){if(!a)return null;for(;oe!==null;)o(ue,oe),oe=oe.sibling;return null}function y(ue){for(var oe=new Map;ue!==null;)ue.key!==null?oe.set(ue.key,ue):oe.set(ue.index,ue),ue=ue.sibling;return oe}function _(ue,oe){return ue=fs(ue,oe),ue.index=0,ue.sibling=null,ue}function T(ue,oe,he){return ue.index=he,a?(he=ue.alternate,he!==null?(he=he.index,he<oe?(ue.flags|=67108866,oe):he):(ue.flags|=67108866,oe)):(ue.flags|=1048576,oe)}function L(ue){return a&&ue.alternate===null&&(ue.flags|=67108866),ue}function W(ue,oe,he,Te){return oe===null||oe.tag!==6?(oe=qf(he,ue.mode,Te),oe.return=ue,oe):(oe=_(oe,he),oe.return=ue,oe)}function re(ue,oe,he,Te){var nt=he.type;return nt===A?Se(ue,oe,he.props.children,Te,he.key):oe!==null&&(oe.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===ee&&ko(nt)===oe.type)?(oe=_(oe,he.props),Ru(oe,he),oe.return=ue,oe):(oe=Eu(he.type,he.key,he.props,null,ue.mode,Te),Ru(oe,he),oe.return=ue,oe)}function me(ue,oe,he,Te){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==he.containerInfo||oe.stateNode.implementation!==he.implementation?(oe=Ua(he,ue.mode,Te),oe.return=ue,oe):(oe=_(oe,he.children||[]),oe.return=ue,oe)}function Se(ue,oe,he,Te,nt){return oe===null||oe.tag!==7?(oe=Gs(he,ue.mode,Te,nt),oe.return=ue,oe):(oe=_(oe,he),oe.return=ue,oe)}function Ce(ue,oe,he){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return oe=qf(""+oe,ue.mode,he),oe.return=ue,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:return he=Eu(oe.type,oe.key,oe.props,null,ue.mode,he),Ru(he,oe),he.return=ue,he;case E:return oe=Ua(oe,ue.mode,he),oe.return=ue,oe;case ee:return oe=ko(oe),Ce(ue,oe,he)}if(Q(oe)||X(oe))return oe=Gs(oe,ue.mode,he,null),oe.return=ue,oe;if(typeof oe.then=="function")return Ce(ue,$f(oe),he);if(oe.$$typeof===N)return Ce(ue,Au(ue,oe),he);ku(ue,oe)}return null}function be(ue,oe,he,Te){var nt=oe!==null?oe.key:null;if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return nt!==null?null:W(ue,oe,""+he,Te);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case v:return he.key===nt?re(ue,oe,he,Te):null;case E:return he.key===nt?me(ue,oe,he,Te):null;case ee:return he=ko(he),be(ue,oe,he,Te)}if(Q(he)||X(he))return nt!==null?null:Se(ue,oe,he,Te,null);if(typeof he.then=="function")return be(ue,oe,$f(he),Te);if(he.$$typeof===N)return be(ue,oe,Au(ue,he),Te);ku(ue,he)}return null}function ve(ue,oe,he,Te,nt){if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return ue=ue.get(he)||null,W(oe,ue,""+Te,nt);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case v:return ue=ue.get(Te.key===null?he:Te.key)||null,re(oe,ue,Te,nt);case E:return ue=ue.get(Te.key===null?he:Te.key)||null,me(oe,ue,Te,nt);case ee:return Te=ko(Te),ve(ue,oe,he,Te,nt)}if(Q(Te)||X(Te))return ue=ue.get(he)||null,Se(oe,ue,Te,nt,null);if(typeof Te.then=="function")return ve(ue,oe,he,$f(Te),nt);if(Te.$$typeof===N)return ve(ue,oe,he,Au(oe,Te),nt);ku(oe,Te)}return null}function Ye(ue,oe,he,Te){for(var nt=null,on=null,Xe=oe,wt=oe=0,Ht=null;Xe!==null&&wt<he.length;wt++){Xe.index>wt?(Ht=Xe,Xe=null):Ht=Xe.sibling;var cn=be(ue,Xe,he[wt],Te);if(cn===null){Xe===null&&(Xe=Ht);break}a&&Xe&&cn.alternate===null&&o(ue,Xe),oe=T(cn,oe,wt),on===null?nt=cn:on.sibling=cn,on=cn,Xe=Ht}if(wt===he.length)return h(ue,Xe),zt&&Fs(ue,wt),nt;if(Xe===null){for(;wt<he.length;wt++)Xe=Ce(ue,he[wt],Te),Xe!==null&&(oe=T(Xe,oe,wt),on===null?nt=Xe:on.sibling=Xe,on=Xe);return zt&&Fs(ue,wt),nt}for(Xe=y(Xe);wt<he.length;wt++)Ht=ve(Xe,ue,wt,he[wt],Te),Ht!==null&&(a&&Ht.alternate!==null&&Xe.delete(Ht.key===null?wt:Ht.key),oe=T(Ht,oe,wt),on===null?nt=Ht:on.sibling=Ht,on=Ht);return a&&Xe.forEach(function(Kc){return o(ue,Kc)}),zt&&Fs(ue,wt),nt}function lt(ue,oe,he,Te){if(he==null)throw Error(i(151));for(var nt=null,on=null,Xe=oe,wt=oe=0,Ht=null,cn=he.next();Xe!==null&&!cn.done;wt++,cn=he.next()){Xe.index>wt?(Ht=Xe,Xe=null):Ht=Xe.sibling;var Kc=be(ue,Xe,cn.value,Te);if(Kc===null){Xe===null&&(Xe=Ht);break}a&&Xe&&Kc.alternate===null&&o(ue,Xe),oe=T(Kc,oe,wt),on===null?nt=Kc:on.sibling=Kc,on=Kc,Xe=Ht}if(cn.done)return h(ue,Xe),zt&&Fs(ue,wt),nt;if(Xe===null){for(;!cn.done;wt++,cn=he.next())cn=Ce(ue,cn.value,Te),cn!==null&&(oe=T(cn,oe,wt),on===null?nt=cn:on.sibling=cn,on=cn);return zt&&Fs(ue,wt),nt}for(Xe=y(Xe);!cn.done;wt++,cn=he.next())cn=ve(Xe,ue,wt,cn.value,Te),cn!==null&&(a&&cn.alternate!==null&&Xe.delete(cn.key===null?wt:cn.key),oe=T(cn,oe,wt),on===null?nt=cn:on.sibling=cn,on=cn);return a&&Xe.forEach(function(mO){return o(ue,mO)}),zt&&Fs(ue,wt),nt}function En(ue,oe,he,Te){if(typeof he=="object"&&he!==null&&he.type===A&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case v:e:{for(var nt=he.key;oe!==null;){if(oe.key===nt){if(nt=he.type,nt===A){if(oe.tag===7){h(ue,oe.sibling),Te=_(oe,he.props.children),Te.return=ue,ue=Te;break e}}else if(oe.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===ee&&ko(nt)===oe.type){h(ue,oe.sibling),Te=_(oe,he.props),Ru(Te,he),Te.return=ue,ue=Te;break e}h(ue,oe);break}else o(ue,oe);oe=oe.sibling}he.type===A?(Te=Gs(he.props.children,ue.mode,Te,he.key),Te.return=ue,ue=Te):(Te=Eu(he.type,he.key,he.props,null,ue.mode,Te),Ru(Te,he),Te.return=ue,ue=Te)}return L(ue);case E:e:{for(nt=he.key;oe!==null;){if(oe.key===nt)if(oe.tag===4&&oe.stateNode.containerInfo===he.containerInfo&&oe.stateNode.implementation===he.implementation){h(ue,oe.sibling),Te=_(oe,he.children||[]),Te.return=ue,ue=Te;break e}else{h(ue,oe);break}else o(ue,oe);oe=oe.sibling}Te=Ua(he,ue.mode,Te),Te.return=ue,ue=Te}return L(ue);case ee:return he=ko(he),En(ue,oe,he,Te)}if(Q(he))return Ye(ue,oe,he,Te);if(X(he)){if(nt=X(he),typeof nt!="function")throw Error(i(150));return he=nt.call(he),lt(ue,oe,he,Te)}if(typeof he.then=="function")return En(ue,oe,$f(he),Te);if(he.$$typeof===N)return En(ue,oe,Au(ue,he),Te);ku(ue,he)}return typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint"?(he=""+he,oe!==null&&oe.tag===6?(h(ue,oe.sibling),Te=_(oe,he),Te.return=ue,ue=Te):(h(ue,oe),Te=qf(he,ue.mode,Te),Te.return=ue,ue=Te),L(ue)):h(ue,oe)}return function(ue,oe,he,Te){try{ql=0;var nt=En(ue,oe,he,Te);return Fl=null,nt}catch(Xe){if(Xe===Gl||Xe===ja)throw Xe;var on=ur(29,Xe,null,ue.mode);return on.lanes=Te,on.return=ue,on}finally{}}}var Oo=Mc(!0),Cg=Mc(!1),Yl=!1;function $h(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qh(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function gs(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Ws(a,o,h){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Ut&2)!==0){var _=y.pending;return _===null?o.next=o:(o.next=_.next,_.next=o),y.pending=o,o=Ec(a),Ff(a,null,h),o}return Su(a,y,o,h),Ec(a)}function Vl(a,o,h){if(o=o.updateQueue,o!==null&&(o=o.shared,(h&4194048)!==0)){var y=o.lanes;y&=a.pendingLanes,h|=y,o.lanes=h,tt(a,h)}}function Qf(a,o){var h=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var _=null,T=null;if(h=h.firstBaseUpdate,h!==null){do{var L={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};T===null?_=T=L:T=T.next=L,h=h.next}while(h!==null);T===null?_=T=o:T=T.next=o}else _=T=o;h={baseState:y.baseState,firstBaseUpdate:_,lastBaseUpdate:T,shared:y.shared,callbacks:y.callbacks},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=o:a.next=o,h.lastBaseUpdate=o}var Jh=!1;function Ou(){if(Jh){var a=Ha;if(a!==null)throw a}}function Do(a,o,h,y){Jh=!1;var _=a.updateQueue;Yl=!1;var T=_.firstBaseUpdate,L=_.lastBaseUpdate,W=_.shared.pending;if(W!==null){_.shared.pending=null;var re=W,me=re.next;re.next=null,L===null?T=me:L.next=me,L=re;var Se=a.alternate;Se!==null&&(Se=Se.updateQueue,W=Se.lastBaseUpdate,W!==L&&(W===null?Se.firstBaseUpdate=me:W.next=me,Se.lastBaseUpdate=re))}if(T!==null){var Ce=_.baseState;L=0,Se=me=re=null,W=T;do{var be=W.lane&-536870913,ve=be!==W.lane;if(ve?(Dt&be)===be:(y&be)===be){be!==0&&be===Ks&&(Jh=!0),Se!==null&&(Se=Se.next={lane:0,tag:W.tag,payload:W.payload,callback:null,next:null});e:{var Ye=a,lt=W;be=o;var En=h;switch(lt.tag){case 1:if(Ye=lt.payload,typeof Ye=="function"){Ce=Ye.call(En,Ce,be);break e}Ce=Ye;break e;case 3:Ye.flags=Ye.flags&-65537|128;case 0:if(Ye=lt.payload,be=typeof Ye=="function"?Ye.call(En,Ce,be):Ye,be==null)break e;Ce=g({},Ce,be);break e;case 2:Yl=!0}}be=W.callback,be!==null&&(a.flags|=64,ve&&(a.flags|=8192),ve=_.callbacks,ve===null?_.callbacks=[be]:ve.push(be))}else ve={lane:be,tag:W.tag,payload:W.payload,callback:W.callback,next:null},Se===null?(me=Se=ve,re=Ce):Se=Se.next=ve,L|=be;if(W=W.next,W===null){if(W=_.shared.pending,W===null)break;ve=W,W=ve.next,ve.next=null,_.lastBaseUpdate=ve,_.shared.pending=null}}while(!0);Se===null&&(re=Ce),_.baseState=re,_.firstBaseUpdate=me,_.lastBaseUpdate=Se,T===null&&(_.shared.lanes=0),ea|=L,a.lanes=L,a.memoizedState=Ce}}function ys(a,o){if(typeof a!="function")throw Error(i(191,a));a.call(o)}function Ui(a,o){var h=a.callbacks;if(h!==null)for(a.callbacks=null,a=0;a<h.length;a++)ys(h[a],o)}var qr=K(null),dr=K(0);function ep(a,o){a=ii,U(dr,a),U(qr,o),ii=a|o.baseLanes}function tp(){U(dr,ii),U(qr,qr.current)}function Zi(){ii=dr.current,te(qr),te(dr)}var vi=K(null),ma=null;function Xl(a){var o=a.alternate;U(Fn,Fn.current&1),U(vi,a),ma===null&&(o===null||qr.current!==null||o.memoizedState!==null)&&(ma=a)}function np(a){U(Fn,Fn.current),U(vi,a),ma===null&&(ma=a)}function Ag(a){a.tag===22?(U(Fn,Fn.current),U(vi,a),ma===null&&(ma=a)):Zs()}function Zs(){U(Fn,Fn.current),U(vi,vi.current)}function Yr(a){te(vi),ma===a&&(ma=null),te(Fn)}var Fn=K(0);function Jf(a){for(var o=a;o!==null;){if(o.tag===13){var h=o.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||jb(h)||Pb(h)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Er=0,ot=null,pn=null,ci=null,ed=!1,bs=!1,zo=!1,td=0,Du=0,xs=null,bb=0;function qn(){throw Error(i(321))}function ip(a,o){if(o===null)return!1;for(var h=0;h<o.length&&h<a.length;h++)if(!Nn(a[h],o[h]))return!1;return!0}function rp(a,o,h,y,_,T){return Er=T,ot=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,B.H=a===null||a.memoizedState===null?Xg:kc,zo=!1,T=h(y,_),zo=!1,bs&&(T=Ng(o,h,y,_)),Mg(a),T}function Mg(a){B.H=Iu;var o=pn!==null&&pn.next!==null;if(Er=0,ci=pn=ot=null,ed=!1,Du=0,xs=null,o)throw Error(i(300));a===null||Rn||(a=a.dependencies,a!==null&&Tc(a)&&(Rn=!0))}function Ng(a,o,h,y){ot=a;var _=0;do{if(bs&&(xs=null),Du=0,bs=!1,25<=_)throw Error(i(301));if(_+=1,ci=pn=null,a.updateQueue!=null){var T=a.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}B.H=Hu,T=o(h,y)}while(bs);return T}function xb(){var a=B.H,o=a.useState()[0];return o=typeof o.then=="function"?Bu(o):o,a=a.useState()[0],(pn!==null?pn.memoizedState:null)!==a&&(ot.flags|=1024),o}function ap(){var a=td!==0;return td=0,a}function sp(a,o,h){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~h}function lp(a){if(ed){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}ed=!1}Er=0,ci=pn=ot=null,bs=!1,Du=td=0,xs=null}function hr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ci===null?ot.memoizedState=ci=a:ci=ci.next=a,ci}function Jn(){if(pn===null){var a=ot.alternate;a=a!==null?a.memoizedState:null}else a=pn.next;var o=ci===null?ot.memoizedState:ci.next;if(o!==null)ci=o,pn=a;else{if(a===null)throw ot.alternate===null?Error(i(467)):Error(i(310));pn=a,a={memoizedState:pn.memoizedState,baseState:pn.baseState,baseQueue:pn.baseQueue,queue:pn.queue,next:null},ci===null?ot.memoizedState=ci=a:ci=ci.next=a}return ci}function zu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bu(a){var o=Du;return Du+=1,xs===null&&(xs=[]),a=Wh(xs,a,o),o=ot,(ci===null?o.memoizedState:ci.next)===null&&(o=o.alternate,B.H=o===null||o.memoizedState===null?Xg:kc),a}function nd(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Bu(a);if(a.$$typeof===N)return Ni(a)}throw Error(i(438,String(a)))}function op(a){var o=null,h=ot.updateQueue;if(h!==null&&(o=h.memoCache),o==null){var y=ot.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(o={data:y.data.map(function(_){return _.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),h===null&&(h=zu(),ot.updateQueue=h),h.memoCache=o,h=o.data[o.index],h===void 0)for(h=o.data[o.index]=Array(a),y=0;y<a;y++)h[y]=I;return o.index++,h}function $s(a,o){return typeof o=="function"?o(a):o}function id(a){var o=Jn();return cp(o,pn,a)}function cp(a,o,h){var y=a.queue;if(y===null)throw Error(i(311));y.lastRenderedReducer=h;var _=a.baseQueue,T=y.pending;if(T!==null){if(_!==null){var L=_.next;_.next=T.next,T.next=L}o.baseQueue=_=T,y.pending=null}if(T=a.baseState,_===null)a.memoizedState=T;else{o=_.next;var W=L=null,re=null,me=o,Se=!1;do{var Ce=me.lane&-536870913;if(Ce!==me.lane?(Dt&Ce)===Ce:(Er&Ce)===Ce){var be=me.revertLane;if(be===0)re!==null&&(re=re.next={lane:0,revertLane:0,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null}),Ce===Ks&&(Se=!0);else if((Er&be)===be){me=me.next,be===Ks&&(Se=!0);continue}else Ce={lane:0,revertLane:me.revertLane,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},re===null?(W=re=Ce,L=T):re=re.next=Ce,ot.lanes|=be,ea|=be;Ce=me.action,zo&&h(T,Ce),T=me.hasEagerState?me.eagerState:h(T,Ce)}else be={lane:Ce,revertLane:me.revertLane,gesture:me.gesture,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},re===null?(W=re=be,L=T):re=re.next=be,ot.lanes|=Ce,ea|=Ce;me=me.next}while(me!==null&&me!==o);if(re===null?L=T:re.next=W,!Nn(T,a.memoizedState)&&(Rn=!0,Se&&(h=Ha,h!==null)))throw h;a.memoizedState=T,a.baseState=L,a.baseQueue=re,y.lastRenderedState=T}return _===null&&(y.lanes=0),[a.memoizedState,y.dispatch]}function rd(a){var o=Jn(),h=o.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=a;var y=h.dispatch,_=h.pending,T=o.memoizedState;if(_!==null){h.pending=null;var L=_=_.next;do T=a(T,L.action),L=L.next;while(L!==_);Nn(T,o.memoizedState)||(Rn=!0),o.memoizedState=T,o.baseQueue===null&&(o.baseState=T),h.lastRenderedState=T}return[T,y]}function up(a,o,h){var y=ot,_=Jn(),T=zt;if(T){if(h===void 0)throw Error(i(407));h=h()}else h=o();var L=!Nn((pn||_).memoizedState,h);if(L&&(_.memoizedState=h,Rn=!0),_=_.queue,mp(dp.bind(null,y,_,a),[a]),_.getSnapshot!==o||L||ci!==null&&ci.memoizedState.tag&1){if(y.flags|=2048,Nc(9,{destroy:void 0},fp.bind(null,y,_,h,o),null),sn===null)throw Error(i(349));T||(Er&127)!==0||Rg(y,o,h)}return h}function Rg(a,o,h){a.flags|=16384,a={getSnapshot:o,value:h},o=ot.updateQueue,o===null?(o=zu(),ot.updateQueue=o,o.stores=[a]):(h=o.stores,h===null?o.stores=[a]:h.push(a))}function fp(a,o,h,y){o.value=h,o.getSnapshot=y,hp(o)&&ad(a)}function dp(a,o,h){return h(function(){hp(o)&&ad(a)})}function hp(a){var o=a.getSnapshot;a=a.value;try{var h=o();return!Nn(a,h)}catch{return!0}}function ad(a){var o=Ul(a,2);o!==null&&f(o,a,2)}function Lu(a){var o=hr();if(typeof a=="function"){var h=a;if(a=h(),zo){Gn(!0);try{h()}finally{Gn(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$s,lastRenderedState:a},o}function kg(a,o,h,y){return a.baseState=h,cp(a,pn,typeof y=="function"?y:$s)}function vb(a,o,h,y,_){if(Qs(a))throw Error(i(485));if(a=o.action,a!==null){var T={payload:_,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){T.listeners.push(L)}};B.T!==null?h(!0):T.isTransition=!1,y(T),h=o.pending,h===null?(T.next=o.pending=T,Og(o,T)):(T.next=h.next,o.pending=h.next=T)}}function Og(a,o){var h=o.action,y=o.payload,_=a.state;if(o.isTransition){var T=B.T,L={};B.T=L;try{var W=h(_,y),re=B.S;re!==null&&re(L,W),Dg(a,o,W)}catch(me){sd(a,o,me)}finally{T!==null&&L.types!==null&&(T.types=L.types),B.T=T}}else try{T=h(_,y),Dg(a,o,T)}catch(me){sd(a,o,me)}}function Dg(a,o,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(y){pp(a,o,y)},function(y){return sd(a,o,y)}):pp(a,o,h)}function pp(a,o,h){o.status="fulfilled",o.value=h,zg(o),a.state=h,o=a.pending,o!==null&&(h=o.next,h===o?a.pending=null:(h=h.next,o.next=h,Og(a,h)))}function sd(a,o,h){var y=a.pending;if(a.pending=null,y!==null){y=y.next;do o.status="rejected",o.reason=h,zg(o),o=o.next;while(o!==y)}a.action=null}function zg(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function Bg(a,o){return o}function Lg(a,o){if(zt){var h=sn.formState;if(h!==null){e:{var y=ot;if(zt){if(vn){t:{for(var _=vn,T=Mi;_.nodeType!==8;){if(!T){_=null;break t}if(_=Ts(_.nextSibling),_===null){_=null;break t}}T=_.data,_=T==="F!"||T==="F"?_:null}if(_){vn=Ts(_.nextSibling),y=_.data==="F!";break e}}Ot(y)}y=!1}y&&(o=h[0])}}return h=hr(),h.memoizedState=h.baseState=o,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bg,lastRenderedState:o},h.queue=y,h=Vg.bind(null,ot,y),y.dispatch=h,y=Lu(!1),T=Uu.bind(null,ot,!1,y.queue),y=hr(),_={state:o,dispatch:null,action:a,pending:null},y.queue=_,h=vb.bind(null,ot,_,T,h),_.dispatch=h,y.memoizedState=a,[o,h,!1]}function Ug(a){var o=Jn();return Ig(o,pn,a)}function Ig(a,o,h){if(o=cp(a,o,Bg)[0],a=id($s)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var y=Bu(o)}catch(L){throw L===Gl?ja:L}else y=o;o=Jn();var _=o.queue,T=_.dispatch;return h!==o.memoizedState&&(ot.flags|=2048,Nc(9,{destroy:void 0},_b.bind(null,_,h),null)),[y,T,a]}function _b(a,o){a.action=o}function Hg(a){var o=Jn(),h=pn;if(h!==null)return Ig(o,h,a);Jn(),o=o.memoizedState,h=Jn();var y=h.queue.dispatch;return h.memoizedState=a,[o,y,!1]}function Nc(a,o,h,y){return a={tag:a,create:h,deps:y,inst:o,next:null},o=ot.updateQueue,o===null&&(o=zu(),ot.updateQueue=o),h=o.lastEffect,h===null?o.lastEffect=a.next=a:(y=h.next,h.next=a,a.next=y,o.lastEffect=a),a}function jg(){return Jn().memoizedState}function ld(a,o,h,y){var _=hr();ot.flags|=a,_.memoizedState=Nc(1|o,{destroy:void 0},h,y===void 0?null:y)}function od(a,o,h,y){var _=Jn();y=y===void 0?null:y;var T=_.memoizedState.inst;pn!==null&&y!==null&&ip(y,pn.memoizedState.deps)?_.memoizedState=Nc(o,T,h,y):(ot.flags|=a,_.memoizedState=Nc(1|o,T,h,y))}function Pg(a,o){ld(8390656,8,a,o)}function mp(a,o){od(2048,8,a,o)}function Gg(a){ot.flags|=4;var o=ot.updateQueue;if(o===null)o=zu(),ot.updateQueue=o,o.events=[a];else{var h=o.events;h===null?o.events=[a]:h.push(a)}}function Fg(a){var o=Jn().memoizedState;return Gg({ref:o,nextImpl:a}),function(){if((Ut&2)!==0)throw Error(i(440));return o.impl.apply(void 0,arguments)}}function qg(a,o){return od(4,2,a,o)}function Vr(a,o){return od(4,4,a,o)}function gp(a,o){if(typeof o=="function"){a=a();var h=o(a);return function(){typeof h=="function"?h():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function cd(a,o,h){h=h!=null?h.concat([a]):null,od(4,4,gp.bind(null,o,a),h)}function ud(){}function yp(a,o){var h=Jn();o=o===void 0?null:o;var y=h.memoizedState;return o!==null&&ip(o,y[1])?y[0]:(h.memoizedState=[a,o],a)}function bp(a,o){var h=Jn();o=o===void 0?null:o;var y=h.memoizedState;if(o!==null&&ip(o,y[1]))return y[0];if(y=a(),zo){Gn(!0);try{a()}finally{Gn(!1)}}return h.memoizedState=[y,o],y}function xp(a,o,h){return h===void 0||(Er&1073741824)!==0&&(Dt&261930)===0?a.memoizedState=o:(a.memoizedState=h,a=u(),ot.lanes|=a,ea|=a,h)}function vp(a,o,h,y){return Nn(h,o)?h:qr.current!==null?(a=xp(a,h,y),Nn(a,o)||(Rn=!0),a):(Er&42)===0||(Er&1073741824)!==0&&(Dt&261930)===0?(Rn=!0,a.memoizedState=h):(a=u(),ot.lanes|=a,ea|=a,o)}function _p(a,o,h,y,_){var T=Y.p;Y.p=T!==0&&8>T?T:8;var L=B.T,W={};B.T=W,Uu(a,!1,o,h);try{var re=_(),me=B.S;if(me!==null&&me(W,re),re!==null&&typeof re=="object"&&typeof re.then=="function"){var Se=Kh(re,y);Rc(a,o,Se,mr(a))}else Rc(a,o,y,mr(a))}catch(Ce){Rc(a,o,{then:function(){},status:"rejected",reason:Ce},mr())}finally{Y.p=T,L!==null&&W.types!==null&&(L.types=W.types),B.T=L}}function Sb(){}function Sp(a,o,h,y){if(a.tag!==5)throw Error(i(476));var _=Yg(a).queue;_p(a,_,o,Z,h===null?Sb:function(){return Ep(a),h(y)})}function Yg(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$s,lastRenderedState:Z},next:null};var h={};return o.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$s,lastRenderedState:h},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function Ep(a){var o=Yg(a);o.next===null&&(o=a.alternate.memoizedState),Rc(a,o.next.queue,{},mr())}function wp(){return Ni(Up)}function Ii(){return Jn().memoizedState}function Tp(){return Jn().memoizedState}function Eb(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var h=mr();a=gs(h);var y=Ws(o,a,h);y!==null&&(f(y,o,h),Vl(y,o,h)),o={cache:Yh()},a.payload=o;return}o=o.return}}function wb(a,o,h){var y=mr();h={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Qs(a)?Bo(o,h):(h=Sc(a,o,h,y),h!==null&&(f(h,a,y),wr(h,o,y)))}function Vg(a,o,h){var y=mr();Rc(a,o,h,y)}function Rc(a,o,h,y){var _={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Qs(a))Bo(o,_);else{var T=a.alternate;if(a.lanes===0&&(T===null||T.lanes===0)&&(T=o.lastRenderedReducer,T!==null))try{var L=o.lastRenderedState,W=T(L,h);if(_.hasEagerState=!0,_.eagerState=W,Nn(W,L))return Su(a,o,_,0),sn===null&&Ll(),!1}catch{}finally{}if(h=Sc(a,o,_,y),h!==null)return f(h,a,y),wr(h,o,y),!0}return!1}function Uu(a,o,h,y){if(y={lane:2,revertLane:Mb(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},Qs(a)){if(o)throw Error(i(479))}else o=Sc(a,h,y,2),o!==null&&f(o,a,2)}function Qs(a){var o=a.alternate;return a===ot||o!==null&&o===ot}function Bo(a,o){bs=ed=!0;var h=a.pending;h===null?o.next=o:(o.next=h.next,h.next=o),a.pending=o}function wr(a,o,h){if((h&4194048)!==0){var y=o.lanes;y&=a.pendingLanes,h|=y,o.lanes=h,tt(a,h)}}var Iu={readContext:Ni,use:nd,useCallback:qn,useContext:qn,useEffect:qn,useImperativeHandle:qn,useLayoutEffect:qn,useInsertionEffect:qn,useMemo:qn,useReducer:qn,useRef:qn,useState:qn,useDebugValue:qn,useDeferredValue:qn,useTransition:qn,useSyncExternalStore:qn,useId:qn,useHostTransitionStatus:qn,useFormState:qn,useActionState:qn,useOptimistic:qn,useMemoCache:qn,useCacheRefresh:qn};Iu.useEffectEvent=qn;var Xg={readContext:Ni,use:nd,useCallback:function(a,o){return hr().memoizedState=[a,o===void 0?null:o],a},useContext:Ni,useEffect:Pg,useImperativeHandle:function(a,o,h){h=h!=null?h.concat([a]):null,ld(4194308,4,gp.bind(null,o,a),h)},useLayoutEffect:function(a,o){return ld(4194308,4,a,o)},useInsertionEffect:function(a,o){ld(4,2,a,o)},useMemo:function(a,o){var h=hr();o=o===void 0?null:o;var y=a();if(zo){Gn(!0);try{a()}finally{Gn(!1)}}return h.memoizedState=[y,o],y},useReducer:function(a,o,h){var y=hr();if(h!==void 0){var _=h(o);if(zo){Gn(!0);try{h(o)}finally{Gn(!1)}}}else _=o;return y.memoizedState=y.baseState=_,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:_},y.queue=a,a=a.dispatch=wb.bind(null,ot,a),[y.memoizedState,a]},useRef:function(a){var o=hr();return a={current:a},o.memoizedState=a},useState:function(a){a=Lu(a);var o=a.queue,h=Vg.bind(null,ot,o);return o.dispatch=h,[a.memoizedState,h]},useDebugValue:ud,useDeferredValue:function(a,o){var h=hr();return xp(h,a,o)},useTransition:function(){var a=Lu(!1);return a=_p.bind(null,ot,a.queue,!0,!1),hr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,h){var y=ot,_=hr();if(zt){if(h===void 0)throw Error(i(407));h=h()}else{if(h=o(),sn===null)throw Error(i(349));(Dt&127)!==0||Rg(y,o,h)}_.memoizedState=h;var T={value:h,getSnapshot:o};return _.queue=T,Pg(dp.bind(null,y,T,a),[a]),y.flags|=2048,Nc(9,{destroy:void 0},fp.bind(null,y,T,h,o),null),h},useId:function(){var a=hr(),o=sn.identifierPrefix;if(zt){var h=ps,y=hs;h=(y&~(1<<32-Pt(y)-1)).toString(32)+h,o="_"+o+"R_"+h,h=td++,0<h&&(o+="H"+h.toString(32)),o+="_"}else h=bb++,o="_"+o+"r_"+h.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:wp,useFormState:Lg,useActionState:Lg,useOptimistic:function(a){var o=hr();o.memoizedState=o.baseState=a;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=h,o=Uu.bind(null,ot,!0,h),h.dispatch=o,[a,o]},useMemoCache:op,useCacheRefresh:function(){return hr().memoizedState=Eb.bind(null,ot)},useEffectEvent:function(a){var o=hr(),h={impl:a};return o.memoizedState=h,function(){if((Ut&2)!==0)throw Error(i(440));return h.impl.apply(void 0,arguments)}}},kc={readContext:Ni,use:nd,useCallback:yp,useContext:Ni,useEffect:mp,useImperativeHandle:cd,useInsertionEffect:qg,useLayoutEffect:Vr,useMemo:bp,useReducer:id,useRef:jg,useState:function(){return id($s)},useDebugValue:ud,useDeferredValue:function(a,o){var h=Jn();return vp(h,pn.memoizedState,a,o)},useTransition:function(){var a=id($s)[0],o=Jn().memoizedState;return[typeof a=="boolean"?a:Bu(a),o]},useSyncExternalStore:up,useId:Ii,useHostTransitionStatus:wp,useFormState:Ug,useActionState:Ug,useOptimistic:function(a,o){var h=Jn();return kg(h,pn,a,o)},useMemoCache:op,useCacheRefresh:Tp};kc.useEffectEvent=Fg;var Hu={readContext:Ni,use:nd,useCallback:yp,useContext:Ni,useEffect:mp,useImperativeHandle:cd,useInsertionEffect:qg,useLayoutEffect:Vr,useMemo:bp,useReducer:rd,useRef:jg,useState:function(){return rd($s)},useDebugValue:ud,useDeferredValue:function(a,o){var h=Jn();return pn===null?xp(h,a,o):vp(h,pn.memoizedState,a,o)},useTransition:function(){var a=rd($s)[0],o=Jn().memoizedState;return[typeof a=="boolean"?a:Bu(a),o]},useSyncExternalStore:up,useId:Ii,useHostTransitionStatus:wp,useFormState:Hg,useActionState:Hg,useOptimistic:function(a,o){var h=Jn();return pn!==null?kg(h,pn,a,o):(h.baseState=a,[a,h.queue.dispatch])},useMemoCache:op,useCacheRefresh:Tp};Hu.useEffectEvent=Fg;function Oc(a,o,h,y){o=a.memoizedState,h=h(y,o),h=h==null?o:g({},o,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var ju={enqueueSetState:function(a,o,h){a=a._reactInternals;var y=mr(),_=gs(y);_.payload=o,h!=null&&(_.callback=h),o=Ws(a,_,y),o!==null&&(f(o,a,y),Vl(o,a,y))},enqueueReplaceState:function(a,o,h){a=a._reactInternals;var y=mr(),_=gs(y);_.tag=1,_.payload=o,h!=null&&(_.callback=h),o=Ws(a,_,y),o!==null&&(f(o,a,y),Vl(o,a,y))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var h=mr(),y=gs(h);y.tag=2,o!=null&&(y.callback=o),o=Ws(a,y,h),o!==null&&(f(o,a,h),Vl(o,a,h))}};function Kg(a,o,h,y,_,T,L){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,T,L):o.prototype&&o.prototype.isPureReactComponent?!gc(h,y)||!gc(_,T):!0}function Wg(a,o,h,y){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(h,y),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(h,y),o.state!==a&&ju.enqueueReplaceState(o,o.state,null)}function Hi(a,o){var h=o;if("ref"in o){h={};for(var y in o)y!=="ref"&&(h[y]=o[y])}if(a=a.defaultProps){h===o&&(h=g({},h));for(var _ in a)h[_]===void 0&&(h[_]=a[_])}return h}function Cp(a){Bl(a)}function Zg(a){console.error(a)}function fd(a){Bl(a)}function dd(a,o){try{var h=a.onUncaughtError;h(o.value,{componentStack:o.stack})}catch(y){setTimeout(function(){throw y})}}function $g(a,o,h){try{var y=a.onCaughtError;y(h.value,{componentStack:h.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function Ap(a,o,h){return h=gs(h),h.tag=3,h.payload={element:null},h.callback=function(){dd(a,o)},h}function Dc(a){return a=gs(a),a.tag=3,a}function Tr(a,o,h,y){var _=h.type.getDerivedStateFromError;if(typeof _=="function"){var T=y.value;a.payload=function(){return _(T)},a.callback=function(){$g(o,h,y)}}var L=h.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(a.callback=function(){$g(o,h,y),typeof _!="function"&&(ws===null?ws=new Set([this]):ws.add(this));var W=y.stack;this.componentDidCatch(y.value,{componentStack:W!==null?W:""})})}function Xr(a,o,h,y,_){if(h.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(o=h.alternate,o!==null&&jl(o,h,_,!0),h=vi.current,h!==null){switch(h.tag){case 31:case 13:return ma===null?ht():h.alternate===null&&ln===0&&(ln=3),h.flags&=-257,h.flags|=65536,h.lanes=_,y===Nu?h.flags|=16384:(o=h.updateQueue,o===null?h.updateQueue=new Set([y]):o.add(y),Tb(a,y,_)),!1;case 22:return h.flags|=65536,y===Nu?h.flags|=16384:(o=h.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([y])},h.updateQueue=o):(h=o.retryQueue,h===null?o.retryQueue=new Set([y]):h.add(y)),Tb(a,y,_)),!1}throw Error(i(435,h.tag))}return Tb(a,y,_),ht(),!1}if(zt)return o=vi.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=_,y!==Vf&&(a=Error(i(422),{cause:y}),Cu(_r(a,h)))):(y!==Vf&&(o=Error(i(423),{cause:y}),Cu(_r(o,h))),a=a.current.alternate,a.flags|=65536,_&=-_,a.lanes|=_,y=_r(y,h),_=Ap(a.stateNode,y,_),Qf(a,_),ln!==4&&(ln=2)),!1;var T=Error(i(520),{cause:y});if(T=_r(T,h),Ya===null?Ya=[T]:Ya.push(T),ln!==4&&(ln=2),o===null)return!0;y=_r(y,h),h=o;do{switch(h.tag){case 3:return h.flags|=65536,a=_&-_,h.lanes|=a,a=Ap(h.stateNode,y,a),Qf(h,a),!1;case 1:if(o=h.type,T=h.stateNode,(h.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(ws===null||!ws.has(T))))return h.flags|=65536,_&=-_,h.lanes|=_,_=Dc(_),Tr(_,a,h,y),Qf(h,_),!1}h=h.return}while(h!==null);return!1}var hd=Error(i(461)),Rn=!1;function Yn(a,o,h,y){o.child=a===null?Cg(o,null,h,y):Oo(o,a.child,h,y)}function Pu(a,o,h,y,_){h=h.render;var T=o.ref;if("ref"in y){var L={};for(var W in y)W!=="ref"&&(L[W]=y[W])}else L=y;return No(o),y=rp(a,o,h,L,T,_),W=ap(),a!==null&&!Rn?(sp(a,o,_),Fa(a,o,_)):(zt&&W&&Yf(o),o.flags|=1,Yn(a,o,y,_),o.child)}function Gu(a,o,h,y,_){if(a===null){var T=h.type;return typeof T=="function"&&!fr(T)&&T.defaultProps===void 0&&h.compare===null?(o.tag=15,o.type=T,Kr(a,o,T,y,_)):(a=Eu(h.type,null,y,o,o.mode,_),a.ref=o.ref,a.return=o,o.child=a)}if(T=a.child,!Wl(a,_)){var L=T.memoizedProps;if(h=h.compare,h=h!==null?h:gc,h(L,y)&&a.ref===o.ref)return Fa(a,o,_)}return o.flags|=1,a=fs(T,y),a.ref=o.ref,a.return=o,o.child=a}function Kr(a,o,h,y,_){if(a!==null){var T=a.memoizedProps;if(gc(T,y)&&a.ref===o.ref)if(Rn=!1,o.pendingProps=y=T,Wl(a,_))(a.flags&131072)!==0&&(Rn=!0);else return o.lanes=a.lanes,Fa(a,o,_)}return zc(a,o,h,y,_)}function Wr(a,o,h,y){var _=y.children,T=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((o.flags&128)!==0){if(T=T!==null?T.baseLanes|h:h,a!==null){for(y=o.child=a.child,_=0;y!==null;)_=_|y.lanes|y.childLanes,y=y.sibling;y=_&~T}else y=0,o.child=null;return vs(a,o,T,h,y)}if((h&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&Ac(o,T!==null?T.cachePool:null),T!==null?ep(o,T):tp(),Ag(o);else return y=o.lanes=536870912,vs(a,o,T!==null?T.baseLanes|h:h,h,y)}else T!==null?(Ac(o,T.cachePool),ep(o,T),Zs(),o.memoizedState=null):(a!==null&&Ac(o,null),tp(),Zs());return Yn(a,o,_,h),o.child}function Pa(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function vs(a,o,h,y,_){var T=ms();return T=T===null?null:{parent:Ze._currentValue,pool:T},o.memoizedState={baseLanes:h,cachePool:T},a!==null&&Ac(o,null),tp(),Ag(o),a!==null&&jl(a,o,y,!0),o.childLanes=_,null}function ga(a,o){return o=Bc({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function Ri(a,o,h){return Oo(o,a.child,null,h),a=ga(o,o.pendingProps),a.flags|=2,Yr(o),o.memoizedState=null,a}function Fu(a,o,h){var y=o.pendingProps,_=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(zt){if(y.mode==="hidden")return a=ga(o,y),o.lanes=536870912,Pa(null,a);if(np(o),(a=vn)?(a=aS(a,Mi),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:ds!==null?{id:hs,overflow:ps}:null,retryLane:536870912,hydrationErrors:null},h=vg(a),h.return=o,o.child=h,Ai=o,vn=null)):a=null,a===null)throw Ot(o);return o.lanes=536870912,null}return ga(o,y)}var T=a.memoizedState;if(T!==null){var L=T.dehydrated;if(np(o),_)if(o.flags&256)o.flags&=-257,o=Ri(a,o,h);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(i(558));else if(Rn||jl(a,o,h,!1),_=(h&a.childLanes)!==0,Rn||_){if(y=sn,y!==null&&(L=Cn(y,h),L!==0&&L!==T.retryLane))throw T.retryLane=L,Ul(a,L),f(y,a,L),hd;ht(),o=Ri(a,o,h)}else a=T.treeContext,vn=Ts(L.nextSibling),Ai=o,zt=!0,qs=null,Mi=!1,a!==null&&Tu(o,a),o=ga(o,y),o.flags|=4096;return o}return a=fs(a.child,{mode:y.mode,children:y.children}),a.ref=o.ref,o.child=a,a.return=o,a}function Ga(a,o){var h=o.ref;if(h===null)a!==null&&a.ref!==null&&(o.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(i(284));(a===null||a.ref!==h)&&(o.flags|=4194816)}}function zc(a,o,h,y,_){return No(o),h=rp(a,o,h,y,void 0,_),y=ap(),a!==null&&!Rn?(sp(a,o,_),Fa(a,o,_)):(zt&&y&&Yf(o),o.flags|=1,Yn(a,o,h,_),o.child)}function $i(a,o,h,y,_,T){return No(o),o.updateQueue=null,h=Ng(o,y,h,_),Mg(a),y=ap(),a!==null&&!Rn?(sp(a,o,T),Fa(a,o,T)):(zt&&y&&Yf(o),o.flags|=1,Yn(a,o,h,T),o.child)}function ji(a,o,h,y,_){if(No(o),o.stateNode===null){var T=Il,L=h.contextType;typeof L=="object"&&L!==null&&(T=Ni(L)),T=new h(y,T),o.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=ju,o.stateNode=T,T._reactInternals=o,T=o.stateNode,T.props=y,T.state=o.memoizedState,T.refs={},$h(o),L=h.contextType,T.context=typeof L=="object"&&L!==null?Ni(L):Il,T.state=o.memoizedState,L=h.getDerivedStateFromProps,typeof L=="function"&&(Oc(o,h,L,y),T.state=o.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(L=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),L!==T.state&&ju.enqueueReplaceState(T,T.state,null),Do(o,y,T,_),Ou(),T.state=o.memoizedState),typeof T.componentDidMount=="function"&&(o.flags|=4194308),y=!0}else if(a===null){T=o.stateNode;var W=o.memoizedProps,re=Hi(h,W);T.props=re;var me=T.context,Se=h.contextType;L=Il,typeof Se=="object"&&Se!==null&&(L=Ni(Se));var Ce=h.getDerivedStateFromProps;Se=typeof Ce=="function"||typeof T.getSnapshotBeforeUpdate=="function",W=o.pendingProps!==W,Se||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(W||me!==L)&&Wg(o,T,y,L),Yl=!1;var be=o.memoizedState;T.state=be,Do(o,y,T,_),Ou(),me=o.memoizedState,W||be!==me||Yl?(typeof Ce=="function"&&(Oc(o,h,Ce,y),me=o.memoizedState),(re=Yl||Kg(o,h,re,y,be,me,L))?(Se||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(o.flags|=4194308)):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=y,o.memoizedState=me),T.props=y,T.state=me,T.context=L,y=re):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),y=!1)}else{T=o.stateNode,Qh(a,o),L=o.memoizedProps,Se=Hi(h,L),T.props=Se,Ce=o.pendingProps,be=T.context,me=h.contextType,re=Il,typeof me=="object"&&me!==null&&(re=Ni(me)),W=h.getDerivedStateFromProps,(me=typeof W=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(L!==Ce||be!==re)&&Wg(o,T,y,re),Yl=!1,be=o.memoizedState,T.state=be,Do(o,y,T,_),Ou();var ve=o.memoizedState;L!==Ce||be!==ve||Yl||a!==null&&a.dependencies!==null&&Tc(a.dependencies)?(typeof W=="function"&&(Oc(o,h,W,y),ve=o.memoizedState),(Se=Yl||Kg(o,h,Se,y,be,ve,re)||a!==null&&a.dependencies!==null&&Tc(a.dependencies))?(me||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(y,ve,re),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(y,ve,re)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||L===a.memoizedProps&&be===a.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||L===a.memoizedProps&&be===a.memoizedState||(o.flags|=1024),o.memoizedProps=y,o.memoizedState=ve),T.props=y,T.state=ve,T.context=re,y=Se):(typeof T.componentDidUpdate!="function"||L===a.memoizedProps&&be===a.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||L===a.memoizedProps&&be===a.memoizedState||(o.flags|=1024),y=!1)}return T=y,Ga(a,o),y=(o.flags&128)!==0,T||y?(T=o.stateNode,h=y&&typeof h.getDerivedStateFromError!="function"?null:T.render(),o.flags|=1,a!==null&&y?(o.child=Oo(o,a.child,null,_),o.child=Oo(o,null,h,_)):Yn(a,o,h,_),o.memoizedState=T.state,a=o.child):a=Fa(a,o,_),a}function Ft(a,o,h,y){return Mo(),o.flags|=256,Yn(a,o,h,y),o.child}var Zr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ya(a){return{baseLanes:a,cachePool:Wf()}}function qu(a,o,h){return a=a!==null?a.childLanes&~h:0,o&&(a|=It),a}function $r(a,o,h){var y=o.pendingProps,_=!1,T=(o.flags&128)!==0,L;if((L=T)||(L=a!==null&&a.memoizedState===null?!1:(Fn.current&2)!==0),L&&(_=!0,o.flags&=-129),L=(o.flags&32)!==0,o.flags&=-33,a===null){if(zt){if(_?Xl(o):Zs(),(a=vn)?(a=aS(a,Mi),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:ds!==null?{id:hs,overflow:ps}:null,retryLane:536870912,hydrationErrors:null},h=vg(a),h.return=o,o.child=h,Ai=o,vn=null)):a=null,a===null)throw Ot(o);return Pb(a)?o.lanes=32:o.lanes=536870912,null}var W=y.children;return y=y.fallback,_?(Zs(),_=o.mode,W=Bc({mode:"hidden",children:W},_),y=Gs(y,_,h,null),W.return=o,y.return=o,W.sibling=y,o.child=W,y=o.child,y.memoizedState=ya(h),y.childLanes=qu(a,L,h),o.memoizedState=Zr,Pa(null,y)):(Xl(o),Kl(o,W))}var re=a.memoizedState;if(re!==null&&(W=re.dehydrated,W!==null)){if(T)o.flags&256?(Xl(o),o.flags&=-257,o=Lc(a,o,h)):o.memoizedState!==null?(Zs(),o.child=a.child,o.flags|=128,o=null):(Zs(),W=y.fallback,_=o.mode,y=Bc({mode:"visible",children:y.children},_),W=Gs(W,_,h,null),W.flags|=2,y.return=o,W.return=o,y.sibling=W,o.child=y,Oo(o,a.child,null,h),y=o.child,y.memoizedState=ya(h),y.childLanes=qu(a,L,h),o.memoizedState=Zr,o=Pa(null,y));else if(Xl(o),Pb(W)){if(L=W.nextSibling&&W.nextSibling.dataset,L)var me=L.dgst;L=me,y=Error(i(419)),y.stack="",y.digest=L,Cu({value:y,source:null,stack:null}),o=Lc(a,o,h)}else if(Rn||jl(a,o,h,!1),L=(h&a.childLanes)!==0,Rn||L){if(L=sn,L!==null&&(y=Cn(L,h),y!==0&&y!==re.retryLane))throw re.retryLane=y,Ul(a,y),f(L,a,y),hd;jb(W)||ht(),o=Lc(a,o,h)}else jb(W)?(o.flags|=192,o.child=a.child,o=null):(a=re.treeContext,vn=Ts(W.nextSibling),Ai=o,zt=!0,qs=null,Mi=!1,a!==null&&Tu(o,a),o=Kl(o,y.children),o.flags|=4096);return o}return _?(Zs(),W=y.fallback,_=o.mode,re=a.child,me=re.sibling,y=fs(re,{mode:"hidden",children:y.children}),y.subtreeFlags=re.subtreeFlags&65011712,me!==null?W=fs(me,W):(W=Gs(W,_,h,null),W.flags|=2),W.return=o,y.return=o,y.sibling=W,o.child=y,Pa(null,y),y=o.child,W=a.child.memoizedState,W===null?W=ya(h):(_=W.cachePool,_!==null?(re=Ze._currentValue,_=_.parent!==re?{parent:re,pool:re}:_):_=Wf(),W={baseLanes:W.baseLanes|h,cachePool:_}),y.memoizedState=W,y.childLanes=qu(a,L,h),o.memoizedState=Zr,Pa(a.child,y)):(Xl(o),h=a.child,a=h.sibling,h=fs(h,{mode:"visible",children:y.children}),h.return=o,h.sibling=null,a!==null&&(L=o.deletions,L===null?(o.deletions=[a],o.flags|=16):L.push(a)),o.child=h,o.memoizedState=null,h)}function Kl(a,o){return o=Bc({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function Bc(a,o){return a=ur(22,a,null,o),a.lanes=0,a}function Lc(a,o,h){return Oo(o,a.child,null,h),a=Kl(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function Lo(a,o,h){a.lanes|=o;var y=a.alternate;y!==null&&(y.lanes|=o),Xs(a.return,o,h)}function Yu(a,o,h,y,_,T){var L=a.memoizedState;L===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:_,treeForkCount:T}:(L.isBackwards=o,L.rendering=null,L.renderingStartTime=0,L.last=y,L.tail=h,L.tailMode=_,L.treeForkCount=T)}function Vu(a,o,h){var y=o.pendingProps,_=y.revealOrder,T=y.tail;y=y.children;var L=Fn.current,W=(L&2)!==0;if(W?(L=L&1|2,o.flags|=128):L&=1,U(Fn,L),Yn(a,o,y,h),y=zt?wc:0,!W&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Lo(a,h,o);else if(a.tag===19)Lo(a,h,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(_){case"forwards":for(h=o.child,_=null;h!==null;)a=h.alternate,a!==null&&Jf(a)===null&&(_=h),h=h.sibling;h=_,h===null?(_=o.child,o.child=null):(_=h.sibling,h.sibling=null),Yu(o,!1,_,h,T,y);break;case"backwards":case"unstable_legacy-backwards":for(h=null,_=o.child,o.child=null;_!==null;){if(a=_.alternate,a!==null&&Jf(a)===null){o.child=_;break}a=_.sibling,_.sibling=h,h=_,_=a}Yu(o,!0,h,null,T,y);break;case"together":Yu(o,!1,null,null,void 0,y);break;default:o.memoizedState=null}return o.child}function Fa(a,o,h){if(a!==null&&(o.dependencies=a.dependencies),ea|=o.lanes,(h&o.childLanes)===0)if(a!==null){if(jl(a,o,h,!1),(h&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(i(153));if(o.child!==null){for(a=o.child,h=fs(a,a.pendingProps),o.child=h,h.return=o;a.sibling!==null;)a=a.sibling,h=h.sibling=fs(a,a.pendingProps),h.return=o;h.sibling=null}return o.child}function Wl(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&Tc(a)))}function Xu(a,o,h){switch(o.tag){case 3:pe(o,o.stateNode.containerInfo),Vs(o,Ze,a.memoizedState.cache),Mo();break;case 27:case 5:Le(o);break;case 4:pe(o,o.stateNode.containerInfo);break;case 10:Vs(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,np(o),null;break;case 13:var y=o.memoizedState;if(y!==null)return y.dehydrated!==null?(Xl(o),o.flags|=128,null):(h&o.child.childLanes)!==0?$r(a,o,h):(Xl(o),a=Fa(a,o,h),a!==null?a.sibling:null);Xl(o);break;case 19:var _=(a.flags&128)!==0;if(y=(h&o.childLanes)!==0,y||(jl(a,o,h,!1),y=(h&o.childLanes)!==0),_){if(y)return Vu(a,o,h);o.flags|=128}if(_=o.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),U(Fn,Fn.current),y)break;return null;case 22:return o.lanes=0,Wr(a,o,h,o.pendingProps);case 24:Vs(o,Ze,a.memoizedState.cache)}return Fa(a,o,h)}function pd(a,o,h){if(a!==null)if(a.memoizedProps!==o.pendingProps)Rn=!0;else{if(!Wl(a,h)&&(o.flags&128)===0)return Rn=!1,Xu(a,o,h);Rn=(a.flags&131072)!==0}else Rn=!1,zt&&(o.flags&1048576)!==0&&jh(o,wc,o.index);switch(o.lanes=0,o.tag){case 16:e:{var y=o.pendingProps;if(a=ko(o.elementType),o.type=a,typeof a=="function")fr(a)?(y=Hi(a,y),o.tag=1,o=ji(null,o,a,y,h)):(o.tag=0,o=zc(null,o,a,y,h));else{if(a!=null){var _=a.$$typeof;if(_===D){o.tag=11,o=Pu(null,o,a,y,h);break e}else if(_===F){o.tag=14,o=Gu(null,o,a,y,h);break e}}throw o=q(a)||a,Error(i(306,o,""))}}return o;case 0:return zc(a,o,o.type,o.pendingProps,h);case 1:return y=o.type,_=Hi(y,o.pendingProps),ji(a,o,y,_,h);case 3:e:{if(pe(o,o.stateNode.containerInfo),a===null)throw Error(i(387));y=o.pendingProps;var T=o.memoizedState;_=T.element,Qh(a,o),Do(o,y,null,h);var L=o.memoizedState;if(y=L.cache,Vs(o,Ze,y),y!==T.cache&&Kf(o,[Ze],h,!0),Ou(),y=L.element,T.isDehydrated)if(T={element:y,isDehydrated:!1,cache:L.cache},o.updateQueue.baseState=T,o.memoizedState=T,o.flags&256){o=Ft(a,o,y,h);break e}else if(y!==_){_=_r(Error(i(424)),o),Cu(_),o=Ft(a,o,y,h);break e}else{switch(a=o.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(vn=Ts(a.firstChild),Ai=o,zt=!0,qs=null,Mi=!0,h=Cg(o,null,y,h),o.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Mo(),y===_){o=Fa(a,o,h);break e}Yn(a,o,y,h)}o=o.child}return o;case 26:return Ga(a,o),a===null?(h=fS(o.type,null,o.pendingProps,null))?o.memoizedState=h:zt||(h=o.type,a=o.pendingProps,y=ay(ge.current).createElement(h),y[yt]=o,y[li]=a,gr(y,h,a),Ln(y),o.stateNode=y):o.memoizedState=fS(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return Le(o),a===null&&zt&&(y=o.stateNode=oS(o.type,o.pendingProps,ge.current),Ai=o,Mi=!0,_=vn,Fc(o.type)?(Gb=_,vn=Ts(y.firstChild)):vn=_),Yn(a,o,o.pendingProps.children,h),Ga(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&zt&&((_=y=vn)&&(y=Yk(y,o.type,o.pendingProps,Mi),y!==null?(o.stateNode=y,Ai=o,vn=Ts(y.firstChild),Mi=!1,_=!0):_=!1),_||Ot(o)),Le(o),_=o.type,T=o.pendingProps,L=a!==null?a.memoizedProps:null,y=T.children,Ub(_,T)?y=null:L!==null&&Ub(_,L)&&(o.flags|=32),o.memoizedState!==null&&(_=rp(a,o,xb,null,null,h),Up._currentValue=_),Ga(a,o),Yn(a,o,y,h),o.child;case 6:return a===null&&zt&&((a=h=vn)&&(h=Vk(h,o.pendingProps,Mi),h!==null?(o.stateNode=h,Ai=o,vn=null,a=!0):a=!1),a||Ot(o)),null;case 13:return $r(a,o,h);case 4:return pe(o,o.stateNode.containerInfo),y=o.pendingProps,a===null?o.child=Oo(o,null,y,h):Yn(a,o,y,h),o.child;case 11:return Pu(a,o,o.type,o.pendingProps,h);case 7:return Yn(a,o,o.pendingProps,h),o.child;case 8:return Yn(a,o,o.pendingProps.children,h),o.child;case 12:return Yn(a,o,o.pendingProps.children,h),o.child;case 10:return y=o.pendingProps,Vs(o,o.type,y.value),Yn(a,o,y.children,h),o.child;case 9:return _=o.type._context,y=o.pendingProps.children,No(o),_=Ni(_),y=y(_),o.flags|=1,Yn(a,o,y,h),o.child;case 14:return Gu(a,o,o.type,o.pendingProps,h);case 15:return Kr(a,o,o.type,o.pendingProps,h);case 19:return Vu(a,o,h);case 31:return Fu(a,o,h);case 22:return Wr(a,o,h,o.pendingProps);case 24:return No(o),y=Ni(Ze),a===null?(_=ms(),_===null&&(_=sn,T=Yh(),_.pooledCache=T,T.refCount++,T!==null&&(_.pooledCacheLanes|=h),_=T),o.memoizedState={parent:y,cache:_},$h(o),Vs(o,Ze,_)):((a.lanes&h)!==0&&(Qh(a,o),Do(o,null,null,h),Ou()),_=a.memoizedState,T=o.memoizedState,_.parent!==y?(_={parent:y,cache:y},o.memoizedState=_,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=_),Vs(o,Ze,y)):(y=T.cache,Vs(o,Ze,y),y!==_.cache&&Kf(o,[Ze],h,!0))),Yn(a,o,o.pendingProps.children,h),o.child;case 29:throw o.pendingProps}throw Error(i(156,o.tag))}function Cr(a){a.flags|=4}function Zl(a,o,h,y,_){if((o=(a.mode&32)!==0)&&(o=!1),o){if(a.flags|=16777216,(_&335544128)===_)if(a.stateNode.complete)a.flags|=8192;else if(ke())a.flags|=8192;else throw rt=Nu,Mu}else a.flags&=-16777217}function Js(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!gS(o))if(ke())a.flags|=8192;else throw rt=Nu,Mu}function Uc(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?et():536870912,a.lanes|=o,ta|=o)}function Ku(a,o){if(!zt)switch(a.tailMode){case"hidden":o=a.tail;for(var h=null;o!==null;)o.alternate!==null&&(h=o),o=o.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function fn(a){var o=a.alternate!==null&&a.alternate.child===a.child,h=0,y=0;if(o)for(var _=a.child;_!==null;)h|=_.lanes|_.childLanes,y|=_.subtreeFlags&65011712,y|=_.flags&65011712,_.return=a,_=_.sibling;else for(_=a.child;_!==null;)h|=_.lanes|_.childLanes,y|=_.subtreeFlags,y|=_.flags,_.return=a,_=_.sibling;return a.subtreeFlags|=y,a.childLanes=h,o}function Mp(a,o,h){var y=o.pendingProps;switch(Hl(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fn(o),null;case 1:return fn(o),null;case 3:return h=o.stateNode,y=null,a!==null&&(y=a.memoizedState.cache),o.memoizedState.cache!==y&&(o.flags|=2048),pa(Ze),Ae(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(a===null||a.child===null)&&(Ao(o)?Cr(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Ph())),fn(o),null;case 26:var _=o.type,T=o.memoizedState;return a===null?(Cr(o),T!==null?(fn(o),Js(o,T)):(fn(o),Zl(o,_,null,y,h))):T?T!==a.memoizedState?(Cr(o),fn(o),Js(o,T)):(fn(o),o.flags&=-16777217):(a=a.memoizedProps,a!==y&&Cr(o),fn(o),Zl(o,_,a,y,h)),null;case 27:if(Ge(o),h=ge.current,_=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==y&&Cr(o);else{if(!y){if(o.stateNode===null)throw Error(i(166));return fn(o),null}a=le.current,Ao(o)?Xf(o):(a=oS(_,y,h),o.stateNode=a,Cr(o))}return fn(o),null;case 5:if(Ge(o),_=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==y&&Cr(o);else{if(!y){if(o.stateNode===null)throw Error(i(166));return fn(o),null}if(T=le.current,Ao(o))Xf(o);else{var L=ay(ge.current);switch(T){case 1:T=L.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:T=L.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":T=L.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":T=L.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":T=L.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof y.is=="string"?L.createElement("select",{is:y.is}):L.createElement("select"),y.multiple?T.multiple=!0:y.size&&(T.size=y.size);break;default:T=typeof y.is=="string"?L.createElement(_,{is:y.is}):L.createElement(_)}}T[yt]=o,T[li]=y;e:for(L=o.child;L!==null;){if(L.tag===5||L.tag===6)T.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===o)break e;for(;L.sibling===null;){if(L.return===null||L.return===o)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}o.stateNode=T;e:switch(gr(T,_,y),_){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&Cr(o)}}return fn(o),Zl(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,h),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==y&&Cr(o);else{if(typeof y!="string"&&o.stateNode===null)throw Error(i(166));if(a=ge.current,Ao(o)){if(a=o.stateNode,h=o.memoizedProps,y=null,_=Ai,_!==null)switch(_.tag){case 27:case 5:y=_.memoizedProps}a[yt]=o,a=!!(a.nodeValue===h||y!==null&&y.suppressHydrationWarning===!0||$1(a.nodeValue,h)),a||Ot(o,!0)}else a=ay(a).createTextNode(y),a[yt]=o,o.stateNode=a}return fn(o),null;case 31:if(h=o.memoizedState,a===null||a.memoizedState!==null){if(y=Ao(o),h!==null){if(a===null){if(!y)throw Error(i(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[yt]=o}else Mo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;fn(o),a=!1}else h=Ph(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=h),a=!0;if(!a)return o.flags&256?(Yr(o),o):(Yr(o),null);if((o.flags&128)!==0)throw Error(i(558))}return fn(o),null;case 13:if(y=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(_=Ao(o),y!==null&&y.dehydrated!==null){if(a===null){if(!_)throw Error(i(318));if(_=o.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(i(317));_[yt]=o}else Mo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;fn(o),_=!1}else _=Ph(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=_),_=!0;if(!_)return o.flags&256?(Yr(o),o):(Yr(o),null)}return Yr(o),(o.flags&128)!==0?(o.lanes=h,o):(h=y!==null,a=a!==null&&a.memoizedState!==null,h&&(y=o.child,_=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(_=y.alternate.memoizedState.cachePool.pool),T=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(T=y.memoizedState.cachePool.pool),T!==_&&(y.flags|=2048)),h!==a&&h&&(o.child.flags|=8192),Uc(o,o.updateQueue),fn(o),null);case 4:return Ae(),a===null&&Ob(o.stateNode.containerInfo),fn(o),null;case 10:return pa(o.type),fn(o),null;case 19:if(te(Fn),y=o.memoizedState,y===null)return fn(o),null;if(_=(o.flags&128)!==0,T=y.rendering,T===null)if(_)Ku(y,!1);else{if(ln!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(T=Jf(a),T!==null){for(o.flags|=128,Ku(y,!1),a=T.updateQueue,o.updateQueue=a,Uc(o,a),o.subtreeFlags=0,a=h,h=o.child;h!==null;)Ki(h,a),h=h.sibling;return U(Fn,Fn.current&1|2),zt&&Fs(o,y.treeForkCount),o.child}a=a.sibling}y.tail!==null&&hn()>na&&(o.flags|=128,_=!0,Ku(y,!1),o.lanes=4194304)}else{if(!_)if(a=Jf(T),a!==null){if(o.flags|=128,_=!0,a=a.updateQueue,o.updateQueue=a,Uc(o,a),Ku(y,!0),y.tail===null&&y.tailMode==="hidden"&&!T.alternate&&!zt)return fn(o),null}else 2*hn()-y.renderingStartTime>na&&h!==536870912&&(o.flags|=128,_=!0,Ku(y,!1),o.lanes=4194304);y.isBackwards?(T.sibling=o.child,o.child=T):(a=y.last,a!==null?a.sibling=T:o.child=T,y.last=T)}return y.tail!==null?(a=y.tail,y.rendering=a,y.tail=a.sibling,y.renderingStartTime=hn(),a.sibling=null,h=Fn.current,U(Fn,_?h&1|2:h&1),zt&&Fs(o,y.treeForkCount),a):(fn(o),null);case 22:case 23:return Yr(o),Zi(),y=o.memoizedState!==null,a!==null?a.memoizedState!==null!==y&&(o.flags|=8192):y&&(o.flags|=8192),y?(h&536870912)!==0&&(o.flags&128)===0&&(fn(o),o.subtreeFlags&6&&(o.flags|=8192)):fn(o),h=o.updateQueue,h!==null&&Uc(o,h.retryQueue),h=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),y=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(y=o.memoizedState.cachePool.pool),y!==h&&(o.flags|=2048),a!==null&&te(Pl),null;case 24:return h=null,a!==null&&(h=a.memoizedState.cache),o.memoizedState.cache!==h&&(o.flags|=2048),pa(Ze),fn(o),null;case 25:return null;case 30:return null}throw Error(i(156,o.tag))}function md(a,o){switch(Hl(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return pa(Ze),Ae(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return Ge(o),null;case 31:if(o.memoizedState!==null){if(Yr(o),o.alternate===null)throw Error(i(340));Mo()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(Yr(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(i(340));Mo()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return te(Fn),null;case 4:return Ae(),null;case 10:return pa(o.type),null;case 22:case 23:return Yr(o),Zi(),a!==null&&te(Pl),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return pa(Ze),null;case 25:return null;default:return null}}function Uo(a,o){switch(Hl(o),o.tag){case 3:pa(Ze),Ae();break;case 26:case 27:case 5:Ge(o);break;case 4:Ae();break;case 31:o.memoizedState!==null&&Yr(o);break;case 13:Yr(o);break;case 19:te(Fn);break;case 10:pa(o.type);break;case 22:case 23:Yr(o),Zi(),a!==null&&te(Pl);break;case 24:pa(Ze)}}function _s(a,o){try{var h=o.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var _=y.next;h=_;do{if((h.tag&a)===a){y=void 0;var T=h.create,L=h.inst;y=T(),L.destroy=y}h=h.next}while(h!==_)}}catch(W){yn(o,o.return,W)}}function ba(a,o,h){try{var y=o.updateQueue,_=y!==null?y.lastEffect:null;if(_!==null){var T=_.next;y=T;do{if((y.tag&a)===a){var L=y.inst,W=L.destroy;if(W!==void 0){L.destroy=void 0,_=o;var re=h,me=W;try{me()}catch(Se){yn(_,re,Se)}}}y=y.next}while(y!==T)}}catch(Se){yn(o,o.return,Se)}}function $l(a){var o=a.updateQueue;if(o!==null){var h=a.stateNode;try{Ui(o,h)}catch(y){yn(a,a.return,y)}}}function Np(a,o,h){h.props=Hi(a.type,a.memoizedProps),h.state=a.memoizedState;try{h.componentWillUnmount()}catch(y){yn(a,o,y)}}function Ss(a,o){try{var h=a.ref;if(h!==null){switch(a.tag){case 26:case 27:case 5:var y=a.stateNode;break;case 30:y=a.stateNode;break;default:y=a.stateNode}typeof h=="function"?a.refCleanup=h(y):h.current=y}}catch(_){yn(a,o,_)}}function Qr(a,o){var h=a.ref,y=a.refCleanup;if(h!==null)if(typeof y=="function")try{y()}catch(_){yn(a,o,_)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(_){yn(a,o,_)}else h.current=null}function Jr(a){var o=a.type,h=a.memoizedProps,y=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":h.autoFocus&&y.focus();break e;case"img":h.src?y.src=h.src:h.srcSet&&(y.srcset=h.srcSet)}}catch(_){yn(a,a.return,_)}}function xa(a,o,h){try{var y=a.stateNode;Hk(y,a.type,h,o),y[li]=o}catch(_){yn(a,a.return,_)}}function ui(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Fc(a.type)||a.tag===4}function Es(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||ui(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Fc(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function _t(a,o,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,o?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(a,o):(o=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,o.appendChild(a),h=h._reactRootContainer,h!=null||o.onclick!==null||(o.onclick=De));else if(y!==4&&(y===27&&Fc(a.type)&&(h=a.stateNode,o=null),a=a.child,a!==null))for(_t(a,o,h),a=a.sibling;a!==null;)_t(a,o,h),a=a.sibling}function $t(a,o,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,o?h.insertBefore(a,o):h.appendChild(a);else if(y!==4&&(y===27&&Fc(a.type)&&(h=a.stateNode),a=a.child,a!==null))for($t(a,o,h),a=a.sibling;a!==null;)$t(a,o,h),a=a.sibling}function ei(a){var o=a.stateNode,h=a.memoizedProps;try{for(var y=a.type,_=o.attributes;_.length;)o.removeAttributeNode(_[0]);gr(o,y,h),o[yt]=a,o[li]=h}catch(T){yn(a,a.return,T)}}var va=!1,kn=!1,el=!1,Wu=typeof WeakSet=="function"?WeakSet:Set,Vn=null;function Ic(a,o){if(a=a.containerInfo,Bb=dy,a=Uf(a),yc(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var _=y.anchorOffset,T=y.focusNode;y=y.focusOffset;try{h.nodeType,T.nodeType}catch{h=null;break e}var L=0,W=-1,re=-1,me=0,Se=0,Ce=a,be=null;t:for(;;){for(var ve;Ce!==h||_!==0&&Ce.nodeType!==3||(W=L+_),Ce!==T||y!==0&&Ce.nodeType!==3||(re=L+y),Ce.nodeType===3&&(L+=Ce.nodeValue.length),(ve=Ce.firstChild)!==null;)be=Ce,Ce=ve;for(;;){if(Ce===a)break t;if(be===h&&++me===_&&(W=L),be===T&&++Se===y&&(re=L),(ve=Ce.nextSibling)!==null)break;Ce=be,be=Ce.parentNode}Ce=ve}h=W===-1||re===-1?null:{start:W,end:re}}else h=null}h=h||{start:0,end:0}}else h=null;for(Lb={focusedElem:a,selectionRange:h},dy=!1,Vn=o;Vn!==null;)if(o=Vn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,Vn=a;else for(;Vn!==null;){switch(o=Vn,T=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(h=0;h<a.length;h++)_=a[h],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&T!==null){a=void 0,h=o,_=T.memoizedProps,T=T.memoizedState,y=h.stateNode;try{var Ye=Hi(h.type,_);a=y.getSnapshotBeforeUpdate(Ye,T),y.__reactInternalSnapshotBeforeUpdate=a}catch(lt){yn(h,h.return,lt)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,h=a.nodeType,h===9)Hb(a);else if(h===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Hb(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=o.sibling,a!==null){a.return=o.return,Vn=a;break}Vn=o.return}}function Qg(a,o,h){var y=h.flags;switch(h.tag){case 0:case 11:case 15:tl(a,h),y&4&&_s(5,h);break;case 1:if(tl(a,h),y&4)if(a=h.stateNode,o===null)try{a.componentDidMount()}catch(L){yn(h,h.return,L)}else{var _=Hi(h.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(_,o,a.__reactInternalSnapshotBeforeUpdate)}catch(L){yn(h,h.return,L)}}y&64&&$l(h),y&512&&Ss(h,h.return);break;case 3:if(tl(a,h),y&64&&(a=h.updateQueue,a!==null)){if(o=null,h.child!==null)switch(h.child.tag){case 27:case 5:o=h.child.stateNode;break;case 1:o=h.child.stateNode}try{Ui(a,o)}catch(L){yn(h,h.return,L)}}break;case 27:o===null&&y&4&&ei(h);case 26:case 5:tl(a,h),o===null&&y&4&&Jr(h),y&512&&Ss(h,h.return);break;case 12:tl(a,h);break;case 31:tl(a,h),y&4&&yd(a,h);break;case 13:tl(a,h),y&4&&Rp(a,h),y&64&&(a=h.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(h=Ak.bind(null,h),Xk(a,h))));break;case 22:if(y=h.memoizedState!==null||va,!y){o=o!==null&&o.memoizedState!==null||kn,_=va;var T=kn;va=y,(kn=o)&&!T?an(a,h,(h.subtreeFlags&8772)!==0):tl(a,h),va=_,kn=T}break;case 30:break;default:tl(a,h)}}function gd(a){var o=a.alternate;o!==null&&(a.alternate=null,gd(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&Ls(o)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var qt=null,fi=!1;function Qi(a,o,h){for(h=h.child;h!==null;)Ql(a,o,h),h=h.sibling}function Ql(a,o,h){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(xn,h)}catch{}switch(h.tag){case 26:kn||Qr(h,o),Qi(a,o,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:kn||Qr(h,o);var y=qt,_=fi;Fc(h.type)&&(qt=h.stateNode,fi=!1),Qi(a,o,h),zp(h.stateNode),qt=y,fi=_;break;case 5:kn||Qr(h,o);case 6:if(y=qt,_=fi,qt=null,Qi(a,o,h),qt=y,fi=_,qt!==null)if(fi)try{(qt.nodeType===9?qt.body:qt.nodeName==="HTML"?qt.ownerDocument.body:qt).removeChild(h.stateNode)}catch(T){yn(h,o,T)}else try{qt.removeChild(h.stateNode)}catch(T){yn(h,o,T)}break;case 18:qt!==null&&(fi?(a=qt,iS(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,h.stateNode),Md(a)):iS(qt,h.stateNode));break;case 4:y=qt,_=fi,qt=h.stateNode.containerInfo,fi=!0,Qi(a,o,h),qt=y,fi=_;break;case 0:case 11:case 14:case 15:ba(2,h,o),kn||ba(4,h,o),Qi(a,o,h);break;case 1:kn||(Qr(h,o),y=h.stateNode,typeof y.componentWillUnmount=="function"&&Np(h,o,y)),Qi(a,o,h);break;case 21:Qi(a,o,h);break;case 22:kn=(y=kn)||h.memoizedState!==null,Qi(a,o,h),kn=y;break;default:Qi(a,o,h)}}function yd(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Md(a)}catch(h){yn(o,o.return,h)}}}function Rp(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Md(a)}catch(h){yn(o,o.return,h)}}function Jg(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new Wu),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new Wu),o;default:throw Error(i(435,a.tag))}}function ti(a,o){var h=Jg(a);o.forEach(function(y){if(!h.has(y)){h.add(y);var _=Mk.bind(null,a,y);y.then(_,_)}})}function Ji(a,o){var h=o.deletions;if(h!==null)for(var y=0;y<h.length;y++){var _=h[y],T=a,L=o,W=L;e:for(;W!==null;){switch(W.tag){case 27:if(Fc(W.type)){qt=W.stateNode,fi=!1;break e}break;case 5:qt=W.stateNode,fi=!1;break e;case 3:case 4:qt=W.stateNode.containerInfo,fi=!0;break e}W=W.return}if(qt===null)throw Error(i(160));Ql(T,L,_),qt=null,fi=!1,T=_.alternate,T!==null&&(T.return=null),_.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)Jl(o,a),o=o.sibling}var Ar=null;function Jl(a,o){var h=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Ji(o,a),Xn(a),y&4&&(ba(3,a,a.return),_s(3,a),ba(5,a,a.return));break;case 1:Ji(o,a),Xn(a),y&512&&(kn||h===null||Qr(h,h.return)),y&64&&va&&(a=a.updateQueue,a!==null&&(y=a.callbacks,y!==null&&(h=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=h===null?y:h.concat(y))));break;case 26:var _=Ar;if(Ji(o,a),Xn(a),y&512&&(kn||h===null||Qr(h,h.return)),y&4){var T=h!==null?h.memoizedState:null;if(y=a.memoizedState,h===null)if(y===null)if(a.stateNode===null){e:{y=a.type,h=a.memoizedProps,_=_.ownerDocument||_;t:switch(y){case"title":T=_.getElementsByTagName("title")[0],(!T||T[Da]||T[yt]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=_.createElement(y),_.head.insertBefore(T,_.querySelector("head > title"))),gr(T,y,h),T[yt]=a,Ln(T),y=T;break e;case"link":var L=pS("link","href",_).get(y+(h.href||""));if(L){for(var W=0;W<L.length;W++)if(T=L[W],T.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&T.getAttribute("rel")===(h.rel==null?null:h.rel)&&T.getAttribute("title")===(h.title==null?null:h.title)&&T.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){L.splice(W,1);break t}}T=_.createElement(y),gr(T,y,h),_.head.appendChild(T);break;case"meta":if(L=pS("meta","content",_).get(y+(h.content||""))){for(W=0;W<L.length;W++)if(T=L[W],T.getAttribute("content")===(h.content==null?null:""+h.content)&&T.getAttribute("name")===(h.name==null?null:h.name)&&T.getAttribute("property")===(h.property==null?null:h.property)&&T.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&T.getAttribute("charset")===(h.charSet==null?null:h.charSet)){L.splice(W,1);break t}}T=_.createElement(y),gr(T,y,h),_.head.appendChild(T);break;default:throw Error(i(468,y))}T[yt]=a,Ln(T),y=T}a.stateNode=y}else mS(_,a.type,a.stateNode);else a.stateNode=hS(_,y,a.memoizedProps);else T!==y?(T===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):T.count--,y===null?mS(_,a.type,a.stateNode):hS(_,y,a.memoizedProps)):y===null&&a.stateNode!==null&&xa(a,a.memoizedProps,h.memoizedProps)}break;case 27:Ji(o,a),Xn(a),y&512&&(kn||h===null||Qr(h,h.return)),h!==null&&y&4&&xa(a,a.memoizedProps,h.memoizedProps);break;case 5:if(Ji(o,a),Xn(a),y&512&&(kn||h===null||Qr(h,h.return)),a.flags&32){_=a.stateNode;try{it(_,"")}catch(Ye){yn(a,a.return,Ye)}}y&4&&a.stateNode!=null&&(_=a.memoizedProps,xa(a,_,h!==null?h.memoizedProps:_)),y&1024&&(el=!0);break;case 6:if(Ji(o,a),Xn(a),y&4){if(a.stateNode===null)throw Error(i(162));y=a.memoizedProps,h=a.stateNode;try{h.nodeValue=y}catch(Ye){yn(a,a.return,Ye)}}break;case 3:if(oy=null,_=Ar,Ar=sy(o.containerInfo),Ji(o,a),Ar=_,Xn(a),y&4&&h!==null&&h.memoizedState.isDehydrated)try{Md(o.containerInfo)}catch(Ye){yn(a,a.return,Ye)}el&&(el=!1,ey(a));break;case 4:y=Ar,Ar=sy(a.stateNode.containerInfo),Ji(o,a),Xn(a),Ar=y;break;case 12:Ji(o,a),Xn(a);break;case 31:Ji(o,a),Xn(a),y&4&&(y=a.updateQueue,y!==null&&(a.updateQueue=null,ti(a,y)));break;case 13:Ji(o,a),Xn(a),a.child.flags&8192&&a.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(rl=hn()),y&4&&(y=a.updateQueue,y!==null&&(a.updateQueue=null,ti(a,y)));break;case 22:_=a.memoizedState!==null;var re=h!==null&&h.memoizedState!==null,me=va,Se=kn;if(va=me||_,kn=Se||re,Ji(o,a),kn=Se,va=me,Xn(a),y&8192)e:for(o=a.stateNode,o._visibility=_?o._visibility&-2:o._visibility|1,_&&(h===null||re||va||kn||Io(a)),h=null,o=a;;){if(o.tag===5||o.tag===26){if(h===null){re=h=o;try{if(T=re.stateNode,_)L=T.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{W=re.stateNode;var Ce=re.memoizedProps.style,be=Ce!=null&&Ce.hasOwnProperty("display")?Ce.display:null;W.style.display=be==null||typeof be=="boolean"?"":(""+be).trim()}}catch(Ye){yn(re,re.return,Ye)}}}else if(o.tag===6){if(h===null){re=o;try{re.stateNode.nodeValue=_?"":re.memoizedProps}catch(Ye){yn(re,re.return,Ye)}}}else if(o.tag===18){if(h===null){re=o;try{var ve=re.stateNode;_?rS(ve,!0):rS(re.stateNode,!1)}catch(Ye){yn(re,re.return,Ye)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===a)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;h===o&&(h=null),o=o.return}h===o&&(h=null),o.sibling.return=o.return,o=o.sibling}y&4&&(y=a.updateQueue,y!==null&&(h=y.retryQueue,h!==null&&(y.retryQueue=null,ti(a,h))));break;case 19:Ji(o,a),Xn(a),y&4&&(y=a.updateQueue,y!==null&&(a.updateQueue=null,ti(a,y)));break;case 30:break;case 21:break;default:Ji(o,a),Xn(a)}}function Xn(a){var o=a.flags;if(o&2){try{for(var h,y=a.return;y!==null;){if(ui(y)){h=y;break}y=y.return}if(h==null)throw Error(i(160));switch(h.tag){case 27:var _=h.stateNode,T=Es(a);$t(a,T,_);break;case 5:var L=h.stateNode;h.flags&32&&(it(L,""),h.flags&=-33);var W=Es(a);$t(a,W,L);break;case 3:case 4:var re=h.stateNode.containerInfo,me=Es(a);_t(a,me,re);break;default:throw Error(i(161))}}catch(Se){yn(a,a.return,Se)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function ey(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;ey(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function tl(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Qg(a,o.alternate,o),o=o.sibling}function Io(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:ba(4,o,o.return),Io(o);break;case 1:Qr(o,o.return);var h=o.stateNode;typeof h.componentWillUnmount=="function"&&Np(o,o.return,h),Io(o);break;case 27:zp(o.stateNode);case 26:case 5:Qr(o,o.return),Io(o);break;case 22:o.memoizedState===null&&Io(o);break;case 30:Io(o);break;default:Io(o)}a=a.sibling}}function an(a,o,h){for(h=h&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var y=o.alternate,_=a,T=o,L=T.flags;switch(T.tag){case 0:case 11:case 15:an(_,T,h),_s(4,T);break;case 1:if(an(_,T,h),y=T,_=y.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(me){yn(y,y.return,me)}if(y=T,_=y.updateQueue,_!==null){var W=y.stateNode;try{var re=_.shared.hiddenCallbacks;if(re!==null)for(_.shared.hiddenCallbacks=null,_=0;_<re.length;_++)ys(re[_],W)}catch(me){yn(y,y.return,me)}}h&&L&64&&$l(T),Ss(T,T.return);break;case 27:ei(T);case 26:case 5:an(_,T,h),h&&y===null&&L&4&&Jr(T),Ss(T,T.return);break;case 12:an(_,T,h);break;case 31:an(_,T,h),h&&L&4&&yd(_,T);break;case 13:an(_,T,h),h&&L&4&&Rp(_,T);break;case 22:T.memoizedState===null&&an(_,T,h),Ss(T,T.return);break;case 30:break;default:an(_,T,h)}o=o.sibling}}function bd(a,o){var h=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==h&&(a!=null&&a.refCount++,h!=null&&Li(h))}function nl(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Li(a))}function _i(a,o,h,y){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)jn(a,o,h,y),o=o.sibling}function jn(a,o,h,y){var _=o.flags;switch(o.tag){case 0:case 11:case 15:_i(a,o,h,y),_&2048&&_s(9,o);break;case 1:_i(a,o,h,y);break;case 3:_i(a,o,h,y),_&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Li(a)));break;case 12:if(_&2048){_i(a,o,h,y),a=o.stateNode;try{var T=o.memoizedProps,L=T.id,W=T.onPostCommit;typeof W=="function"&&W(L,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(re){yn(o,o.return,re)}}else _i(a,o,h,y);break;case 31:_i(a,o,h,y);break;case 13:_i(a,o,h,y);break;case 23:break;case 22:T=o.stateNode,L=o.alternate,o.memoizedState!==null?T._visibility&2?_i(a,o,h,y):Hc(a,o):T._visibility&2?_i(a,o,h,y):(T._visibility|=2,eo(a,o,h,y,(o.subtreeFlags&10256)!==0||!1)),_&2048&&bd(L,o);break;case 24:_i(a,o,h,y),_&2048&&nl(o.alternate,o);break;default:_i(a,o,h,y)}}function eo(a,o,h,y,_){for(_=_&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var T=a,L=o,W=h,re=y,me=L.flags;switch(L.tag){case 0:case 11:case 15:eo(T,L,W,re,_),_s(8,L);break;case 23:break;case 22:var Se=L.stateNode;L.memoizedState!==null?Se._visibility&2?eo(T,L,W,re,_):Hc(T,L):(Se._visibility|=2,eo(T,L,W,re,_)),_&&me&2048&&bd(L.alternate,L);break;case 24:eo(T,L,W,re,_),_&&me&2048&&nl(L.alternate,L);break;default:eo(T,L,W,re,_)}o=o.sibling}}function Hc(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var h=a,y=o,_=y.flags;switch(y.tag){case 22:Hc(h,y),_&2048&&bd(y.alternate,y);break;case 24:Hc(h,y),_&2048&&nl(y.alternate,y);break;default:Hc(h,y)}o=o.sibling}}var Kn=8192;function Ho(a,o,h){if(a.subtreeFlags&Kn)for(a=a.child;a!==null;)ni(a,o,h),a=a.sibling}function ni(a,o,h){switch(a.tag){case 26:Ho(a,o,h),a.flags&Kn&&a.memoizedState!==null&&aO(h,Ar,a.memoizedState,a.memoizedProps);break;case 5:Ho(a,o,h);break;case 3:case 4:var y=Ar;Ar=sy(a.stateNode.containerInfo),Ho(a,o,h),Ar=y;break;case 22:a.memoizedState===null&&(y=a.alternate,y!==null&&y.memoizedState!==null?(y=Kn,Kn=16777216,Ho(a,o,h),Kn=y):Ho(a,o,h));break;default:Ho(a,o,h)}}function Mr(a){var o=a.alternate;if(o!==null&&(a=o.child,a!==null)){o.child=null;do o=a.sibling,a.sibling=null,a=o;while(a!==null)}}function pr(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var h=0;h<o.length;h++){var y=o[h];Vn=y,Zu(y,a)}Mr(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)jo(a),a=a.sibling}function jo(a){switch(a.tag){case 0:case 11:case 15:pr(a),a.flags&2048&&ba(9,a,a.return);break;case 3:pr(a);break;case 12:pr(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,xd(a)):pr(a);break;default:pr(a)}}function xd(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var h=0;h<o.length;h++){var y=o[h];Vn=y,Zu(y,a)}Mr(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:ba(8,o,o.return),xd(o);break;case 22:h=o.stateNode,h._visibility&2&&(h._visibility&=-3,xd(o));break;default:xd(o)}a=a.sibling}}function Zu(a,o){for(;Vn!==null;){var h=Vn;switch(h.tag){case 0:case 11:case 15:ba(8,h,o);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var y=h.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:Li(h.memoizedState.cache)}if(y=h.child,y!==null)y.return=h,Vn=y;else e:for(h=a;Vn!==null;){y=Vn;var _=y.sibling,T=y.return;if(gd(y),y===h){Vn=null;break e}if(_!==null){_.return=T,Vn=_;break e}Vn=T}}}var vd={getCacheForType:function(a){var o=Ni(Ze),h=o.data.get(a);return h===void 0&&(h=a(),o.data.set(a,h)),h},cacheSignal:function(){return Ni(Ze).controller.signal}},_d=typeof WeakMap=="function"?WeakMap:Map,Ut=0,sn=null,St=null,Dt=0,$e=0,Mt=null,gt=!1,Et=!1,mn=!1,ii=0,ln=0,ea=0,il=0,qa=0,It=0,ta=0,Ya=null,er=null,Nr=!1,rl=0,jc=0,na=1/0,Pc=null,ws=null,Pn=0,Va=null,ia=null,_a=0,al=0,Po=null,Sd=null,Go=0,Fo=null;function mr(){return(Ut&2)!==0&&Dt!==0?Dt&-Dt:B.T!==null?Mb():ar()}function u(){if(It===0)if((Dt&536870912)===0||zt){var a=Oa;Oa<<=1,(Oa&3932160)===0&&(Oa=262144),It=a}else It=536870912;return a=vi.current,a!==null&&(a.flags|=32),It}function f(a,o,h){(a===sn&&($e===2||$e===9)||a.cancelPendingCommit!==null)&&(fe(a,0),O(a,Dt,It,!1)),en(a,h),((Ut&2)===0||a!==sn)&&(a===sn&&((Ut&2)===0&&(il|=h),ln===4&&O(a,Dt,It,!1)),to(a))}function b(a,o,h){if((Ut&6)!==0)throw Error(i(327));var y=!h&&(o&127)===0&&(o&a.expiredLanes)===0||Ee(a,o),_=y?qo(a,o):Rr(a,o,!0),T=y;do{if(_===0){Et&&!y&&O(a,o,0,!1);break}else{if(h=a.current.alternate,T&&!M(h)){_=Rr(a,o,!1),T=!1;continue}if(_===2){if(T=o,a.errorRecoveryDisabledLanes&T)var L=0;else L=a.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){o=L;e:{var W=a;_=Ya;var re=W.current.memoizedState.isDehydrated;if(re&&(fe(W,L).flags|=256),L=Rr(W,L,!1),L!==2){if(mn&&!re){W.errorRecoveryDisabledLanes|=T,il|=T,_=4;break e}T=er,er=_,T!==null&&(er===null?er=T:er.push.apply(er,T))}_=L}if(T=!1,_!==2)continue}}if(_===1){fe(a,0),O(a,o,0,!0);break}e:{switch(y=a,T=_,T){case 0:case 1:throw Error(i(345));case 4:if((o&4194048)!==o)break;case 6:O(y,o,It,!gt);break e;case 2:er=null;break;case 3:case 5:break;default:throw Error(i(329))}if((o&62914560)===o&&(_=rl+300-hn(),10<_)){if(O(y,o,It,!gt),ae(y,0,!0)!==0)break e;_a=o,y.timeoutHandle=tS(S.bind(null,y,h,er,Pc,Nr,o,It,il,ta,gt,T,"Throttled",-0,0),_);break e}S(y,h,er,Pc,Nr,o,It,il,ta,gt,T,null,-0,0)}}break}while(!0);to(a)}function S(a,o,h,y,_,T,L,W,re,me,Se,Ce,be,ve){if(a.timeoutHandle=-1,Ce=o.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:De},ni(o,T,Ce);var Ye=(T&62914560)===T?rl-hn():(T&4194048)===T?jc-hn():0;if(Ye=sO(Ce,Ye),Ye!==null){_a=T,a.cancelPendingCommit=Ye(ct.bind(null,a,o,T,h,y,_,L,W,re,Se,Ce,null,be,ve)),O(a,T,L,!me);return}}ct(a,o,T,h,y,_,L,W,re)}function M(a){for(var o=a;;){var h=o.tag;if((h===0||h===11||h===15)&&o.flags&16384&&(h=o.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var y=0;y<h.length;y++){var _=h[y],T=_.getSnapshot;_=_.value;try{if(!Nn(T(),_))return!1}catch{return!1}}if(h=o.child,o.subtreeFlags&16384&&h!==null)h.return=o,o=h;else{if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function O(a,o,h,y){o&=~qa,o&=~il,a.suspendedLanes|=o,a.pingedLanes&=~o,y&&(a.warmLanes|=o),y=a.expirationTimes;for(var _=o;0<_;){var T=31-Pt(_),L=1<<T;y[T]=-1,_&=~L}h!==0&&He(a,h,o)}function J(){return(Ut&6)===0?(kp(0),!1):!0}function ie(){if(St!==null){if($e===0)var a=St.return;else a=St,Wi=Ys=null,lp(a),Fl=null,ql=0,a=St;for(;a!==null;)Uo(a.alternate,a),a=a.return;St=null}}function fe(a,o){var h=a.timeoutHandle;h!==-1&&(a.timeoutHandle=-1,Gk(h)),h=a.cancelPendingCommit,h!==null&&(a.cancelPendingCommit=null,h()),_a=0,ie(),sn=a,St=h=fs(a.current,null),Dt=o,$e=0,Mt=null,gt=!1,Et=Ee(a,o),mn=!1,ta=It=qa=il=ea=ln=0,er=Ya=null,Nr=!1,(o&8)!==0&&(o|=o&32);var y=a.entangledLanes;if(y!==0)for(a=a.entanglements,y&=o;0<y;){var _=31-Pt(y),T=1<<_;o|=a[_],y&=~T}return ii=o,Ll(),h}function we(a,o){ot=null,B.H=Iu,o===Gl||o===ja?(o=Zf(),$e=3):o===Mu?(o=Zf(),$e=4):$e=o===hd?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Mt=o,St===null&&(ln=1,dd(a,_r(o,a.current)))}function ke(){var a=vi.current;return a===null?!0:(Dt&4194048)===Dt?ma===null:(Dt&62914560)===Dt||(Dt&536870912)!==0?a===ma:!1}function Be(){var a=B.H;return B.H=Iu,a===null?Iu:a}function je(){var a=B.A;return B.A=vd,a}function ht(){ln=4,gt||(Dt&4194048)!==Dt&&vi.current!==null||(Et=!0),(ea&134217727)===0&&(il&134217727)===0||sn===null||O(sn,Dt,It,!1)}function Rr(a,o,h){var y=Ut;Ut|=2;var _=Be(),T=je();(sn!==a||Dt!==o)&&(Pc=null,fe(a,o)),o=!1;var L=ln;e:do try{if($e!==0&&St!==null){var W=St,re=Mt;switch($e){case 8:ie(),L=6;break e;case 3:case 2:case 9:case 6:vi.current===null&&(o=!0);var me=$e;if($e=0,Mt=null,Ne(a,W,re,me),h&&Et){L=0;break e}break;default:me=$e,$e=0,Mt=null,Ne(a,W,re,me)}}$u(),L=ln;break}catch(Se){we(a,Se)}while(!0);return o&&a.shellSuspendCounter++,Wi=Ys=null,Ut=y,B.H=_,B.A=T,St===null&&(sn=null,Dt=0,Ll()),L}function $u(){for(;St!==null;)ce(St)}function qo(a,o){var h=Ut;Ut|=2;var y=Be(),_=je();sn!==a||Dt!==o?(Pc=null,na=hn()+500,fe(a,o)):Et=Ee(a,o);e:do try{if($e!==0&&St!==null){o=St;var T=Mt;t:switch($e){case 1:$e=0,Mt=null,Ne(a,o,T,1);break;case 2:case 9:if(Tg(T)){$e=0,Mt=null,xe(o);break}o=function(){$e!==2&&$e!==9||sn!==a||($e=7),to(a)},T.then(o,o);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:Tg(T)?($e=0,Mt=null,xe(o)):($e=0,Mt=null,Ne(a,o,T,7));break;case 5:var L=null;switch(St.tag){case 26:L=St.memoizedState;case 5:case 27:var W=St;if(L?gS(L):W.stateNode.complete){$e=0,Mt=null;var re=W.sibling;if(re!==null)St=re;else{var me=W.return;me!==null?(St=me,Ke(me)):St=null}break t}}$e=0,Mt=null,Ne(a,o,T,5);break;case 6:$e=0,Mt=null,Ne(a,o,T,6);break;case 8:ie(),ln=6;break e;default:throw Error(i(462))}}ye();break}catch(Se){we(a,Se)}while(!0);return Wi=Ys=null,B.H=y,B.A=_,Ut=h,St!==null?0:(sn=null,Dt=0,Ll(),ln)}function ye(){for(;St!==null&&!ka();)ce(St)}function ce(a){var o=pd(a.alternate,a,ii);a.memoizedProps=a.pendingProps,o===null?Ke(a):St=o}function xe(a){var o=a,h=o.alternate;switch(o.tag){case 15:case 0:o=$i(h,o,o.pendingProps,o.type,void 0,Dt);break;case 11:o=$i(h,o,o.pendingProps,o.type.render,o.ref,Dt);break;case 5:lp(o);default:Uo(h,o),o=St=Ki(o,ii),o=pd(h,o,ii)}a.memoizedProps=a.pendingProps,o===null?Ke(a):St=o}function Ne(a,o,h,y){Wi=Ys=null,lp(o),Fl=null,ql=0;var _=o.return;try{if(Xr(a,_,o,h,Dt)){ln=1,dd(a,_r(h,a.current)),St=null;return}}catch(T){if(_!==null)throw St=_,T;ln=1,dd(a,_r(h,a.current)),St=null;return}o.flags&32768?(zt||y===1?a=!0:Et||(Dt&536870912)!==0?a=!1:(gt=a=!0,(y===2||y===9||y===3||y===6)&&(y=vi.current,y!==null&&y.tag===13&&(y.flags|=16384))),_n(o,a)):Ke(o)}function Ke(a){var o=a;do{if((o.flags&32768)!==0){_n(o,gt);return}a=o.return;var h=Mp(o.alternate,o,ii);if(h!==null){St=h;return}if(o=o.sibling,o!==null){St=o;return}St=o=a}while(o!==null);ln===0&&(ln=5)}function _n(a,o){do{var h=md(a.alternate,a);if(h!==null){h.flags&=32767,St=h;return}if(h=a.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!o&&(a=a.sibling,a!==null)){St=a;return}St=a=h}while(a!==null);ln=6,St=null}function ct(a,o,h,y,_,T,L,W,re){a.cancelPendingCommit=null;do Ed();while(Pn!==0);if((Ut&6)!==0)throw Error(i(327));if(o!==null){if(o===a.current)throw Error(i(177));if(T=o.lanes|o.childLanes,T|=Gf,Fe(a,h,T,L,W,re),a===sn&&(St=sn=null,Dt=0),ia=o,Va=a,_a=h,al=T,Po=_,Sd=y,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,Nk(Je,function(){return I1(),null})):(a.callbackNode=null,a.callbackPriority=0),y=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||y){y=B.T,B.T=null,_=Y.p,Y.p=2,L=Ut,Ut|=4;try{Ic(a,o,h)}finally{Ut=L,Y.p=_,B.T=y}}Pn=1,Yt(),Si(),Vt()}}function Yt(){if(Pn===1){Pn=0;var a=Va,o=ia,h=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||h){h=B.T,B.T=null;var y=Y.p;Y.p=2;var _=Ut;Ut|=4;try{Jl(o,a);var T=Lb,L=Uf(a.containerInfo),W=T.focusedElem,re=T.selectionRange;if(L!==W&&W&&W.ownerDocument&&Lf(W.ownerDocument.documentElement,W)){if(re!==null&&yc(W)){var me=re.start,Se=re.end;if(Se===void 0&&(Se=me),"selectionStart"in W)W.selectionStart=me,W.selectionEnd=Math.min(Se,W.value.length);else{var Ce=W.ownerDocument||document,be=Ce&&Ce.defaultView||window;if(be.getSelection){var ve=be.getSelection(),Ye=W.textContent.length,lt=Math.min(re.start,Ye),En=re.end===void 0?lt:Math.min(re.end,Ye);!ve.extend&&lt>En&&(L=En,En=lt,lt=L);var ue=Lh(W,lt),oe=Lh(W,En);if(ue&&oe&&(ve.rangeCount!==1||ve.anchorNode!==ue.node||ve.anchorOffset!==ue.offset||ve.focusNode!==oe.node||ve.focusOffset!==oe.offset)){var he=Ce.createRange();he.setStart(ue.node,ue.offset),ve.removeAllRanges(),lt>En?(ve.addRange(he),ve.extend(oe.node,oe.offset)):(he.setEnd(oe.node,oe.offset),ve.addRange(he))}}}}for(Ce=[],ve=W;ve=ve.parentNode;)ve.nodeType===1&&Ce.push({element:ve,left:ve.scrollLeft,top:ve.scrollTop});for(typeof W.focus=="function"&&W.focus(),W=0;W<Ce.length;W++){var Te=Ce[W];Te.element.scrollLeft=Te.left,Te.element.scrollTop=Te.top}}dy=!!Bb,Lb=Bb=null}finally{Ut=_,Y.p=y,B.T=h}}a.current=o,Pn=2}}function Si(){if(Pn===2){Pn=0;var a=Va,o=ia,h=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||h){h=B.T,B.T=null;var y=Y.p;Y.p=2;var _=Ut;Ut|=4;try{Qg(a,o.alternate,o)}finally{Ut=_,Y.p=y,B.T=h}}Pn=3}}function Vt(){if(Pn===4||Pn===3){Pn=0,Lr();var a=Va,o=ia,h=_a,y=Sd;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Pn=5:(Pn=0,ia=Va=null,sl(a,a.pendingLanes));var _=a.pendingLanes;if(_===0&&(ws=null),fa(h),o=o.stateNode,Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(xn,o,void 0,(o.current.flags&128)===128)}catch{}if(y!==null){o=B.T,_=Y.p,Y.p=2,B.T=null;try{for(var T=a.onRecoverableError,L=0;L<y.length;L++){var W=y[L];T(W.value,{componentStack:W.stack})}}finally{B.T=o,Y.p=_}}(_a&3)!==0&&Ed(),to(a),_=a.pendingLanes,(h&261930)!==0&&(_&42)!==0?a===Fo?Go++:(Go=0,Fo=a):Go=0,kp(0)}}function sl(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,Li(o)))}function Ed(){return Yt(),Si(),Vt(),I1()}function I1(){if(Pn!==5)return!1;var a=Va,o=al;al=0;var h=fa(_a),y=B.T,_=Y.p;try{Y.p=32>h?32:h,B.T=null,h=Po,Po=null;var T=Va,L=_a;if(Pn=0,ia=Va=null,_a=0,(Ut&6)!==0)throw Error(i(331));var W=Ut;if(Ut|=4,jo(T.current),jn(T,T.current,L,h),Ut=W,kp(0,!1),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(xn,T)}catch{}return!0}finally{Y.p=_,B.T=y,sl(a,o)}}function H1(a,o,h){o=_r(h,o),o=Ap(a.stateNode,o,2),a=Ws(a,o,2),a!==null&&(en(a,2),to(a))}function yn(a,o,h){if(a.tag===3)H1(a,a,h);else for(;o!==null;){if(o.tag===3){H1(o,a,h);break}else if(o.tag===1){var y=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ws===null||!ws.has(y))){a=_r(h,a),h=Dc(2),y=Ws(o,h,2),y!==null&&(Tr(h,y,o,a),en(y,2),to(y));break}}o=o.return}}function Tb(a,o,h){var y=a.pingCache;if(y===null){y=a.pingCache=new _d;var _=new Set;y.set(o,_)}else _=y.get(o),_===void 0&&(_=new Set,y.set(o,_));_.has(h)||(mn=!0,_.add(h),a=Ck.bind(null,a,o,h),o.then(a,a))}function Ck(a,o,h){var y=a.pingCache;y!==null&&y.delete(o),a.pingedLanes|=a.suspendedLanes&h,a.warmLanes&=~h,sn===a&&(Dt&h)===h&&(ln===4||ln===3&&(Dt&62914560)===Dt&&300>hn()-rl?(Ut&2)===0&&fe(a,0):qa|=h,ta===Dt&&(ta=0)),to(a)}function j1(a,o){o===0&&(o=et()),a=Ul(a,o),a!==null&&(en(a,o),to(a))}function Ak(a){var o=a.memoizedState,h=0;o!==null&&(h=o.retryLane),j1(a,h)}function Mk(a,o){var h=0;switch(a.tag){case 31:case 13:var y=a.stateNode,_=a.memoizedState;_!==null&&(h=_.retryLane);break;case 19:y=a.stateNode;break;case 22:y=a.stateNode._retryCache;break;default:throw Error(i(314))}y!==null&&y.delete(o),j1(a,h)}function Nk(a,o){return bn(a,o)}var ty=null,wd=null,Cb=!1,ny=!1,Ab=!1,Gc=0;function to(a){a!==wd&&a.next===null&&(wd===null?ty=wd=a:wd=wd.next=a),ny=!0,Cb||(Cb=!0,kk())}function kp(a,o){if(!Ab&&ny){Ab=!0;do for(var h=!1,y=ty;y!==null;){if(a!==0){var _=y.pendingLanes;if(_===0)var T=0;else{var L=y.suspendedLanes,W=y.pingedLanes;T=(1<<31-Pt(42|a)+1)-1,T&=_&~(L&~W),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(h=!0,q1(y,T))}else T=Dt,T=ae(y,y===sn?T:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(T&3)===0||Ee(y,T)||(h=!0,q1(y,T));y=y.next}while(h);Ab=!1}}function Rk(){P1()}function P1(){ny=Cb=!1;var a=0;Gc!==0&&Pk()&&(a=Gc);for(var o=hn(),h=null,y=ty;y!==null;){var _=y.next,T=G1(y,o);T===0?(y.next=null,h===null?ty=_:h.next=_,_===null&&(wd=h)):(h=y,(a!==0||(T&3)!==0)&&(ny=!0)),y=_}Pn!==0&&Pn!==5||kp(a),Gc!==0&&(Gc=0)}function G1(a,o){for(var h=a.suspendedLanes,y=a.pingedLanes,_=a.expirationTimes,T=a.pendingLanes&-62914561;0<T;){var L=31-Pt(T),W=1<<L,re=_[L];re===-1?((W&h)===0||(W&y)!==0)&&(_[L]=ze(W,o)):re<=o&&(a.expiredLanes|=W),T&=~W}if(o=sn,h=Dt,h=ae(a,a===o?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),y=a.callbackNode,h===0||a===o&&($e===2||$e===9)||a.cancelPendingCommit!==null)return y!==null&&y!==null&&wi(y),a.callbackNode=null,a.callbackPriority=0;if((h&3)===0||Ee(a,h)){if(o=h&-h,o===a.callbackPriority)return o;switch(y!==null&&wi(y),fa(h)){case 2:case 8:h=Re;break;case 32:h=Je;break;case 268435456:h=kt;break;default:h=Je}return y=F1.bind(null,a),h=bn(h,y),a.callbackPriority=o,a.callbackNode=h,o}return y!==null&&y!==null&&wi(y),a.callbackPriority=2,a.callbackNode=null,2}function F1(a,o){if(Pn!==0&&Pn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var h=a.callbackNode;if(Ed()&&a.callbackNode!==h)return null;var y=Dt;return y=ae(a,a===sn?y:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),y===0?null:(b(a,y,o),G1(a,hn()),a.callbackNode!=null&&a.callbackNode===h?F1.bind(null,a):null)}function q1(a,o){if(Ed())return null;b(a,o,!0)}function kk(){Fk(function(){(Ut&6)!==0?bn(_e,Rk):P1()})}function Mb(){if(Gc===0){var a=Ks;a===0&&(a=is,is<<=1,(is&261888)===0&&(is=256)),Gc=a}return Gc}function Y1(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Is(""+a)}function V1(a,o){var h=o.ownerDocument.createElement("input");return h.name=o.name,h.value=o.value,a.id&&h.setAttribute("form",a.id),o.parentNode.insertBefore(h,o),a=new FormData(a),h.parentNode.removeChild(h),a}function Ok(a,o,h,y,_){if(o==="submit"&&h&&h.stateNode===_){var T=Y1((_[li]||null).action),L=y.submitter;L&&(o=(o=L[li]||null)?Y1(o.formAction):L.getAttribute("formAction"),o!==null&&(T=o,L=null));var W=new hu("action","action",null,y,_);a.push({event:W,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(Gc!==0){var re=L?V1(_,L):new FormData(_);Sp(h,{pending:!0,data:re,method:_.method,action:T},null,re)}}else typeof T=="function"&&(W.preventDefault(),re=L?V1(_,L):new FormData(_),Sp(h,{pending:!0,data:re,method:_.method,action:T},T,re))},currentTarget:_}]})}}for(var Nb=0;Nb<Pf.length;Nb++){var Rb=Pf[Nb],Dk=Rb.toLowerCase(),zk=Rb[0].toUpperCase()+Rb.slice(1);Xi(Dk,"on"+zk)}Xi(vr,"onAnimationEnd"),Xi(Uh,"onAnimationIteration"),Xi(us,"onAnimationStart"),Xi("dblclick","onDoubleClick"),Xi("focusin","onFocus"),Xi("focusout","onBlur"),Xi(_c,"onTransitionRun"),Xi(zl,"onTransitionStart"),Xi(Ih,"onTransitionCancel"),Xi(jf,"onTransitionEnd"),Me("onMouseEnter",["mouseout","mouseover"]),Me("onMouseLeave",["mouseout","mouseover"]),Me("onPointerEnter",["pointerout","pointerover"]),Me("onPointerLeave",["pointerout","pointerover"]),Hr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Hr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Hr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Hr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Hr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Hr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Op="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(" "),Bk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Op));function X1(a,o){o=(o&4)!==0;for(var h=0;h<a.length;h++){var y=a[h],_=y.event;y=y.listeners;e:{var T=void 0;if(o)for(var L=y.length-1;0<=L;L--){var W=y[L],re=W.instance,me=W.currentTarget;if(W=W.listener,re!==T&&_.isPropagationStopped())break e;T=W,_.currentTarget=me;try{T(_)}catch(Se){Bl(Se)}_.currentTarget=null,T=re}else for(L=0;L<y.length;L++){if(W=y[L],re=W.instance,me=W.currentTarget,W=W.listener,re!==T&&_.isPropagationStopped())break e;T=W,_.currentTarget=me;try{T(_)}catch(Se){Bl(Se)}_.currentTarget=null,T=re}}}}function Bt(a,o){var h=o[Bs];h===void 0&&(h=o[Bs]=new Set);var y=a+"__bubble";h.has(y)||(K1(o,a,2,!1),h.add(y))}function kb(a,o,h){var y=0;o&&(y|=4),K1(h,a,y,o)}var iy="_reactListening"+Math.random().toString(36).slice(2);function Ob(a){if(!a[iy]){a[iy]=!0,xr.forEach(function(h){h!=="selectionchange"&&(Bk.has(h)||kb(h,!1,a),kb(h,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[iy]||(o[iy]=!0,kb("selectionchange",!1,o))}}function K1(a,o,h,y){switch(ES(o)){case 2:var _=cO;break;case 8:_=uO;break;default:_=Xb}h=_.bind(null,o,h,a),_=void 0,!Cf||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(_=!0),y?_!==void 0?a.addEventListener(o,h,{capture:!0,passive:_}):a.addEventListener(o,h,!0):_!==void 0?a.addEventListener(o,h,{passive:_}):a.addEventListener(o,h,!1)}function Db(a,o,h,y,_){var T=y;if((o&1)===0&&(o&2)===0&&y!==null)e:for(;;){if(y===null)return;var L=y.tag;if(L===3||L===4){var W=y.stateNode.containerInfo;if(W===_)break;if(L===4)for(L=y.return;L!==null;){var re=L.tag;if((re===3||re===4)&&L.stateNode.containerInfo===_)return;L=L.return}for(;W!==null;){if(L=tn(W),L===null)return;if(re=L.tag,re===5||re===6||re===26||re===27){y=T=L;continue e}W=W.parentNode}}y=y.return}uu(function(){var me=T,Se=mt(h),Ce=[];e:{var be=Ps.get(a);if(be!==void 0){var ve=hu,Ye=a;switch(a){case"keypress":if(vo(h)===0)break e;case"keydown":case"keyup":ve=Ch;break;case"focusin":Ye="focus",ve=kf;break;case"focusout":Ye="blur",ve=kf;break;case"beforeblur":case"afterblur":ve=kf;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ve=ng;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ve=ig;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ve=Hs;break;case vr:case Uh:case us:ve=sg;break;case jf:ve=yb;break;case"scroll":case"scrollend":ve=Nf;break;case"wheel":ve=Ml;break;case"copy":case"cut":case"paste":ve=_h;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ve=Of;break;case"toggle":case"beforetoggle":ve=Mh}var lt=(o&4)!==0,En=!lt&&(a==="scroll"||a==="scrollend"),ue=lt?be!==null?be+"Capture":null:be;lt=[];for(var oe=me,he;oe!==null;){var Te=oe;if(he=Te.stateNode,Te=Te.tag,Te!==5&&Te!==26&&Te!==27||he===null||ue===null||(Te=xo(oe,ue),Te!=null&&lt.push(Dp(oe,Te,he))),En)break;oe=oe.return}0<lt.length&&(be=new ve(be,Ye,null,h,Se),Ce.push({event:be,listeners:lt}))}}if((o&7)===0){e:{if(be=a==="mouseover"||a==="pointerover",ve=a==="mouseout"||a==="pointerout",be&&h!==qe&&(Ye=h.relatedTarget||h.fromElement)&&(tn(Ye)||Ye[Ur]))break e;if((ve||be)&&(be=Se.window===Se?Se:(be=Se.ownerDocument)?be.defaultView||be.parentWindow:window,ve?(Ye=h.relatedTarget||h.toElement,ve=me,Ye=Ye?tn(Ye):null,Ye!==null&&(En=s(Ye),lt=Ye.tag,Ye!==En||lt!==5&&lt!==27&&lt!==6)&&(Ye=null)):(ve=null,Ye=me),ve!==Ye)){if(lt=ng,Te="onMouseLeave",ue="onMouseEnter",oe="mouse",(a==="pointerout"||a==="pointerover")&&(lt=Of,Te="onPointerLeave",ue="onPointerEnter",oe="pointer"),En=ve==null?be:lr(ve),he=Ye==null?be:lr(Ye),be=new lt(Te,oe+"leave",ve,h,Se),be.target=En,be.relatedTarget=he,Te=null,tn(Se)===me&&(lt=new lt(ue,oe+"enter",Ye,h,Se),lt.target=he,lt.relatedTarget=En,Te=lt),En=Te,ve&&Ye)t:{for(lt=Lk,ue=ve,oe=Ye,he=0,Te=ue;Te;Te=lt(Te))he++;Te=0;for(var nt=oe;nt;nt=lt(nt))Te++;for(;0<he-Te;)ue=lt(ue),he--;for(;0<Te-he;)oe=lt(oe),Te--;for(;he--;){if(ue===oe||oe!==null&&ue===oe.alternate){lt=ue;break t}ue=lt(ue),oe=lt(oe)}lt=null}else lt=null;ve!==null&&W1(Ce,be,ve,lt,!1),Ye!==null&&En!==null&&W1(Ce,En,Ye,lt,!0)}}e:{if(be=me?lr(me):window,ve=be.nodeName&&be.nodeName.toLowerCase(),ve==="select"||ve==="input"&&be.type==="file")var on=Dh;else if(kh(be))if(xu)on=yg;else{on=kl;var Xe=vu}else ve=be.nodeName,!ve||ve.toLowerCase()!=="input"||be.type!=="checkbox"&&be.type!=="radio"?me&&ls(me.elementType)&&(on=Dh):on=gg;if(on&&(on=on(a,me))){Bf(Ce,on,h,Se);break e}Xe&&Xe(a,be,me),a==="focusout"&&me&&be.type==="number"&&me.memoizedProps.value!=null&&Us(be,"number",be.value)}switch(Xe=me?lr(me):window,a){case"focusin":(kh(Xe)||Xe.contentEditable==="true")&&(bc=Xe,If=me,xc=null);break;case"focusout":xc=If=bc=null;break;case"mousedown":Gr=!0;break;case"contextmenu":case"mouseup":case"dragend":Gr=!1,Hf(Ce,h,Se);break;case"selectionchange":if(bg)break;case"keydown":case"keyup":Hf(Ce,h,Se)}var wt;if(_o)e:{switch(a){case"compositionstart":var Ht="onCompositionStart";break e;case"compositionend":Ht="onCompositionEnd";break e;case"compositionupdate":Ht="onCompositionUpdate";break e}Ht=void 0}else Rl?Df(a,h)&&(Ht="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(Ht="onCompositionStart");Ht&&(Bi&&h.locale!=="ko"&&(Rl||Ht!=="onCompositionStart"?Ht==="onCompositionEnd"&&Rl&&(wt=Mf()):(Tl=Se,Af="value"in Tl?Tl.value:Tl.textContent,Rl=!0)),Xe=ry(me,Ht),0<Xe.length&&(Ht=new Sh(Ht,a,null,h,Se),Ce.push({event:Ht,listeners:Xe}),wt?Ht.data=wt:(wt=dc(h),wt!==null&&(Ht.data=wt)))),(wt=So?zf(a,h):hg(a,h))&&(Ht=ry(me,"onBeforeInput"),0<Ht.length&&(Xe=new Sh("onBeforeInput","beforeinput",null,h,Se),Ce.push({event:Xe,listeners:Ht}),Xe.data=wt)),Ok(Ce,a,me,h,Se)}X1(Ce,o)})}function Dp(a,o,h){return{instance:a,listener:o,currentTarget:h}}function ry(a,o){for(var h=o+"Capture",y=[];a!==null;){var _=a,T=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||T===null||(_=xo(a,h),_!=null&&y.unshift(Dp(a,_,T)),_=xo(a,o),_!=null&&y.push(Dp(a,_,T))),a.tag===3)return y;a=a.return}return[]}function Lk(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function W1(a,o,h,y,_){for(var T=o._reactName,L=[];h!==null&&h!==y;){var W=h,re=W.alternate,me=W.stateNode;if(W=W.tag,re!==null&&re===y)break;W!==5&&W!==26&&W!==27||me===null||(re=me,_?(me=xo(h,T),me!=null&&L.unshift(Dp(h,me,re))):_||(me=xo(h,T),me!=null&&L.push(Dp(h,me,re)))),h=h.return}L.length!==0&&a.push({event:o,listeners:L})}var Uk=/\r\n?/g,Ik=/\u0000|\uFFFD/g;function Z1(a){return(typeof a=="string"?a:""+a).replace(Uk,`
50
- `).replace(Ik,"")}function $1(a,o){return o=Z1(o),Z1(a)===o}function Sn(a,o,h,y,_,T){switch(h){case"children":typeof y=="string"?o==="body"||o==="textarea"&&y===""||it(a,y):(typeof y=="number"||typeof y=="bigint")&&o!=="body"&&it(a,""+y);break;case"className":Yi(a,"class",y);break;case"tabIndex":Yi(a,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Yi(a,h,y);break;case"style":rn(a,y,T);break;case"data":if(o!=="object"){Yi(a,"data",y);break}case"src":case"href":if(y===""&&(o!=="a"||h!=="href")){a.removeAttribute(h);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){a.removeAttribute(h);break}y=Is(""+y),a.setAttribute(h,y);break;case"action":case"formAction":if(typeof y=="function"){a.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof T=="function"&&(h==="formAction"?(o!=="input"&&Sn(a,o,"name",_.name,_,null),Sn(a,o,"formEncType",_.formEncType,_,null),Sn(a,o,"formMethod",_.formMethod,_,null),Sn(a,o,"formTarget",_.formTarget,_,null)):(Sn(a,o,"encType",_.encType,_,null),Sn(a,o,"method",_.method,_,null),Sn(a,o,"target",_.target,_,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){a.removeAttribute(h);break}y=Is(""+y),a.setAttribute(h,y);break;case"onClick":y!=null&&(a.onclick=De);break;case"onScroll":y!=null&&Bt("scroll",a);break;case"onScrollEnd":y!=null&&Bt("scrollend",a);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(i(61));if(h=y.__html,h!=null){if(_.children!=null)throw Error(i(60));a.innerHTML=h}}break;case"multiple":a.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":a.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){a.removeAttribute("xlink:href");break}h=Is(""+y),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?a.setAttribute(h,""+y):a.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":y&&typeof y!="function"&&typeof y!="symbol"?a.setAttribute(h,""):a.removeAttribute(h);break;case"capture":case"download":y===!0?a.setAttribute(h,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?a.setAttribute(h,y):a.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?a.setAttribute(h,y):a.removeAttribute(h);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?a.removeAttribute(h):a.setAttribute(h,y);break;case"popover":Bt("beforetoggle",a),Bt("toggle",a),xi(a,"popover",y);break;case"xlinkActuate":Ti(a,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":Ti(a,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":Ti(a,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":Ti(a,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":Ti(a,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":Ti(a,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":Ti(a,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":Ti(a,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":Ti(a,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":xi(a,"is",y);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=os.get(h)||h,xi(a,h,y))}}function zb(a,o,h,y,_,T){switch(h){case"style":rn(a,y,T);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(i(61));if(h=y.__html,h!=null){if(_.children!=null)throw Error(i(60));a.innerHTML=h}}break;case"children":typeof y=="string"?it(a,y):(typeof y=="number"||typeof y=="bigint")&&it(a,""+y);break;case"onScroll":y!=null&&Bt("scroll",a);break;case"onScrollEnd":y!=null&&Bt("scrollend",a);break;case"onClick":y!=null&&(a.onclick=De);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!da.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(_=h.endsWith("Capture"),o=h.slice(2,_?h.length-7:void 0),T=a[li]||null,T=T!=null?T[h]:null,typeof T=="function"&&a.removeEventListener(o,T,_),typeof y=="function")){typeof T!="function"&&T!==null&&(h in a?a[h]=null:a.hasAttribute(h)&&a.removeAttribute(h)),a.addEventListener(o,y,_);break e}h in a?a[h]=y:y===!0?a.setAttribute(h,""):xi(a,h,y)}}}function gr(a,o,h){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Bt("error",a),Bt("load",a);var y=!1,_=!1,T;for(T in h)if(h.hasOwnProperty(T)){var L=h[T];if(L!=null)switch(T){case"src":y=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:Sn(a,o,T,L,h,null)}}_&&Sn(a,o,"srcSet",h.srcSet,h,null),y&&Sn(a,o,"src",h.src,h,null);return;case"input":Bt("invalid",a);var W=T=L=_=null,re=null,me=null;for(y in h)if(h.hasOwnProperty(y)){var Se=h[y];if(Se!=null)switch(y){case"name":_=Se;break;case"type":L=Se;break;case"checked":re=Se;break;case"defaultChecked":me=Se;break;case"value":T=Se;break;case"defaultValue":W=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(i(137,o));break;default:Sn(a,o,y,Se,h,null)}}ss(a,T,W,re,me,L,_,!1);return;case"select":Bt("invalid",a),y=L=T=null;for(_ in h)if(h.hasOwnProperty(_)&&(W=h[_],W!=null))switch(_){case"value":T=W;break;case"defaultValue":L=W;break;case"multiple":y=W;default:Sn(a,o,_,W,h,null)}o=T,h=L,a.multiple=!!y,o!=null?oi(a,!!y,o,!1):h!=null&&oi(a,!!y,h,!0);return;case"textarea":Bt("invalid",a),T=_=y=null;for(L in h)if(h.hasOwnProperty(L)&&(W=h[L],W!=null))switch(L){case"value":y=W;break;case"defaultValue":_=W;break;case"children":T=W;break;case"dangerouslySetInnerHTML":if(W!=null)throw Error(i(91));break;default:Sn(a,o,L,W,h,null)}Ba(a,y,_,T);return;case"option":for(re in h)if(h.hasOwnProperty(re)&&(y=h[re],y!=null))switch(re){case"selected":a.selected=y&&typeof y!="function"&&typeof y!="symbol";break;default:Sn(a,o,re,y,h,null)}return;case"dialog":Bt("beforetoggle",a),Bt("toggle",a),Bt("cancel",a),Bt("close",a);break;case"iframe":case"object":Bt("load",a);break;case"video":case"audio":for(y=0;y<Op.length;y++)Bt(Op[y],a);break;case"image":Bt("error",a),Bt("load",a);break;case"details":Bt("toggle",a);break;case"embed":case"source":case"link":Bt("error",a),Bt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(me in h)if(h.hasOwnProperty(me)&&(y=h[me],y!=null))switch(me){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:Sn(a,o,me,y,h,null)}return;default:if(ls(o)){for(Se in h)h.hasOwnProperty(Se)&&(y=h[Se],y!==void 0&&zb(a,o,Se,y,h,void 0));return}}for(W in h)h.hasOwnProperty(W)&&(y=h[W],y!=null&&Sn(a,o,W,y,h,null))}function Hk(a,o,h,y){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,T=null,L=null,W=null,re=null,me=null,Se=null;for(ve in h){var Ce=h[ve];if(h.hasOwnProperty(ve)&&Ce!=null)switch(ve){case"checked":break;case"value":break;case"defaultValue":re=Ce;default:y.hasOwnProperty(ve)||Sn(a,o,ve,null,y,Ce)}}for(var be in y){var ve=y[be];if(Ce=h[be],y.hasOwnProperty(be)&&(ve!=null||Ce!=null))switch(be){case"type":T=ve;break;case"name":_=ve;break;case"checked":me=ve;break;case"defaultChecked":Se=ve;break;case"value":L=ve;break;case"defaultValue":W=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(i(137,o));break;default:ve!==Ce&&Sn(a,o,be,ve,y,Ce)}}as(a,L,W,re,me,Se,T,_);return;case"select":ve=L=W=be=null;for(T in h)if(re=h[T],h.hasOwnProperty(T)&&re!=null)switch(T){case"value":break;case"multiple":ve=re;default:y.hasOwnProperty(T)||Sn(a,o,T,null,y,re)}for(_ in y)if(T=y[_],re=h[_],y.hasOwnProperty(_)&&(T!=null||re!=null))switch(_){case"value":be=T;break;case"defaultValue":W=T;break;case"multiple":L=T;default:T!==re&&Sn(a,o,_,T,y,re)}o=W,h=L,y=ve,be!=null?oi(a,!!h,be,!1):!!y!=!!h&&(o!=null?oi(a,!!h,o,!0):oi(a,!!h,h?[]:"",!1));return;case"textarea":ve=be=null;for(W in h)if(_=h[W],h.hasOwnProperty(W)&&_!=null&&!y.hasOwnProperty(W))switch(W){case"value":break;case"children":break;default:Sn(a,o,W,null,y,_)}for(L in y)if(_=y[L],T=h[L],y.hasOwnProperty(L)&&(_!=null||T!=null))switch(L){case"value":be=_;break;case"defaultValue":ve=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(i(91));break;default:_!==T&&Sn(a,o,L,_,y,T)}cu(a,be,ve);return;case"option":for(var Ye in h)if(be=h[Ye],h.hasOwnProperty(Ye)&&be!=null&&!y.hasOwnProperty(Ye))switch(Ye){case"selected":a.selected=!1;break;default:Sn(a,o,Ye,null,y,be)}for(re in y)if(be=y[re],ve=h[re],y.hasOwnProperty(re)&&be!==ve&&(be!=null||ve!=null))switch(re){case"selected":a.selected=be&&typeof be!="function"&&typeof be!="symbol";break;default:Sn(a,o,re,be,y,ve)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var lt in h)be=h[lt],h.hasOwnProperty(lt)&&be!=null&&!y.hasOwnProperty(lt)&&Sn(a,o,lt,null,y,be);for(me in y)if(be=y[me],ve=h[me],y.hasOwnProperty(me)&&be!==ve&&(be!=null||ve!=null))switch(me){case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(i(137,o));break;default:Sn(a,o,me,be,y,ve)}return;default:if(ls(o)){for(var En in h)be=h[En],h.hasOwnProperty(En)&&be!==void 0&&!y.hasOwnProperty(En)&&zb(a,o,En,void 0,y,be);for(Se in y)be=y[Se],ve=h[Se],!y.hasOwnProperty(Se)||be===ve||be===void 0&&ve===void 0||zb(a,o,Se,be,y,ve);return}}for(var ue in h)be=h[ue],h.hasOwnProperty(ue)&&be!=null&&!y.hasOwnProperty(ue)&&Sn(a,o,ue,null,y,be);for(Ce in y)be=y[Ce],ve=h[Ce],!y.hasOwnProperty(Ce)||be===ve||be==null&&ve==null||Sn(a,o,Ce,be,y,ve)}function Q1(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function jk(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,h=performance.getEntriesByType("resource"),y=0;y<h.length;y++){var _=h[y],T=_.transferSize,L=_.initiatorType,W=_.duration;if(T&&W&&Q1(L)){for(L=0,W=_.responseEnd,y+=1;y<h.length;y++){var re=h[y],me=re.startTime;if(me>W)break;var Se=re.transferSize,Ce=re.initiatorType;Se&&Q1(Ce)&&(re=re.responseEnd,L+=Se*(re<W?1:(W-me)/(re-me)))}if(--y,o+=8*(T+L)/(_.duration/1e3),a++,10<a)break}}if(0<a)return o/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Bb=null,Lb=null;function ay(a){return a.nodeType===9?a:a.ownerDocument}function J1(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function eS(a,o){if(a===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&o==="foreignObject"?0:a}function Ub(a,o){return a==="textarea"||a==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Ib=null;function Pk(){var a=window.event;return a&&a.type==="popstate"?a===Ib?!1:(Ib=a,!0):(Ib=null,!1)}var tS=typeof setTimeout=="function"?setTimeout:void 0,Gk=typeof clearTimeout=="function"?clearTimeout:void 0,nS=typeof Promise=="function"?Promise:void 0,Fk=typeof queueMicrotask=="function"?queueMicrotask:typeof nS<"u"?function(a){return nS.resolve(null).then(a).catch(qk)}:tS;function qk(a){setTimeout(function(){throw a})}function Fc(a){return a==="head"}function iS(a,o){var h=o,y=0;do{var _=h.nextSibling;if(a.removeChild(h),_&&_.nodeType===8)if(h=_.data,h==="/$"||h==="/&"){if(y===0){a.removeChild(_),Md(o);return}y--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")y++;else if(h==="html")zp(a.ownerDocument.documentElement);else if(h==="head"){h=a.ownerDocument.head,zp(h);for(var T=h.firstChild;T;){var L=T.nextSibling,W=T.nodeName;T[Da]||W==="SCRIPT"||W==="STYLE"||W==="LINK"&&T.rel.toLowerCase()==="stylesheet"||h.removeChild(T),T=L}}else h==="body"&&zp(a.ownerDocument.body);h=_}while(h);Md(o)}function rS(a,o){var h=a;a=0;do{var y=h.nextSibling;if(h.nodeType===1?o?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(o?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),y&&y.nodeType===8)if(h=y.data,h==="/$"){if(a===0)break;a--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||a++;h=y}while(h)}function Hb(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var h=o;switch(o=o.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Hb(h),Ls(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}a.removeChild(h)}}function Yk(a,o,h,y){for(;a.nodeType===1;){var _=h;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!y&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(y){if(!a[Da])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(T=a.getAttribute("rel"),T==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(T!==_.rel||a.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||a.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||a.getAttribute("title")!==(_.title==null?null:_.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(T=a.getAttribute("src"),(T!==(_.src==null?null:_.src)||a.getAttribute("type")!==(_.type==null?null:_.type)||a.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&T&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var T=_.name==null?null:""+_.name;if(_.type==="hidden"&&a.getAttribute("name")===T)return a}else return a;if(a=Ts(a.nextSibling),a===null)break}return null}function Vk(a,o,h){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!h||(a=Ts(a.nextSibling),a===null))return null;return a}function aS(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=Ts(a.nextSibling),a===null))return null;return a}function jb(a){return a.data==="$?"||a.data==="$~"}function Pb(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function Xk(a,o){var h=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||h.readyState!=="loading")o();else{var y=function(){o(),h.removeEventListener("DOMContentLoaded",y)};h.addEventListener("DOMContentLoaded",y),a._reactRetry=y}}function Ts(a){for(;a!=null;a=a.nextSibling){var o=a.nodeType;if(o===1||o===3)break;if(o===8){if(o=a.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return a}var Gb=null;function sS(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"||h==="/&"){if(o===0)return Ts(a.nextSibling);o--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||o++}a=a.nextSibling}return null}function lS(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(o===0)return a;o--}else h!=="/$"&&h!=="/&"||o++}a=a.previousSibling}return null}function oS(a,o,h){switch(o=ay(h),a){case"html":if(a=o.documentElement,!a)throw Error(i(452));return a;case"head":if(a=o.head,!a)throw Error(i(453));return a;case"body":if(a=o.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function zp(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);Ls(a)}var Cs=new Map,cS=new Set;function sy(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Yo=Y.d;Y.d={f:Kk,r:Wk,D:Zk,C:$k,L:Qk,m:Jk,X:tO,S:eO,M:nO};function Kk(){var a=Yo.f(),o=J();return a||o}function Wk(a){var o=nn(a);o!==null&&o.tag===5&&o.type==="form"?Ep(o):Yo.r(a)}var Td=typeof document>"u"?null:document;function uS(a,o,h){var y=Td;if(y&&typeof o=="string"&&o){var _=Di(o);_='link[rel="'+a+'"][href="'+_+'"]',typeof h=="string"&&(_+='[crossorigin="'+h+'"]'),cS.has(_)||(cS.add(_),a={rel:a,crossOrigin:h,href:o},y.querySelector(_)===null&&(o=y.createElement("link"),gr(o,"link",a),Ln(o),y.head.appendChild(o)))}}function Zk(a){Yo.D(a),uS("dns-prefetch",a,null)}function $k(a,o){Yo.C(a,o),uS("preconnect",a,o)}function Qk(a,o,h){Yo.L(a,o,h);var y=Td;if(y&&a&&o){var _='link[rel="preload"][as="'+Di(o)+'"]';o==="image"&&h&&h.imageSrcSet?(_+='[imagesrcset="'+Di(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(_+='[imagesizes="'+Di(h.imageSizes)+'"]')):_+='[href="'+Di(a)+'"]';var T=_;switch(o){case"style":T=Cd(a);break;case"script":T=Ad(a)}Cs.has(T)||(a=g({rel:"preload",href:o==="image"&&h&&h.imageSrcSet?void 0:a,as:o},h),Cs.set(T,a),y.querySelector(_)!==null||o==="style"&&y.querySelector(Bp(T))||o==="script"&&y.querySelector(Lp(T))||(o=y.createElement("link"),gr(o,"link",a),Ln(o),y.head.appendChild(o)))}}function Jk(a,o){Yo.m(a,o);var h=Td;if(h&&a){var y=o&&typeof o.as=="string"?o.as:"script",_='link[rel="modulepreload"][as="'+Di(y)+'"][href="'+Di(a)+'"]',T=_;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=Ad(a)}if(!Cs.has(T)&&(a=g({rel:"modulepreload",href:a},o),Cs.set(T,a),h.querySelector(_)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Lp(T)))return}y=h.createElement("link"),gr(y,"link",a),Ln(y),h.head.appendChild(y)}}}function eO(a,o,h){Yo.S(a,o,h);var y=Td;if(y&&a){var _=Ir(y).hoistableStyles,T=Cd(a);o=o||"default";var L=_.get(T);if(!L){var W={loading:0,preload:null};if(L=y.querySelector(Bp(T)))W.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":o},h),(h=Cs.get(T))&&Fb(a,h);var re=L=y.createElement("link");Ln(re),gr(re,"link",a),re._p=new Promise(function(me,Se){re.onload=me,re.onerror=Se}),re.addEventListener("load",function(){W.loading|=1}),re.addEventListener("error",function(){W.loading|=2}),W.loading|=4,ly(L,o,y)}L={type:"stylesheet",instance:L,count:1,state:W},_.set(T,L)}}}function tO(a,o){Yo.X(a,o);var h=Td;if(h&&a){var y=Ir(h).hoistableScripts,_=Ad(a),T=y.get(_);T||(T=h.querySelector(Lp(_)),T||(a=g({src:a,async:!0},o),(o=Cs.get(_))&&qb(a,o),T=h.createElement("script"),Ln(T),gr(T,"link",a),h.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},y.set(_,T))}}function nO(a,o){Yo.M(a,o);var h=Td;if(h&&a){var y=Ir(h).hoistableScripts,_=Ad(a),T=y.get(_);T||(T=h.querySelector(Lp(_)),T||(a=g({src:a,async:!0,type:"module"},o),(o=Cs.get(_))&&qb(a,o),T=h.createElement("script"),Ln(T),gr(T,"link",a),h.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},y.set(_,T))}}function fS(a,o,h,y){var _=(_=ge.current)?sy(_):null;if(!_)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(o=Cd(h.href),h=Ir(_).hoistableStyles,y=h.get(o),y||(y={type:"style",instance:null,count:0,state:null},h.set(o,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){a=Cd(h.href);var T=Ir(_).hoistableStyles,L=T.get(a);if(L||(_=_.ownerDocument||_,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(a,L),(T=_.querySelector(Bp(a)))&&!T._p&&(L.instance=T,L.state.loading=5),Cs.has(a)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Cs.set(a,h),T||iO(_,a,h,L.state))),o&&y===null)throw Error(i(528,""));return L}if(o&&y!==null)throw Error(i(529,""));return null;case"script":return o=h.async,h=h.src,typeof h=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Ad(h),h=Ir(_).hoistableScripts,y=h.get(o),y||(y={type:"script",instance:null,count:0,state:null},h.set(o,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function Cd(a){return'href="'+Di(a)+'"'}function Bp(a){return'link[rel="stylesheet"]['+a+"]"}function dS(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function iO(a,o,h,y){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?y.loading=1:(o=a.createElement("link"),y.preload=o,o.addEventListener("load",function(){return y.loading|=1}),o.addEventListener("error",function(){return y.loading|=2}),gr(o,"link",h),Ln(o),a.head.appendChild(o))}function Ad(a){return'[src="'+Di(a)+'"]'}function Lp(a){return"script[async]"+a}function hS(a,o,h){if(o.count++,o.instance===null)switch(o.type){case"style":var y=a.querySelector('style[data-href~="'+Di(h.href)+'"]');if(y)return o.instance=y,Ln(y),y;var _=g({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return y=(a.ownerDocument||a).createElement("style"),Ln(y),gr(y,"style",_),ly(y,h.precedence,a),o.instance=y;case"stylesheet":_=Cd(h.href);var T=a.querySelector(Bp(_));if(T)return o.state.loading|=4,o.instance=T,Ln(T),T;y=dS(h),(_=Cs.get(_))&&Fb(y,_),T=(a.ownerDocument||a).createElement("link"),Ln(T);var L=T;return L._p=new Promise(function(W,re){L.onload=W,L.onerror=re}),gr(T,"link",y),o.state.loading|=4,ly(T,h.precedence,a),o.instance=T;case"script":return T=Ad(h.src),(_=a.querySelector(Lp(T)))?(o.instance=_,Ln(_),_):(y=h,(_=Cs.get(T))&&(y=g({},h),qb(y,_)),a=a.ownerDocument||a,_=a.createElement("script"),Ln(_),gr(_,"link",y),a.head.appendChild(_),o.instance=_);case"void":return null;default:throw Error(i(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(y=o.instance,o.state.loading|=4,ly(y,h.precedence,a));return o.instance}function ly(a,o,h){for(var y=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=y.length?y[y.length-1]:null,T=_,L=0;L<y.length;L++){var W=y[L];if(W.dataset.precedence===o)T=W;else if(T!==_)break}T?T.parentNode.insertBefore(a,T.nextSibling):(o=h.nodeType===9?h.head:h,o.insertBefore(a,o.firstChild))}function Fb(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function qb(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var oy=null;function pS(a,o,h){if(oy===null){var y=new Map,_=oy=new Map;_.set(h,y)}else _=oy,y=_.get(h),y||(y=new Map,_.set(h,y));if(y.has(a))return y;for(y.set(a,null),h=h.getElementsByTagName(a),_=0;_<h.length;_++){var T=h[_];if(!(T[Da]||T[yt]||a==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var L=T.getAttribute(o)||"";L=a+L;var W=y.get(L);W?W.push(T):y.set(L,[T])}}return y}function mS(a,o,h){a=a.ownerDocument||a,a.head.insertBefore(h,o==="title"?a.querySelector("head > title"):null)}function rO(a,o,h){if(h===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return a=o.disabled,typeof o.precedence=="string"&&a==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function gS(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function aO(a,o,h,y){if(h.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var _=Cd(y.href),T=o.querySelector(Bp(_));if(T){o=T._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=cy.bind(a),o.then(a,a)),h.state.loading|=4,h.instance=T,Ln(T);return}T=o.ownerDocument||o,y=dS(y),(_=Cs.get(_))&&Fb(y,_),T=T.createElement("link"),Ln(T);var L=T;L._p=new Promise(function(W,re){L.onload=W,L.onerror=re}),gr(T,"link",y),h.instance=T}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(h,o),(o=h.state.preload)&&(h.state.loading&3)===0&&(a.count++,h=cy.bind(a),o.addEventListener("load",h),o.addEventListener("error",h))}}var Yb=0;function sO(a,o){return a.stylesheets&&a.count===0&&fy(a,a.stylesheets),0<a.count||0<a.imgCount?function(h){var y=setTimeout(function(){if(a.stylesheets&&fy(a,a.stylesheets),a.unsuspend){var T=a.unsuspend;a.unsuspend=null,T()}},6e4+o);0<a.imgBytes&&Yb===0&&(Yb=62500*jk());var _=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&fy(a,a.stylesheets),a.unsuspend)){var T=a.unsuspend;a.unsuspend=null,T()}},(a.imgBytes>Yb?50:800)+o);return a.unsuspend=h,function(){a.unsuspend=null,clearTimeout(y),clearTimeout(_)}}:null}function cy(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fy(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var uy=null;function fy(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,uy=new Map,o.forEach(lO,a),uy=null,cy.call(a))}function lO(a,o){if(!(o.state.loading&4)){var h=uy.get(a);if(h)var y=h.get(null);else{h=new Map,uy.set(a,h);for(var _=a.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<_.length;T++){var L=_[T];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(h.set(L.dataset.precedence,L),y=L)}y&&h.set(null,y)}_=o.instance,L=_.getAttribute("data-precedence"),T=h.get(L)||y,T===y&&h.set(null,_),h.set(L,_),this.count++,y=cy.bind(this),_.addEventListener("load",y),_.addEventListener("error",y),T?T.parentNode.insertBefore(_,T.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(_,a.firstChild)),o.state.loading|=4}}var Up={$$typeof:N,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function oO(a,o,h,y,_,T,L,W,re){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Jt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jt(0),this.hiddenUpdates=Jt(null),this.identifierPrefix=y,this.onUncaughtError=_,this.onCaughtError=T,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=re,this.incompleteTransitions=new Map}function yS(a,o,h,y,_,T,L,W,re,me,Se,Ce){return a=new oO(a,o,h,L,re,me,Se,Ce,W),o=1,T===!0&&(o|=24),T=ur(3,null,null,o),a.current=T,T.stateNode=a,o=Yh(),o.refCount++,a.pooledCache=o,o.refCount++,T.memoizedState={element:y,isDehydrated:h,cache:o},$h(T),a}function bS(a){return a?(a=Il,a):Il}function xS(a,o,h,y,_,T){_=bS(_),y.context===null?y.context=_:y.pendingContext=_,y=gs(o),y.payload={element:h},T=T===void 0?null:T,T!==null&&(y.callback=T),h=Ws(a,y,o),h!==null&&(f(h,a,o),Vl(h,a,o))}function vS(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<o?h:o}}function Vb(a,o){vS(a,o),(a=a.alternate)&&vS(a,o)}function _S(a){if(a.tag===13||a.tag===31){var o=Ul(a,67108864);o!==null&&f(o,a,67108864),Vb(a,67108864)}}function SS(a){if(a.tag===13||a.tag===31){var o=mr();o=Gt(o);var h=Ul(a,o);h!==null&&f(h,a,o),Vb(a,o)}}var dy=!0;function cO(a,o,h,y){var _=B.T;B.T=null;var T=Y.p;try{Y.p=2,Xb(a,o,h,y)}finally{Y.p=T,B.T=_}}function uO(a,o,h,y){var _=B.T;B.T=null;var T=Y.p;try{Y.p=8,Xb(a,o,h,y)}finally{Y.p=T,B.T=_}}function Xb(a,o,h,y){if(dy){var _=Kb(y);if(_===null)Db(a,o,y,hy,h),wS(a,y);else if(dO(_,a,o,h,y))y.stopPropagation();else if(wS(a,y),o&4&&-1<fO.indexOf(a)){for(;_!==null;){var T=nn(_);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var L=bi(T.pendingLanes);if(L!==0){var W=T;for(W.pendingLanes|=2,W.entangledLanes|=2;L;){var re=1<<31-Pt(L);W.entanglements[1]|=re,L&=~re}to(T),(Ut&6)===0&&(na=hn()+500,kp(0))}}break;case 31:case 13:W=Ul(T,2),W!==null&&f(W,T,2),J(),Vb(T,2)}if(T=Kb(y),T===null&&Db(a,o,y,hy,h),T===_)break;_=T}_!==null&&y.stopPropagation()}else Db(a,o,y,null,h)}}function Kb(a){return a=mt(a),Wb(a)}var hy=null;function Wb(a){if(hy=null,a=tn(a),a!==null){var o=s(a);if(o===null)a=null;else{var h=o.tag;if(h===13){if(a=l(o),a!==null)return a;a=null}else if(h===31){if(a=c(o),a!==null)return a;a=null}else if(h===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return hy=a,null}function ES(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ua()){case _e:return 2;case Re:return 8;case Je:case bt:return 32;case kt:return 268435456;default:return 32}default:return 32}}var Zb=!1,qc=null,Yc=null,Vc=null,Ip=new Map,Hp=new Map,Xc=[],fO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function wS(a,o){switch(a){case"focusin":case"focusout":qc=null;break;case"dragenter":case"dragleave":Yc=null;break;case"mouseover":case"mouseout":Vc=null;break;case"pointerover":case"pointerout":Ip.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hp.delete(o.pointerId)}}function jp(a,o,h,y,_,T){return a===null||a.nativeEvent!==T?(a={blockedOn:o,domEventName:h,eventSystemFlags:y,nativeEvent:T,targetContainers:[_]},o!==null&&(o=nn(o),o!==null&&_S(o)),a):(a.eventSystemFlags|=y,o=a.targetContainers,_!==null&&o.indexOf(_)===-1&&o.push(_),a)}function dO(a,o,h,y,_){switch(o){case"focusin":return qc=jp(qc,a,o,h,y,_),!0;case"dragenter":return Yc=jp(Yc,a,o,h,y,_),!0;case"mouseover":return Vc=jp(Vc,a,o,h,y,_),!0;case"pointerover":var T=_.pointerId;return Ip.set(T,jp(Ip.get(T)||null,a,o,h,y,_)),!0;case"gotpointercapture":return T=_.pointerId,Hp.set(T,jp(Hp.get(T)||null,a,o,h,y,_)),!0}return!1}function TS(a){var o=tn(a.target);if(o!==null){var h=s(o);if(h!==null){if(o=h.tag,o===13){if(o=l(h),o!==null){a.blockedOn=o,qi(a.priority,function(){SS(h)});return}}else if(o===31){if(o=c(h),o!==null){a.blockedOn=o,qi(a.priority,function(){SS(h)});return}}else if(o===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function py(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var h=Kb(a.nativeEvent);if(h===null){h=a.nativeEvent;var y=new h.constructor(h.type,h);qe=y,h.target.dispatchEvent(y),qe=null}else return o=nn(h),o!==null&&_S(o),a.blockedOn=h,!1;o.shift()}return!0}function CS(a,o,h){py(a)&&h.delete(o)}function hO(){Zb=!1,qc!==null&&py(qc)&&(qc=null),Yc!==null&&py(Yc)&&(Yc=null),Vc!==null&&py(Vc)&&(Vc=null),Ip.forEach(CS),Hp.forEach(CS)}function my(a,o){a.blockedOn===o&&(a.blockedOn=null,Zb||(Zb=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,hO)))}var gy=null;function AS(a){gy!==a&&(gy=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){gy===a&&(gy=null);for(var o=0;o<a.length;o+=3){var h=a[o],y=a[o+1],_=a[o+2];if(typeof y!="function"){if(Wb(y||h)===null)continue;break}var T=nn(h);T!==null&&(a.splice(o,3),o-=3,Sp(T,{pending:!0,data:_,method:h.method,action:y},y,_))}}))}function Md(a){function o(re){return my(re,a)}qc!==null&&my(qc,a),Yc!==null&&my(Yc,a),Vc!==null&&my(Vc,a),Ip.forEach(o),Hp.forEach(o);for(var h=0;h<Xc.length;h++){var y=Xc[h];y.blockedOn===a&&(y.blockedOn=null)}for(;0<Xc.length&&(h=Xc[0],h.blockedOn===null);)TS(h),h.blockedOn===null&&Xc.shift();if(h=(a.ownerDocument||a).$$reactFormReplay,h!=null)for(y=0;y<h.length;y+=3){var _=h[y],T=h[y+1],L=_[li]||null;if(typeof T=="function")L||AS(h);else if(L){var W=null;if(T&&T.hasAttribute("formAction")){if(_=T,L=T[li]||null)W=L.formAction;else if(Wb(_)!==null)continue}else W=L.action;typeof W=="function"?h[y+1]=W:(h.splice(y,3),y-=3),AS(h)}}}function MS(){function a(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(L){return _=L})},focusReset:"manual",scroll:"manual"})}function o(){_!==null&&(_(),_=null),y||setTimeout(h,20)}function h(){if(!y&&!navigation.transition){var T=navigation.currentEntry;T&&T.url!=null&&navigation.navigate(T.url,{state:T.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var y=!1,_=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(h,100),function(){y=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),_!==null&&(_(),_=null)}}}function $b(a){this._internalRoot=a}yy.prototype.render=$b.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(i(409));var h=o.current,y=mr();xS(h,y,a,o,null,null)},yy.prototype.unmount=$b.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;xS(a.current,2,null,a,null,null),J(),o[Ur]=null}};function yy(a){this._internalRoot=a}yy.prototype.unstable_scheduleHydration=function(a){if(a){var o=ar();a={blockedOn:null,target:a,priority:o};for(var h=0;h<Xc.length&&o!==0&&o<Xc[h].priority;h++);Xc.splice(h,0,a),h===0&&TS(a)}};var NS=e.version;if(NS!=="19.2.4")throw Error(i(527,NS,"19.2.4"));Y.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=p(o),a=a!==null?m(a):null,a=a===null?null:a.stateNode,a};var pO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var by=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!by.isDisabled&&by.supportsFiber)try{xn=by.inject(pO),Zt=by}catch{}}return Gp.createRoot=function(a,o){if(!r(a))throw Error(i(299));var h=!1,y="",_=Cp,T=Zg,L=fd;return o!=null&&(o.unstable_strictMode===!0&&(h=!0),o.identifierPrefix!==void 0&&(y=o.identifierPrefix),o.onUncaughtError!==void 0&&(_=o.onUncaughtError),o.onCaughtError!==void 0&&(T=o.onCaughtError),o.onRecoverableError!==void 0&&(L=o.onRecoverableError)),o=yS(a,1,!1,null,null,h,y,null,_,T,L,MS),a[Ur]=o.current,Ob(a),new $b(o)},Gp.hydrateRoot=function(a,o,h){if(!r(a))throw Error(i(299));var y=!1,_="",T=Cp,L=Zg,W=fd,re=null;return h!=null&&(h.unstable_strictMode===!0&&(y=!0),h.identifierPrefix!==void 0&&(_=h.identifierPrefix),h.onUncaughtError!==void 0&&(T=h.onUncaughtError),h.onCaughtError!==void 0&&(L=h.onCaughtError),h.onRecoverableError!==void 0&&(W=h.onRecoverableError),h.formState!==void 0&&(re=h.formState)),o=yS(a,1,!0,o,h??null,y,_,re,T,L,W,MS),o.context=bS(null),h=o.current,y=mr(),y=Gt(y),_=gs(y),_.callback=null,Ws(h,_,y),h=y,o.current.lanes=h,en(o,h),to(o),a[Ur]=o.current,Ob(a),new yy(o)},Gp.version="19.2.4",Gp}var jS;function TO(){if(jS)return ex.exports;jS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),ex.exports=wO(),ex.exports}var CO=TO();/**
51
- * react-router v7.13.1
52
- *
53
- * Copyright (c) Remix Software Inc.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE.md file in the root directory of this source tree.
57
- *
58
- * @license MIT
59
- */var PS="popstate";function GS(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function AO(t={}){function e(i,r){var p;let s=(p=r.state)==null?void 0:p.masked,{pathname:l,search:c,hash:d}=s||i.location;return Tv("",{pathname:l,search:c,hash:d},r.state&&r.state.usr||null,r.state&&r.state.key||"default",s?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,r){return typeof r=="string"?r:Em(r)}return NO(e,n,null,t)}function Wn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function yl(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function MO(){return Math.random().toString(36).substring(2,10)}function FS(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function Tv(t,e,n=null,i,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?mh(e):e,state:n,key:e&&e.key||i||MO(),unstable_mask:r}}function Em({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function mh(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substring(i),t=t.substring(0,i)),t&&(e.pathname=t)}return e}function NO(t,e,n,i={}){let{window:r=document.defaultView,v5Compat:s=!1}=i,l=r.history,c="POP",d=null,p=m();p==null&&(p=0,l.replaceState({...l.state,idx:p},""));function m(){return(l.state||{idx:null}).idx}function g(){c="POP";let C=m(),w=C==null?null:C-p;p=C,d&&d({action:c,location:A.location,delta:w})}function x(C,w){c="PUSH";let k=GS(C)?C:Tv(A.location,C,w);p=m()+1;let N=FS(k,p),D=A.createHref(k.unstable_mask||k);try{l.pushState(N,"",D)}catch(H){if(H instanceof DOMException&&H.name==="DataCloneError")throw H;r.location.assign(D)}s&&d&&d({action:c,location:A.location,delta:1})}function v(C,w){c="REPLACE";let k=GS(C)?C:Tv(A.location,C,w);p=m();let N=FS(k,p),D=A.createHref(k.unstable_mask||k);l.replaceState(N,"",D),s&&d&&d({action:c,location:A.location,delta:0})}function E(C){return RO(C)}let A={get action(){return c},get location(){return t(r,l)},listen(C){if(d)throw new Error("A history only accepts one active listener");return r.addEventListener(PS,g),d=C,()=>{r.removeEventListener(PS,g),d=null}},createHref(C){return e(r,C)},createURL:E,encodeLocation(C){let w=E(C);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:x,replace:v,go(C){return l.go(C)}};return A}function RO(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Wn(n,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:Em(t);return i=i.replace(/ $/,"%20"),!e&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function aC(t,e,n="/"){return kO(t,e,n,!1)}function kO(t,e,n,i){let r=typeof e=="string"?mh(e):e,s=nc(r.pathname||"/",n);if(s==null)return null;let l=sC(t);OO(l);let c=null;for(let d=0;c==null&&d<l.length;++d){let p=FO(s);c=PO(l[d],p,i)}return c}function sC(t,e=[],n=[],i="",r=!1){let s=(l,c,d=r,p)=>{let m={relativePath:p===void 0?l.path||"":p,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(i)&&d)return;Wn(m.relativePath.startsWith(i),`Absolute route path "${m.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(i.length)}let g=co([i,m.relativePath]),x=n.concat(m);l.children&&l.children.length>0&&(Wn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),sC(l.children,e,x,g,d)),!(l.path==null&&!l.index)&&e.push({path:g,score:HO(g,l.index),routesMeta:x})};return t.forEach((l,c)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))s(l,c);else for(let p of lC(l.path))s(l,c,!0,p)}),e}function lC(t){let e=t.split("/");if(e.length===0)return[];let[n,...i]=e,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let l=lC(i.join("/")),c=[];return c.push(...l.map(d=>d===""?s:[s,d].join("/"))),r&&c.push(...l),c.map(d=>t.startsWith("/")&&d===""?"/":d)}function OO(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:jO(e.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var DO=/^:[\w-]+$/,zO=3,BO=2,LO=1,UO=10,IO=-2,qS=t=>t==="*";function HO(t,e){let n=t.split("/"),i=n.length;return n.some(qS)&&(i+=IO),e&&(i+=BO),n.filter(r=>!qS(r)).reduce((r,s)=>r+(DO.test(s)?zO:s===""?LO:UO),i)}function jO(t,e){return t.length===e.length&&t.slice(0,-1).every((i,r)=>i===e[r])?t[t.length-1]-e[e.length-1]:0}function PO(t,e,n=!1){let{routesMeta:i}=t,r={},s="/",l=[];for(let c=0;c<i.length;++c){let d=i[c],p=c===i.length-1,m=s==="/"?e:e.slice(s.length)||"/",g=g0({path:d.relativePath,caseSensitive:d.caseSensitive,end:p},m),x=d.route;if(!g&&p&&n&&!i[i.length-1].route.index&&(g=g0({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},m)),!g)return null;Object.assign(r,g.params),l.push({params:r,pathname:co([s,g.pathname]),pathnameBase:XO(co([s,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(s=co([s,g.pathnameBase]))}return l}function g0(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,i]=GO(t.path,t.caseSensitive,t.end),r=e.match(n);if(!r)return null;let s=r[0],l=s.replace(/(.)\/+$/,"$1"),c=r.slice(1);return{params:i.reduce((p,{paramName:m,isOptional:g},x)=>{if(m==="*"){let E=c[x]||"";l=s.slice(0,s.length-E.length).replace(/(.)\/+$/,"$1")}const v=c[x];return g&&!v?p[m]=void 0:p[m]=(v||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:l,pattern:t}}function GO(t,e=!1,n=!0){yl(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let i=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,d,p,m)=>{if(i.push({paramName:c,isOptional:d!=null}),d){let g=m.charAt(p+l.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function FO(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return yl(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function nc(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&i!=="/"?null:t.slice(n)||"/"}var qO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function YO(t,e="/"){let{pathname:n,search:i="",hash:r=""}=typeof t=="string"?mh(t):t,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=YS(n.substring(1),"/"):s=YS(n,e)):s=e,{pathname:s,search:KO(i),hash:WO(r)}}function YS(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function rx(t,e,n,i){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function VO(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function N_(t){let e=VO(t);return e.map((n,i)=>i===e.length-1?n.pathname:n.pathnameBase)}function G0(t,e,n,i=!1){let r;typeof t=="string"?r=mh(t):(r={...t},Wn(!r.pathname||!r.pathname.includes("?"),rx("?","pathname","search",r)),Wn(!r.pathname||!r.pathname.includes("#"),rx("#","pathname","hash",r)),Wn(!r.search||!r.search.includes("#"),rx("#","search","hash",r)));let s=t===""||r.pathname==="",l=s?"/":r.pathname,c;if(l==null)c=n;else{let g=e.length-1;if(!i&&l.startsWith("..")){let x=l.split("/");for(;x[0]==="..";)x.shift(),g-=1;r.pathname=x.join("/")}c=g>=0?e[g]:"/"}let d=YO(r,c),p=l&&l!=="/"&&l.endsWith("/"),m=(s||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(p||m)&&(d.pathname+="/"),d}var co=t=>t.join("/").replace(/\/\/+/g,"/"),XO=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),KO=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,WO=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,ZO=class{constructor(t,e,n,i=!1){this.status=t,this.statusText=e||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function $O(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function QO(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var oC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function cC(t,e){let n=t;if(typeof n!="string"||!qO.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,r=!1;if(oC)try{let s=new URL(window.location.href),l=n.startsWith("//")?new URL(s.protocol+n):new URL(n),c=nc(l.pathname,e);l.origin===s.origin&&c!=null?n=c+l.search+l.hash:r=!0}catch{yl(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:r,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var uC=["POST","PUT","PATCH","DELETE"];new Set(uC);var JO=["GET",...uC];new Set(JO);var gh=G.createContext(null);gh.displayName="DataRouter";var F0=G.createContext(null);F0.displayName="DataRouterState";var e3=G.createContext(!1),fC=G.createContext({isTransitioning:!1});fC.displayName="ViewTransition";var t3=G.createContext(new Map);t3.displayName="Fetchers";var n3=G.createContext(null);n3.displayName="Await";var ns=G.createContext(null);ns.displayName="Navigation";var Pm=G.createContext(null);Pm.displayName="Location";var bl=G.createContext({outlet:null,matches:[],isDataRoute:!1});bl.displayName="Route";var R_=G.createContext(null);R_.displayName="RouteError";var dC="REACT_ROUTER_ERROR",i3="REDIRECT",r3="ROUTE_ERROR_RESPONSE";function a3(t){if(t.startsWith(`${dC}:${i3}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function s3(t){if(t.startsWith(`${dC}:${r3}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new ZO(e.status,e.statusText,e.data)}catch{}}function l3(t,{relative:e}={}){Wn(yh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=G.useContext(ns),{hash:r,pathname:s,search:l}=Gm(t,{relative:e}),c=s;return n!=="/"&&(c=s==="/"?n:co([n,s])),i.createHref({pathname:c,search:l,hash:r})}function yh(){return G.useContext(Pm)!=null}function xl(){return Wn(yh(),"useLocation() may be used only in the context of a <Router> component."),G.useContext(Pm).location}var hC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function pC(t){G.useContext(ns).static||G.useLayoutEffect(t)}function q0(){let{isDataRoute:t}=G.useContext(bl);return t?S3():o3()}function o3(){Wn(yh(),"useNavigate() may be used only in the context of a <Router> component.");let t=G.useContext(gh),{basename:e,navigator:n}=G.useContext(ns),{matches:i}=G.useContext(bl),{pathname:r}=xl(),s=JSON.stringify(N_(i)),l=G.useRef(!1);return pC(()=>{l.current=!0}),G.useCallback((d,p={})=>{if(yl(l.current,hC),!l.current)return;if(typeof d=="number"){n.go(d);return}let m=G0(d,JSON.parse(s),r,p.relative==="path");t==null&&e!=="/"&&(m.pathname=m.pathname==="/"?e:co([e,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[e,n,s,r,t])}var c3=G.createContext(null);function u3(t){let e=G.useContext(bl).outlet;return G.useMemo(()=>e&&G.createElement(c3.Provider,{value:t},e),[e,t])}function Gm(t,{relative:e}={}){let{matches:n}=G.useContext(bl),{pathname:i}=xl(),r=JSON.stringify(N_(n));return G.useMemo(()=>G0(t,JSON.parse(r),i,e==="path"),[t,r,i,e])}function f3(t,e){return mC(t,e)}function mC(t,e,n){var C;Wn(yh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=G.useContext(ns),{matches:r}=G.useContext(bl),s=r[r.length-1],l=s?s.params:{},c=s?s.pathname:"/",d=s?s.pathnameBase:"/",p=s&&s.route;{let w=p&&p.path||"";yC(c,!p||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
-
61
- Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let m=xl(),g;if(e){let w=typeof e=="string"?mh(e):e;Wn(d==="/"||((C=w.pathname)==null?void 0:C.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${w.pathname}" was given in the \`location\` prop.`),g=w}else g=m;let x=g.pathname||"/",v=x;if(d!=="/"){let w=d.replace(/^\//,"").split("/");v="/"+x.replace(/^\//,"").split("/").slice(w.length).join("/")}let E=aC(t,{pathname:v});yl(p||E!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),yl(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let A=g3(E&&E.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:co([d,i.encodeLocation?i.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?d:co([d,i.encodeLocation?i.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),r,n);return e&&A?G.createElement(Pm.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},A):A}function d3(){let t=_3(),e=$O(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=G.createElement(G.Fragment,null,G.createElement("p",null,"💿 Hey developer 👋"),G.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",G.createElement("code",{style:s},"ErrorBoundary")," or"," ",G.createElement("code",{style:s},"errorElement")," prop on your route.")),G.createElement(G.Fragment,null,G.createElement("h2",null,"Unexpected Application Error!"),G.createElement("h3",{style:{fontStyle:"italic"}},e),n?G.createElement("pre",{style:r},n):null,l)}var h3=G.createElement(d3,null),gC=class extends G.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,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=s3(t.digest);n&&(t=n)}let e=t!==void 0?G.createElement(bl.Provider,{value:this.props.routeContext},G.createElement(R_.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?G.createElement(p3,{error:t},e):e}};gC.contextType=e3;var ax=new WeakMap;function p3({children:t,error:e}){let{basename:n}=G.useContext(ns);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let i=a3(e.digest);if(i){let r=ax.get(e);if(r)throw r;let s=cC(i.location,n);if(oC&&!ax.get(e))if(s.isExternal||i.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:i.replace}));throw ax.set(e,l),l}return G.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function m3({routeContext:t,match:e,children:n}){let i=G.useContext(gh);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),G.createElement(bl.Provider,{value:t},n)}function g3(t,e=[],n){let i=n==null?void 0:n.state;if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(e.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let r=t,s=i==null?void 0:i.errors;if(s!=null){let m=r.findIndex(g=>g.route.id&&(s==null?void 0:s[g.route.id])!==void 0);Wn(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),r=r.slice(0,Math.min(r.length,m+1))}let l=!1,c=-1;if(n&&i){l=i.renderFallback;for(let m=0;m<r.length;m++){let g=r[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=m),g.route.id){let{loaderData:x,errors:v}=i,E=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!v||v[g.route.id]===void 0);if(g.route.lazy||E){n.isStatic&&(l=!0),c>=0?r=r.slice(0,c+1):r=[r[0]];break}}}}let d=n==null?void 0:n.onError,p=i&&d?(m,g)=>{var x,v;d(m,{location:i.location,params:((v=(x=i.matches)==null?void 0:x[0])==null?void 0:v.params)??{},unstable_pattern:QO(i.matches),errorInfo:g})}:void 0;return r.reduceRight((m,g,x)=>{let v,E=!1,A=null,C=null;i&&(v=s&&g.route.id?s[g.route.id]:void 0,A=g.route.errorElement||h3,l&&(c<0&&x===0?(yC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,C=null):c===x&&(E=!0,C=g.route.hydrateFallbackElement||null)));let w=e.concat(r.slice(0,x+1)),k=()=>{let N;return v?N=A:E?N=C:g.route.Component?N=G.createElement(g.route.Component,null):g.route.element?N=g.route.element:N=m,G.createElement(m3,{match:g,routeContext:{outlet:m,matches:w,isDataRoute:i!=null},children:N})};return i&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?G.createElement(gC,{location:i.location,revalidation:i.revalidation,component:A,error:v,children:k(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:p}):k()},null)}function k_(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function y3(t){let e=G.useContext(gh);return Wn(e,k_(t)),e}function b3(t){let e=G.useContext(F0);return Wn(e,k_(t)),e}function x3(t){let e=G.useContext(bl);return Wn(e,k_(t)),e}function O_(t){let e=x3(t),n=e.matches[e.matches.length-1];return Wn(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function v3(){return O_("useRouteId")}function _3(){var i;let t=G.useContext(R_),e=b3("useRouteError"),n=O_("useRouteError");return t!==void 0?t:(i=e.errors)==null?void 0:i[n]}function S3(){let{router:t}=y3("useNavigate"),e=O_("useNavigate"),n=G.useRef(!1);return pC(()=>{n.current=!0}),G.useCallback(async(r,s={})=>{yl(n.current,hC),n.current&&(typeof r=="number"?await t.navigate(r):await t.navigate(r,{fromRouteId:e,...s}))},[t,e])}var VS={};function yC(t,e,n){!e&&!VS[t]&&(VS[t]=!0,yl(!1,n))}G.memo(E3);function E3({routes:t,future:e,state:n,isStatic:i,onError:r}){return mC(t,void 0,{state:n,isStatic:i,onError:r})}function w3({to:t,replace:e,state:n,relative:i}){Wn(yh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=G.useContext(ns);yl(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=G.useContext(bl),{pathname:l}=xl(),c=q0(),d=G0(t,N_(s),l,i==="path"),p=JSON.stringify(d);return G.useEffect(()=>{c(JSON.parse(p),{replace:e,state:n,relative:i})},[c,p,i,e,n]),null}function XS(t){return u3(t.context)}function Ns(t){Wn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function T3({basename:t="/",children:e=null,location:n,navigationType:i="POP",navigator:r,static:s=!1,unstable_useTransitions:l}){Wn(!yh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),d=G.useMemo(()=>({basename:c,navigator:r,static:s,unstable_useTransitions:l,future:{}}),[c,r,s,l]);typeof n=="string"&&(n=mh(n));let{pathname:p="/",search:m="",hash:g="",state:x=null,key:v="default",unstable_mask:E}=n,A=G.useMemo(()=>{let C=nc(p,c);return C==null?null:{location:{pathname:C,search:m,hash:g,state:x,key:v,unstable_mask:E},navigationType:i}},[c,p,m,g,x,v,i,E]);return yl(A!=null,`<Router basename="${c}"> is not able to match the URL "${p}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:G.createElement(ns.Provider,{value:d},G.createElement(Pm.Provider,{children:e,value:A}))}function C3({children:t,location:e}){return f3(Cv(t),e)}function Cv(t,e=[]){let n=[];return G.Children.forEach(t,(i,r)=>{if(!G.isValidElement(i))return;let s=[...e,r];if(i.type===G.Fragment){n.push.apply(n,Cv(i.props.children,s));return}Wn(i.type===Ns,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Wn(!i.props.index||!i.props.children,"An index route cannot have child routes.");let l={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(l.children=Cv(i.props.children,s)),n.push(l)}),n}var a0="get",s0="application/x-www-form-urlencoded";function Y0(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function A3(t){return Y0(t)&&t.tagName.toLowerCase()==="button"}function M3(t){return Y0(t)&&t.tagName.toLowerCase()==="form"}function N3(t){return Y0(t)&&t.tagName.toLowerCase()==="input"}function R3(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function k3(t,e){return t.button===0&&(!e||e==="_self")&&!R3(t)}var xy=null;function O3(){if(xy===null)try{new FormData(document.createElement("form"),0),xy=!1}catch{xy=!0}return xy}var D3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function sx(t){return t!=null&&!D3.has(t)?(yl(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${s0}"`),null):t}function z3(t,e){let n,i,r,s,l;if(M3(t)){let c=t.getAttribute("action");i=c?nc(c,e):null,n=t.getAttribute("method")||a0,r=sx(t.getAttribute("enctype"))||s0,s=new FormData(t)}else if(A3(t)||N3(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=t.getAttribute("formaction")||c.getAttribute("action");if(i=d?nc(d,e):null,n=t.getAttribute("formmethod")||c.getAttribute("method")||a0,r=sx(t.getAttribute("formenctype"))||sx(c.getAttribute("enctype"))||s0,s=new FormData(c,t),!O3()){let{name:p,type:m,value:g}=t;if(m==="image"){let x=p?`${p}.`:"";s.append(`${x}x`,"0"),s.append(`${x}y`,"0")}else p&&s.append(p,g)}}else{if(Y0(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=a0,i=null,r=s0,l=t}return s&&r==="text/plain"&&(l=s,s=void 0),{action:i,method:n.toLowerCase(),encType:r,formData:s,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function D_(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function B3(t,e,n,i){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${i}`:r.pathname=`${r.pathname}.${i}`:r.pathname==="/"?r.pathname=`_root.${i}`:e&&nc(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${i}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${i}`,r}async function L3(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function U3(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function I3(t,e,n){let i=await Promise.all(t.map(async r=>{let s=e.routes[r.route.id];if(s){let l=await L3(s,n);return l.links?l.links():[]}return[]}));return G3(i.flat(1).filter(U3).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function KS(t,e,n,i,r,s){let l=(d,p)=>n[p]?d.route.id!==n[p].route.id:!0,c=(d,p)=>{var m;return n[p].pathname!==d.pathname||((m=n[p].route.path)==null?void 0:m.endsWith("*"))&&n[p].params["*"]!==d.params["*"]};return s==="assets"?e.filter((d,p)=>l(d,p)||c(d,p)):s==="data"?e.filter((d,p)=>{var g;let m=i.routes[d.route.id];if(!m||!m.hasLoader)return!1;if(l(d,p)||c(d,p))return!0;if(d.route.shouldRevalidate){let x=d.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(t,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function H3(t,e,{includeHydrateFallback:n}={}){return j3(t.map(i=>{let r=e.routes[i.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function j3(t){return[...new Set(t)]}function P3(t){let e={},n=Object.keys(t).sort();for(let i of n)e[i]=t[i];return e}function G3(t,e){let n=new Set;return new Set(e),t.reduce((i,r)=>{let s=JSON.stringify(P3(r));return n.has(s)||(n.add(s),i.push({key:s,link:r})),i},[])}function bC(){let t=G.useContext(gh);return D_(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function F3(){let t=G.useContext(F0);return D_(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var z_=G.createContext(void 0);z_.displayName="FrameworkContext";function xC(){let t=G.useContext(z_);return D_(t,"You must render this element inside a <HydratedRouter> element"),t}function q3(t,e){let n=G.useContext(z_),[i,r]=G.useState(!1),[s,l]=G.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=e,x=G.useRef(null);G.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let A=w=>{w.forEach(k=>{l(k.isIntersecting)})},C=new IntersectionObserver(A,{threshold:.5});return x.current&&C.observe(x.current),()=>{C.disconnect()}}},[t]),G.useEffect(()=>{if(i){let A=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(A)}}},[i]);let v=()=>{r(!0)},E=()=>{r(!1),l(!1)};return n?t!=="intent"?[s,x,{}]:[s,x,{onFocus:Fp(c,v),onBlur:Fp(d,E),onMouseEnter:Fp(p,v),onMouseLeave:Fp(m,E),onTouchStart:Fp(g,v)}]:[!1,x,{}]}function Fp(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function Y3({page:t,...e}){let{router:n}=bC(),i=G.useMemo(()=>aC(n.routes,t,n.basename),[n.routes,t,n.basename]);return i?G.createElement(X3,{page:t,matches:i,...e}):null}function V3(t){let{manifest:e,routeModules:n}=xC(),[i,r]=G.useState([]);return G.useEffect(()=>{let s=!1;return I3(t,e,n).then(l=>{s||r(l)}),()=>{s=!0}},[t,e,n]),i}function X3({page:t,matches:e,...n}){let i=xl(),{future:r,manifest:s,routeModules:l}=xC(),{basename:c}=bC(),{loaderData:d,matches:p}=F3(),m=G.useMemo(()=>KS(t,e,p,s,i,"data"),[t,e,p,s,i]),g=G.useMemo(()=>KS(t,e,p,s,i,"assets"),[t,e,p,s,i]),x=G.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let A=new Set,C=!1;if(e.forEach(k=>{var D;let N=s.routes[k.route.id];!N||!N.hasLoader||(!m.some(H=>H.route.id===k.route.id)&&k.route.id in d&&((D=l[k.route.id])!=null&&D.shouldRevalidate)||N.hasClientLoader?C=!0:A.add(k.route.id))}),A.size===0)return[];let w=B3(t,c,r.unstable_trailingSlashAwareDataRequests,"data");return C&&A.size>0&&w.searchParams.set("_routes",e.filter(k=>A.has(k.route.id)).map(k=>k.route.id).join(",")),[w.pathname+w.search]},[c,r.unstable_trailingSlashAwareDataRequests,d,i,s,m,e,t,l]),v=G.useMemo(()=>H3(g,s),[g,s]),E=V3(g);return G.createElement(G.Fragment,null,x.map(A=>G.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...n})),v.map(A=>G.createElement("link",{key:A,rel:"modulepreload",href:A,...n})),E.map(({key:A,link:C})=>G.createElement("link",{key:A,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function K3(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var W3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{W3&&(window.__reactRouterVersion="7.13.1")}catch{}function Z3({basename:t,children:e,unstable_useTransitions:n,window:i}){let r=G.useRef();r.current==null&&(r.current=AO({window:i,v5Compat:!0}));let s=r.current,[l,c]=G.useState({action:s.action,location:s.location}),d=G.useCallback(p=>{n===!1?c(p):G.startTransition(()=>c(p))},[n]);return G.useLayoutEffect(()=>s.listen(d),[s,d]),G.createElement(T3,{basename:t,children:e,location:l.location,navigationType:l.action,navigator:s,unstable_useTransitions:n})}var vC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_C=G.forwardRef(function({onClick:e,discover:n="render",prefetch:i="none",relative:r,reloadDocument:s,replace:l,unstable_mask:c,state:d,target:p,to:m,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:v,...E},A){let{basename:C,navigator:w,unstable_useTransitions:k}=G.useContext(ns),N=typeof m=="string"&&vC.test(m),D=cC(m,C);m=D.to;let H=l3(m,{relative:r}),z=xl(),F=null;if(c){let Q=G0(c,[],z.unstable_mask?z.unstable_mask.pathname:"/",!0);C!=="/"&&(Q.pathname=Q.pathname==="/"?C:co([C,Q.pathname])),F=w.createHref(Q)}let[ee,P,I]=q3(i,E),V=J3(m,{replace:l,unstable_mask:c,state:d,target:p,preventScrollReset:g,relative:r,viewTransition:x,unstable_defaultShouldRevalidate:v,unstable_useTransitions:k});function X(Q){e&&e(Q),Q.defaultPrevented||V(Q)}let ne=!(D.isExternal||s),q=G.createElement("a",{...E,...I,href:(ne?F:void 0)||D.absoluteURL||H,onClick:ne?X:e,ref:K3(A,P),target:p,"data-discover":!N&&n==="render"?"true":void 0});return ee&&!N?G.createElement(G.Fragment,null,q,G.createElement(Y3,{page:H})):q});_C.displayName="Link";var SC=G.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:i="",end:r=!1,style:s,to:l,viewTransition:c,children:d,...p},m){let g=Gm(l,{relative:p.relative}),x=xl(),v=G.useContext(F0),{navigator:E,basename:A}=G.useContext(ns),C=v!=null&&rD(g)&&c===!0,w=E.encodeLocation?E.encodeLocation(g).pathname:g.pathname,k=x.pathname,N=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(k=k.toLowerCase(),N=N?N.toLowerCase():null,w=w.toLowerCase()),N&&A&&(N=nc(N,A)||N);const D=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let H=k===w||!r&&k.startsWith(w)&&k.charAt(D)==="/",z=N!=null&&(N===w||!r&&N.startsWith(w)&&N.charAt(w.length)==="/"),F={isActive:H,isPending:z,isTransitioning:C},ee=H?e:void 0,P;typeof i=="function"?P=i(F):P=[i,H?"active":null,z?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let I=typeof s=="function"?s(F):s;return G.createElement(_C,{...p,"aria-current":ee,className:P,ref:m,style:I,to:l,viewTransition:c},typeof d=="function"?d(F):d)});SC.displayName="NavLink";var $3=G.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:i,replace:r,state:s,method:l=a0,action:c,onSubmit:d,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:x,...v},E)=>{let{unstable_useTransitions:A}=G.useContext(ns),C=nD(),w=iD(c,{relative:p}),k=l.toLowerCase()==="get"?"get":"post",N=typeof c=="string"&&vC.test(c),D=H=>{if(d&&d(H),H.defaultPrevented)return;H.preventDefault();let z=H.nativeEvent.submitter,F=(z==null?void 0:z.getAttribute("formmethod"))||l,ee=()=>C(z||H.currentTarget,{fetcherKey:e,method:F,navigate:n,replace:r,state:s,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:x});A&&n!==!1?G.startTransition(()=>ee()):ee()};return G.createElement("form",{ref:E,method:k,action:w,onSubmit:i?d:D,...v,"data-discover":!N&&t==="render"?"true":void 0})});$3.displayName="Form";function Q3(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function EC(t){let e=G.useContext(gh);return Wn(e,Q3(t)),e}function J3(t,{target:e,replace:n,unstable_mask:i,state:r,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:p}={}){let m=q0(),g=xl(),x=Gm(t,{relative:l});return G.useCallback(v=>{if(k3(v,e)){v.preventDefault();let E=n!==void 0?n:Em(g)===Em(x),A=()=>m(t,{replace:E,unstable_mask:i,state:r,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:d});p?G.startTransition(()=>A()):A()}},[g,m,x,n,i,r,e,t,s,l,c,d,p])}var eD=0,tD=()=>`__${String(++eD)}__`;function nD(){let{router:t}=EC("useSubmit"),{basename:e}=G.useContext(ns),n=v3(),i=t.fetch,r=t.navigate;return G.useCallback(async(s,l={})=>{let{action:c,method:d,encType:p,formData:m,body:g}=z3(s,e);if(l.navigate===!1){let x=l.fetcherKey||tD();await i(x,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||d,formEncType:l.encType||p,flushSync:l.flushSync})}else await r(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||d,formEncType:l.encType||p,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[i,r,e,n])}function iD(t,{relative:e}={}){let{basename:n}=G.useContext(ns),i=G.useContext(bl);Wn(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),s={...Gm(t||".",{relative:e})},l=xl();if(t==null){s.search=l.search;let c=new URLSearchParams(s.search),d=c.getAll("index");if(d.some(m=>m==="")){c.delete("index"),d.filter(g=>g).forEach(g=>c.append("index",g));let m=c.toString();s.search=m?`?${m}`:""}}return(!t||t===".")&&r.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:co([n,s.pathname])),Em(s)}function rD(t,{relative:e}={}){let n=G.useContext(fC);Wn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=EC("useViewTransitionState"),r=Gm(t,{relative:e});if(!n.isTransitioning)return!1;let s=nc(n.currentLocation.pathname,i)||n.currentLocation.pathname,l=nc(n.nextLocation.pathname,i)||n.nextLocation.pathname;return g0(r.pathname,l)!=null||g0(r.pathname,s)!=null}rC();const WS=t=>{let e;const n=new Set,i=(p,m)=>{const g=typeof p=="function"?p(e):p;if(!Object.is(g,e)){const x=e;e=m??(typeof g!="object"||g===null)?g:Object.assign({},e,g),n.forEach(v=>v(e,x))}},r=()=>e,c={setState:i,getState:r,getInitialState:()=>d,subscribe:p=>(n.add(p),()=>n.delete(p))},d=e=t(i,r,c);return c},aD=(t=>t?WS(t):WS),sD=t=>t;function lD(t,e=sD){const n=sm.useSyncExternalStore(t.subscribe,sm.useCallback(()=>e(t.getState()),[t,e]),sm.useCallback(()=>e(t.getInitialState()),[t,e]));return sm.useDebugValue(n),n}const ZS=t=>{const e=aD(t),n=i=>lD(e,i);return Object.assign(n,e),n},Sf=(t=>t?ZS(t):ZS),dl=Sf(t=>({user:null,isAuthenticated:!1,loading:!1,error:null,login:async(e,n)=>{t({loading:!0,error:null});try{const i=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:n}),credentials:"include"}),r=await i.json();if(!i.ok){t({loading:!1,error:r.error||"Login failed"});return}t({user:r.user,isAuthenticated:!0,loading:!1,error:null})}catch{t({loading:!1,error:"Network error"})}},logout:async()=>{try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch{}t({user:null,isAuthenticated:!1,error:null})},checkAuth:async()=>{t({loading:!0});try{const e=await fetch("/api/auth/me",{credentials:"include"});if(e.ok){const n=await e.json();t({user:n.user,isAuthenticated:!0,loading:!1})}else t({user:null,isAuthenticated:!1,loading:!1})}catch{t({user:null,isAuthenticated:!1,loading:!1})}},reset:()=>t({user:null,isAuthenticated:!1,loading:!1,error:null})})),Ta=Sf((t,e)=>({squads:[],selectedSquad:null,activeStates:{},fetchSquads:async()=>{try{const n=await fetch("/api/squads",{credentials:"include"});if(n.ok){const i=await n.json();t({squads:i.squads})}}catch{}},selectSquad:n=>t({selectedSquad:n}),setSquadState:(n,i)=>t(r=>({activeStates:{...r.activeStates,[n]:i}})),clearSquadState:n=>t(i=>{const{[n]:r,...s}=i.activeStates;return{activeStates:s}}),reset:()=>t({squads:[],selectedSquad:null,activeStates:{}})}));let oD=0;function $S(){return`local-${Date.now()}-${++oD}`}const nr=Sf((t,e)=>({conversations:[],messages:[],conversationId:null,streaming:!1,streamingText:"",activity:null,error:null,addUserMessage:n=>{const i={id:$S(),role:"user",content:n,createdAt:new Date().toISOString()};t(r=>{const s=r.conversationId,l=s&&!r.messages.some(c=>c.role==="user")?r.conversations.map(c=>c.id===s?{...c,preview:n.slice(0,80)}:c):r.conversations;return{messages:[...r.messages,i],error:null,conversations:l}})},setConversationId:n=>{t({conversationId:n})},startStreaming:()=>{t({streaming:!0,streamingText:"",activity:null,error:null})},appendChunk:n=>{t(i=>({streamingText:i.streamingText+n,activity:null}))},setActivity:n=>{t({activity:n})},finishStreaming:n=>{const{streamingText:i}=e(),r={id:n,role:"assistant",content:i,createdAt:new Date().toISOString()};t(s=>({messages:[...s.messages,r],streaming:!1,streamingText:"",activity:null}))},addAgentDm:n=>{const i={id:$S(),role:"agent_dm",content:n.content,agentId:n.agentId,agentName:n.agentName,createdAt:new Date().toISOString()};t(r=>({messages:[...r.messages,i]}))},setError:n=>{t({error:n,streaming:!1,streamingText:"",activity:null})},loadConversations:async n=>{try{const i=await fetch(`/api/squads/${n}/conversations`,{credentials:"include"});if(!i.ok)return;const s=((await i.json()).data||[]).map(l=>({id:l.id,createdAt:l.created_at,preview:""}));for(const l of s)try{const c=await fetch(`/api/conversations/${l.id}/messages?limit=1`,{credentials:"include"});if(c.ok){const p=((await c.json()).data||[])[0];p&&(l.preview=p.content.slice(0,80))}}catch{}t({conversations:s})}catch{}},selectConversation:async n=>{t({conversationId:n,messages:[],streaming:!1,streamingText:"",activity:null,error:null});try{const i=await fetch(`/api/conversations/${n}/messages`,{credentials:"include"});if(!i.ok)return;const s=((await i.json()).data||[]).map(l=>({id:l.id,role:l.role,content:l.content,agentId:l.agent_id??void 0,agentName:l.agent_name??void 0,createdAt:l.created_at}));t({messages:s})}catch{}},deleteConversation:async(n,i)=>{try{if(!(await fetch(`/api/conversations/${n}`,{method:"DELETE",credentials:"include"})).ok)return;const{conversationId:s}=e();t(l=>({conversations:l.conversations.filter(c=>c.id!==n)})),s===n&&t({conversationId:null,messages:[]})}catch{}},loadHistory:async n=>{try{const i=await fetch(`/api/squads/${n}/conversations`,{credentials:"include"});if(!i.ok)return;const r=await i.json();if(!r.data||r.data.length===0){t({conversationId:null,messages:[],conversations:[]});return}const s=(r.data||[]).map(g=>({id:g.id,createdAt:g.created_at,preview:""})),l=r.data[0];t({conversationId:l.id,conversations:s});const c=await fetch(`/api/conversations/${l.id}/messages`,{credentials:"include"});if(!c.ok)return;const p=((await c.json()).data||[]).map(g=>({id:g.id,role:g.role,content:g.content,agentId:g.agent_id??void 0,agentName:g.agent_name??void 0,createdAt:g.created_at})),m=p.find(g=>g.role==="user");if(m){const g=s.findIndex(x=>x.id===l.id);g>=0&&(s[g].preview=m.content.slice(0,80))}t({messages:p,conversations:s});for(const g of s)if(g.id!==l.id)try{const x=await fetch(`/api/conversations/${g.id}/messages?limit=1`,{credentials:"include"});if(x.ok){const E=((await x.json()).data||[])[0];E&&(g.preview=E.content.slice(0,80))}}catch{}t({conversations:[...s]})}catch{}},reset:()=>t({conversations:[],messages:[],conversationId:null,streaming:!1,streamingText:"",error:null})}));function cD(t){const n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`,i=new WebSocket(n),r=[];let s=!0;function l(c){i.readyState===WebSocket.OPEN?i.send(JSON.stringify(c)):i.readyState===WebSocket.CONNECTING&&r.push(c)}return i.onopen=()=>{var c,d;s||(d=(c=t.current).onReconnect)==null||d.call(c),s=!1;for(const p of r)i.send(JSON.stringify(p));r.length=0},i.onmessage=c=>{var d,p,m,g,x,v,E,A,C,w,k,N,D,H,z,F,ee;try{const P=JSON.parse(c.data),I=t.current;switch(P.type){case"squad:state":(d=I.onSquadState)==null||d.call(I,P.squadName,P.state);break;case"squad:inactive":(p=I.onSquadInactive)==null||p.call(I,P.squadName,P.reason);break;case"chat:chunk":(m=I.onChatChunk)==null||m.call(I,P.squadName,P.conversationId,P.delta);break;case"chat:activity":(g=I.onChatActivity)==null||g.call(I,P.squadName,P.tool,P.summary);break;case"chat:done":(x=I.onChatDone)==null||x.call(I,P.squadName,P.conversationId,P.messageId);break;case"chat:error":(v=I.onChatError)==null||v.call(I,P.squadName,P.error);break;case"chat:agent_dm":(E=I.onChatAgentDm)==null||E.call(I,P.squadName,P.conversationId,P.agentId,P.agentName,P.message);break;case"chat:conversation_created":(A=I.onChatConversationCreated)==null||A.call(I,P.squadName,P.conversationId);break;case"agent:output_chunk":(C=I.onAgentOutputChunk)==null||C.call(I,P.squadName,P.agentId,P.agentName,P.delta);break;case"agent:step_start":(w=I.onAgentStepStart)==null||w.call(I,P.squadName,P.agentId,P.agentName,P.stepIndex,P.stepLabel);break;case"agent:step_complete":(k=I.onAgentStepComplete)==null||k.call(I,P.squadName,P.agentId,P.agentName,P.stepIndex,P.stepLabel);break;case"squad:checkpoint":(N=I.onSquadCheckpoint)==null||N.call(I,P.squadName,P.agentId,P.agentName,P.question);break;case"schedule:started":(D=I.onScheduleStarted)==null||D.call(I,P.squadName,P.jobId,P.attempt);break;case"schedule:chunk":(H=I.onScheduleChunk)==null||H.call(I,P.squadName,P.jobId,P.delta);break;case"schedule:done":(z=I.onScheduleDone)==null||z.call(I,P.squadName,P.jobId,P.summary,P.attempt);break;case"schedule:error":(F=I.onScheduleError)==null||F.call(I,P.squadName,P.jobId,P.error,P.attempt,P.willRetry);break;case"schedule:status_changed":(ee=I.onScheduleStatusChanged)==null||ee.call(I,P.squadName,P.status);break}}catch{}},{subscribe:c=>{l({type:"squad:subscribe",squadName:c})},unsubscribe:c=>{l({type:"squad:unsubscribe",squadName:c})},sendChat:(c,d,p)=>{const m={type:"chat:send",squadName:c,message:d};p&&p.length>0&&(m.files=p),l(m)},newConversation:c=>{l({type:"chat:new_conversation",squadName:c})},sendCheckpointResponse:(c,d)=>{l({type:"squad:checkpoint_response",squadName:c,answer:d})},disconnect:()=>{i.close()}}}function uD(t={}){const e=G.useRef(null),n=G.useRef(t),i=G.useRef(new Set);n.current=t,G.useEffect(()=>{const p=cD(n);e.current=p;for(const m of i.current)p.subscribe(m);return()=>{p.disconnect()}},[]);const r=G.useCallback(p=>{var m;i.current.add(p),(m=e.current)==null||m.subscribe(p)},[]),s=G.useCallback(p=>{var m;i.current.delete(p),(m=e.current)==null||m.unsubscribe(p)},[]),l=G.useCallback((p,m,g)=>{var x;(x=e.current)==null||x.sendChat(p,m,g)},[]),c=G.useCallback(p=>{var m;(m=e.current)==null||m.newConversation(p)},[]),d=G.useCallback((p,m)=>{var g;(g=e.current)==null||g.sendCheckpointResponse(p,m)},[]);return{subscribe:r,unsubscribe:s,sendChat:l,newConversation:c,sendCheckpointResponse:d}}const fD={idle:{color:"var(--status-idle)",glow:"none",icon:"○"},working:{color:"var(--status-active)",glow:"0 0 6px var(--status-active-glow)",icon:"●"},delivering:{color:"var(--accent)",glow:"0 0 6px var(--accent-glow)",icon:"→"},done:{color:"var(--status-active)",glow:"none",icon:"✓"},checkpoint:{color:"var(--status-warning)",glow:"0 0 6px var(--status-warning-glow)",icon:"◆"},running:{color:"var(--status-active)",glow:"0 0 6px var(--status-active-glow)",icon:"●"},completed:{color:"var(--status-active)",glow:"none",icon:"✓"}},dD={color:"var(--status-idle)",glow:"none"};function hD({status:t}){if(!t)return null;const e=fD[t]||dD;return R.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:e.color,letterSpacing:"0.02em"},children:[R.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:e.color,boxShadow:e.glow,animation:t==="working"||t==="running"?"statusPulse 2s ease-in-out infinite":"none"}}),t]})}function pD({squad:t,selected:e,onClick:n}){return R.jsxs("div",{onClick:n,style:{padding:"8px 10px",cursor:"pointer",borderRadius:"var(--radius-sm)",background:e?"var(--accent-glow)":"transparent",borderLeft:e?"2px solid var(--accent)":"2px solid transparent",marginBottom:2,transition:"all var(--duration-fast) var(--ease-out)"},children:[R.jsx("div",{style:{fontSize:"0.82rem",fontWeight:e?600:400,color:e?"var(--text-primary)":"var(--text-secondary)",marginBottom:2},children:t.name}),R.jsx(hD,{status:t.status})]})}function mD({squads:t,selectedSquad:e,onSelect:n}){return R.jsxs("div",{style:{padding:"var(--sp-3)"},children:[R.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",padding:"0 var(--sp-2)",marginBottom:"var(--sp-2)"},children:"Squads"}),t.length===0&&R.jsx("div",{style:{padding:"8px 10px",color:"var(--text-muted)",fontSize:"0.75rem",fontStyle:"italic"},children:"No squads found"}),t.map(i=>R.jsx(pD,{squad:i,selected:i.code===e,onClick:()=>n(i.code)},i.code))]})}function gD(t){const e=Math.floor(t/3600),n=Math.floor(t%3600/60),i=t%60,r=s=>s.toString().padStart(2,"0");return e>0?`${e}h ${r(n)}m ${r(i)}s`:`${n}m ${r(i)}s`}function yD({state:t}){const[e,n]=G.useState(0);return G.useEffect(()=>{if(!(t!=null&&t.startedAt)||t.status!=="running"){n(0);return}const i=new Date(t.startedAt).getTime(),r=()=>n(Math.floor((Date.now()-i)/1e3));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[t==null?void 0:t.startedAt,t==null?void 0:t.status]),R.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"var(--statusbar-height)",padding:"0 var(--sp-4)",background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:t?R.jsxs(R.Fragment,{children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[R.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:t.status==="running"?"var(--status-active)":t.status==="checkpoint"?"var(--status-warning)":"var(--status-idle)",boxShadow:t.status==="running"?"0 0 8px var(--status-active-glow)":"none",animation:t.status==="running"?"statusPulse 2s ease-in-out infinite":"none"}}),R.jsxs("span",{style:{color:"var(--text-secondary)"},children:["Step ",t.step.current,"/",t.step.total]}),R.jsx("span",{style:{color:"var(--border-strong)"},children:"│"}),R.jsx("span",{children:t.step.label})]}),R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[t.handoff&&R.jsxs("span",{style:{color:"var(--accent)"},children:[t.handoff.from," → ",t.handoff.to]}),t.status==="running"&&R.jsx("span",{style:{color:"var(--text-secondary)"},children:gD(e)})]})]}):R.jsxs(R.Fragment,{children:[R.jsx("span",{children:"Ready"}),R.jsx("span",{children:"ExpxAgents Mission Control"})]})})}let Av=null;function bD(t){Av=t}function xD(t,e,n){Av&&Av(t,e,n)}let Mv=null;function vD(t){Mv=t}function _D(t){Mv&&Mv(t)}let Nv=null;function SD(t){Nv=t}function ED(t,e){Nv&&Nv(t,e)}const l0=32,ol=96,Jc=64,dt={floor:13158600,floorHighlight:14211288,floorGrout:12105912,wall:15261904,wallTrim:11577496,baseboard:7035464,desk:15263976,deskTop:16119285,deskShadow:13684944,deskLeg:1710618,deskEdge:14737632,monitor:2236976,monitorScreen:1981020,monitorScreenGlow:2773120,monitorStand:3355456,keyboard:3355456,keyboardKey:4473941,chairSeat:2899536,chairBack:3426654,chairBase:4473924,chairWheel:3355443,plant:5025616,plantDark:3706428,plantLight:6732650,pot:9133628,potRim:10515018,soil:4863264,bookshelf:8020808,bookshelfEdge:9139029,bookColors:[15022389,2001125,4431943,16750592,9315498,35195,16635957],rug:6044974,rugPattern:8016448,rugBorder:4861472},Rv=[5227511,5025616,16750592,15022389,9315498,16771899],wD={idle:8947848,working:5025616,delivering:5227511,done:5025616,checkpoint:16750592},Or={counter:4073251,counterTop:6111287,machine:3622735,machineTop:4545124,machineLight:5025616,cup:14142664,cupShadow:12364452,saucer:14735052,sink:7901340,faucet:11583173,menu:5125166},Xa={table:6111287,tableTop:7162945,tableEdge:5125166,tableLeg:4073251,chair:3622735,chairSeat:4545124,chairBack:5533306,carpet:2503224,carpetPattern:3030340,whiteboard:15527921,whiteboardFrame:7901340},uf={background:1713022,backgroundGlow:2635155,statusRunning:5025616,statusIdle:8947848,statusCheckpoint:16750592,statusCompleted:5025616},tu={floor:11579568,tile:11053224,grout:10066329,stripe:12632256},ra={floor:14477552,tile:12966120,tileGrout:11453652,wall:14740208,stall:11583173,stallDoor:9479342,sink:15527921,sinkBowl:16777215,mirror:11789820,mirrorFrame:7901340,toilet:16448250,toiletSeat:15658734,pipe:9479342},Sa={floor:6111287,carpet:5125166,carpetBorder:4073251,desk:4073251,deskTop:6111287,deskEdge:2890510,chair:1713022,chairSeat:2635155,window:8508666,windowFrame:5533306,windowSill:7901340,bookshelf:7162945,globe:4367861,nameplate:16766720},Jd={wall:7901340,wallHighlight:10795204,doorFrame:6111287},tr={floor:16115411,tile:15259072,tileGrout:13942952,counter:6111287,counterTop:7951688,fridge:15527921,fridgeDoor:14737632,fridgeHandle:10395294,table:9268835,tableTop:10586239,chair:7162945,coffeeMaker:3622735,coffeeMakerLight:5025616,lamp:16766287},Ea={floor:14142664,carpet:6323595,carpetBorder:4545124,sofa:5533306,sofaCushion:6323595,sofaArm:4545124,tv:2171169,tvScreen:2503224,tvStand:4342338,sideTable:7951688,magazine:15684432,magazineAlt:4367861},Zo=480,Wa=360,Qu=400,Pi=60,Ka=120,lx=120,QS=160,JS=120,eE=160,TD=64,CD=80,AD=ol+32,MD=Jc+48,tE=2,wC=10,Vo=80;function vy(t,e,n){const i=Math.max(0,Math.min(1,n));return t+(e-t)*i}function ND(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}const RD=["nw","ne","sw","se"],kD={nw:"right",ne:"left",sw:"top",se:"top"};function y0(t){const e=wC,n=Math.max(1,t),i={nw:0,ne:0,sw:0,se:0},r=[];for(let $=0;$<n;$++){const j=RD[$%4];r.push({quadrant:j,slot:i[j]}),i[j]++}const s=Math.max(1,i.nw),l=Math.max(1,i.ne),c=Math.max(1,i.sw),d=Math.max(1,i.se),p=Math.max(Qu,Ka),m=s*(Wa+e),g=l*(Wa+e),x=Math.max(m+p,g+Ka),v=c*(Wa+e),E=d*(Wa+e),A=Math.max(QS,eE),C=Math.max(v+A+e,E+A+e),w=Math.max(Zo,Ka+e+Qu),k=Math.max(Zo,Ka),N=Math.max(Zo,lx),D=Math.max(Zo,JS),H=Math.max(w,N),z=Math.max(k,D),F=e+H+e+Pi+e+z+e,ee=e+x+e+Pi+e+C+e,P={x:e+H+e,y:e,width:Pi,height:ee-2*e},I={x:e,y:e+x+e,width:F-2*e,height:Pi},V={x:P.x+P.width/2,y:I.y+I.height/2},X={x:P.x-e-Qu,y:I.y-e-Qu,width:Qu,height:Qu},ne={x:X.x-e-Ka,y:I.y-e-Ka,width:Ka,height:Ka},q={x:P.x+Pi+e,y:I.y-e-Ka,width:Ka,height:Ka},Q={x:P.x-e-lx,y:I.y+Pi+e+c*(Wa+e),width:lx,height:QS},B={x:P.x+Pi+e,y:I.y+Pi+e+d*(Wa+e),width:JS,height:eE},Y=[],Z={};for(let $=0;$<n;$++){const{quadrant:j,slot:K}=r[$],te=kD[j];let U;j==="nw"?U={x:P.x-e-Zo,y:X.y-e-(K+1)*Wa-K*e}:j==="ne"?U={x:P.x+Pi+e,y:q.y-e-(K+1)*Wa-K*e}:j==="sw"?U={x:P.x-e-Zo,y:I.y+Pi+e+K*(Wa+e)}:U={x:P.x+Pi+e,y:I.y+Pi+e+K*(Wa+e)},Y.push({origin:U,width:Zo,height:Wa,quadrant:j,doorSide:te}),te==="right"||te==="left"?Z[`squad-${$}`]={x:P.x+Pi/2,y:U.y+Wa/2}:Z[`squad-${$}`]={x:U.x+Zo/2,y:I.y+Pi/2}}return Z.ceo={x:P.x+Pi/2,y:X.y+Qu/2},Z["bathroom-male"]={x:ne.x+Ka/2,y:I.y+Pi/2},Z["bathroom-female"]={x:q.x+Ka/2,y:I.y+Pi/2},Z.kitchen={x:P.x+Pi/2,y:Q.y+Q.height/2},Z["rest-area"]={x:P.x+Pi/2,y:B.y+B.height/2},{totalWidth:F,totalHeight:ee,squadOrigins:Y,ceoOffice:X,corridorH:I,corridorV:P,bathroomMale:ne,bathroomFemale:q,kitchen:Q,restArea:B,doorPoints:Z,corridorHub:V}}function Wd(t,e,n,i){const r=t%tE,s=Math.floor(t/tE);return{x:e.x+TD+r*AD,y:e.y+CD+s*MD}}function dm(t,e,n){return{x:t.x+e-80,y:t.y+n-80}}function TC(t,e,n){return{x:t.x+e-160,y:t.y+Math.floor(n/2)}}function OD(t,e){const n=e==="male"?t.bathroomMale:t.bathroomFemale;return{x:n.x+n.width/2,y:n.y+n.height/2}}function DD(t){return{x:t.kitchen.x+t.kitchen.width/2,y:t.kitchen.y+t.kitchen.height/2}}function zD(t){return{x:t.restArea.x+t.restArea.width/2,y:t.restArea.y+t.restArea.height/2}}function BD(t){const e=t.corridorV;if(e.height>0&&Math.random()<.5)return{x:e.x+10+Math.random()*Math.max(0,e.width-20),y:e.y+10+Math.random()*Math.max(0,e.height-20)};const n=t.corridorH;return{x:n.x+20+Math.random()*Math.max(0,n.width-40),y:n.y+10+Math.random()*Math.max(0,n.height-20)}}function nE(t,e){const n=e.corridorH;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function iE(t,e){const n=e.corridorV;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function LD(t,e){if(t==="ceo"){const i=e.ceoOffice;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="bathroom-male"){const i=e.bathroomMale;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="bathroom-female"){const i=e.bathroomFemale;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="kitchen"){const i=e.kitchen;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="rest-area"){const i=e.restArea;return{x:i.x+i.width/2,y:i.y+i.height/2}}const n=t.match(/^squad-(\d+)$/);if(n){const i=parseInt(n[1],10),r=e.squadOrigins[i];if(r)return{x:r.origin.x+r.width/2,y:r.origin.y+r.height/2}}return e.corridorHub}function hm(t,e,n,i){const r=i.doorPoints[e],s=i.doorPoints[n];if(!r||!s)return[t];const l=i.corridorHub,c=LD(n,i),d=nE(r,i)&&nE(s,i),p=iE(r,i)&&iE(s,i);return d||p?[t,r,s,c]:[t,r,l,s,c]}function _y(t,e){const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)}const rE=500,aE=50;let sE=0;function lE(t){return{idle:"idle",working:"working",delivering:"walking",done:"idle",checkpoint:"checkpoint"}[t]??"idle"}const ri=Sf(t=>({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{},appendBubble:(e,n,i)=>{const r=`${e}:${n}`;t(s=>{var d;let c=(((d=s.bubbles[r])==null?void 0:d.text)??"")+i;return c.length>rE&&(c=c.slice(c.length-rE)),{bubbles:{...s.bubbles,[r]:{text:c,updatedAt:Date.now()}}}})},clearBubble:(e,n)=>{const i=`${e}:${n}`;t(r=>{const{[i]:s,...l}=r.bubbles;return{bubbles:l}})},clearAllBubbles:()=>t({bubbles:{}}),addActivity:(e,n,i)=>{const s={id:++sE,agentName:n,action:i,timestamp:Date.now()};t(l=>{var m;const d=[...((m=l.activityLog[e])==null?void 0:m.entries)??[],s],p=d.length>aE?d.slice(d.length-aE):d;return{activityLog:{...l.activityLog,[e]:{entries:p}}}})},setCheckpoint:(e,n,i,r)=>t(s=>({checkpoints:{...s.checkpoints,[e]:{agentId:n,agentName:i,question:r}}})),clearCheckpoint:e=>t(n=>{const{[e]:i,...r}=n.checkpoints;return{checkpoints:r}}),setActiveRoom:e=>t({activeRoom:e}),syncRooms:e=>t(n=>{const i=e;let r;return i.length===0?r=null:n.activeRoom===null||!i.includes(n.activeRoom)?r=i[0]:r=n.activeRoom,{rooms:i,activeRoom:r}}),setAgents:(e,n)=>t(i=>{const r=i.agentVisuals[e]??[],s=new Map(r.map(v=>[v.id,v])),l={x:0,y:0},c=y0(i.rooms.length),d=i.rooms.indexOf(e),p=c.squadOrigins[d],m=(p==null?void 0:p.width)??480,g=(p==null?void 0:p.height)??360,x=n.map((v,E)=>{const A=s.get(v.id);if(A){const k=v.status?lE(v.status):A.status,N=k!==A.status;let D=A.targetPosition;return N&&(k==="working"||k==="checkpoint"?D=Wd(E,l):D=dm(l,m,g)),{...A,name:v.name,deskIndex:E,status:k,targetPosition:D}}const C=v.status?lE(v.status):"idle",w=C==="working"||C==="checkpoint"?Wd(E,l):dm(l,m,g);return{id:v.id,name:v.name,colorIndex:E%6,status:C,deskIndex:E,position:w,targetPosition:null}});return{agentVisuals:{...i.agentVisuals,[e]:x}}}),setAgentStatus:(e,n,i)=>t(r=>{const s=r.agentVisuals[e];if(!s)return r;const l={x:0,y:0},c=y0(r.rooms.length),d=r.rooms.indexOf(e),p=c.squadOrigins[d],m=(p==null?void 0:p.width)??480,g=(p==null?void 0:p.height)??360,x=s.map(v=>{if(v.id!==n)return v;let E;return i==="working"||i==="checkpoint"?E=Wd(v.deskIndex,l):E=dm(l,m,g),{...v,status:i,targetPosition:E}});return{agentVisuals:{...r.agentVisuals,[e]:x}}}),reset:()=>{sE=0,t({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{}})}})),yZ={background:"#0a0a0f",grid:"rgba(0, 200, 255, 0.06)",orbStandby:"#1a3a5c",orbListening:"#00c8ff",orbProcessing:"#ff8c00",orbSpeaking:"#00ff88",panelBg:"rgba(0, 200, 255, 0.08)",panelBorder:"rgba(0, 200, 255, 0.25)",textPrimary:"#e0e8f0",textAccent:"#00c8ff",textJarvis:"#00ff88",particleStart:"#00c8ff"},UD={orbRadius:60,orbRingWidth:3,gridSpacing:40,particleCount:65,particleMinRadius:1,particleMaxRadius:3,waveformBars:32,waveformMaxHeight:40,panelWidth:180,panelPadding:12,transcriptLineHeight:20,standbyTimeoutMs:15e3,ttsSplitLength:300};let CC=0;function ID(){return`jarvis-${Date.now()}-${++CC}`}let no=null;const ox=Sf((t,e)=>({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:"",setMode:n=>t({mode:n}),addMessage:(n,i)=>{const r={id:ID(),role:n,content:i,createdAt:new Date().toISOString()};t(s=>({messages:[...s.messages,r]}))},appendChunk:n=>{t(i=>({streamingText:i.streamingText+n}))},finalizeMessage:n=>{const{streamingText:i}=e(),r={id:n,role:"assistant",content:i,createdAt:new Date().toISOString()};t(s=>({messages:[...s.messages,r],streamingText:""}))},selectSquad:n=>t({selectedSquad:n}),setUserName:n=>t({userName:n}),startStandbyTimer:()=>{no&&clearTimeout(no),no=setTimeout(()=>{t({mode:"STANDBY"}),no=null},UD.standbyTimeoutMs)},resetStandbyTimer:()=>{e().startStandbyTimer()},clearStandbyTimer:()=>{no&&(clearTimeout(no),no=null)},reset:()=>{no&&(clearTimeout(no),no=null),CC=0,t({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:""})}})),lo=Sf((t,e)=>({jobs:[],loading:!1,fetchJobs:async()=>{t({loading:!0});try{const n=await fetch("/api/scheduler",{credentials:"include"});if(n.ok){const i=await n.json();t({jobs:i.data,loading:!1})}else t({loading:!1})}catch{t({loading:!1})}},pauseJob:async n=>{await fetch(`/api/scheduler/${n}/pause`,{method:"POST",credentials:"include"}),e().fetchJobs()},resumeJob:async n=>{await fetch(`/api/scheduler/${n}/resume`,{method:"POST",credentials:"include"}),e().fetchJobs()},triggerJob:async n=>{await fetch(`/api/scheduler/${n}/trigger`,{method:"POST",credentials:"include"})},updateJobStatus:(n,i)=>{t(r=>({jobs:r.jobs.map(s=>s.squad_name===n?{...s,status:i}:s)}))}})),HD=[{to:"/office",label:"Office",icon:"⬡"},{to:"/chat",label:"Chat",icon:"◈"},{to:"/kanban",label:"Kanban",icon:"▦"},{to:"/scheduler",label:"Scheduler",icon:"⏣"},{to:"/email",label:"Email",icon:"✉"},{to:"/orgchart",label:"Org Chart",icon:"◎"},{to:"/settings",label:"Settings",icon:"⚙"}];function jD(){const t=dl(U=>U.user),e=dl(U=>U.isAuthenticated),n=dl(U=>U.loading),i=dl(U=>U.logout),r=dl(U=>U.checkAuth),s=q0(),l=xl(),c=l.pathname==="/office"||l.pathname==="/",d=l.pathname==="/jarvis",p=Ta(U=>U.squads),m=Ta(U=>U.selectedSquad),g=Ta(U=>m?U.activeStates[m]:null),x=Ta(U=>U.fetchSquads),v=Ta(U=>U.selectSquad),E=Ta(U=>U.setSquadState),A=Ta(U=>U.clearSquadState),C=G.useCallback((U,le)=>{E(U,le);const de=ri.getState();de.rooms.includes(U)||de.syncRooms([...de.rooms,U]),le.status!=="checkpoint"&&de.clearCheckpoint(U),le.agents&&de.setAgents(U,le.agents.map(ge=>({id:ge.id,name:ge.name,status:ge.status})))},[E]),w=G.useCallback(U=>{A(U);const le=ri.getState(),de=le.agentVisuals[U];if(de)for(const ge of de)le.setAgentStatus(U,ge.id,"idle")},[A]),k=G.useCallback((U,le)=>{nr.setState(de=>({conversationId:le,messages:[],conversations:[{id:le,createdAt:new Date().toISOString(),preview:""},...de.conversations.filter(ge=>ge.id!==le)]}))},[]),N=G.useCallback((U,le,de)=>{if(U==="_jarvis"){ox.getState().appendChunk(de);return}const ge=nr.getState();ge.streaming||ge.startStreaming(),ge.appendChunk(de)},[]),D=G.useCallback((U,le,de)=>{if(U==="_jarvis"){ox.getState().finalizeMessage(de);return}nr.getState().finishStreaming(de)},[]),H=G.useCallback((U,le)=>{if(U==="_jarvis"){ox.getState().setMode("LISTENING");return}nr.getState().setError(le)},[]),z=G.useCallback((U,le,de)=>{U!=="_jarvis"&&nr.getState().setActivity(`${le}${de?" "+de:""}`)},[]),F=G.useCallback((U,le,de,ge,se)=>{nr.getState().addAgentDm({agentId:de,agentName:ge,content:se})},[]),ee=G.useCallback((U,le,de,ge)=>{ri.getState().appendBubble(U,le,ge)},[]),P=G.useCallback((U,le,de,ge,se)=>{ri.getState().addActivity(U,de,`started "${se}"`),ri.getState().setAgentStatus(U,le,"working")},[]),I=G.useCallback((U,le,de,ge,se)=>{ri.getState().addActivity(U,de,`completed "${se}"`),ri.getState().setAgentStatus(U,le,"idle")},[]),V=G.useCallback((U,le,de,ge)=>{ri.getState().setCheckpoint(U,le,de,ge),ri.getState().setAgentStatus(U,le,"checkpoint")},[]),X=G.useCallback(()=>{ri.getState().clearAllBubbles()},[]),ne=G.useCallback((U,le,de)=>{lo.getState().fetchJobs()},[]),q=G.useCallback((U,le,de,ge)=>{lo.getState().fetchJobs()},[]),Q=G.useCallback((U,le,de,ge,se)=>{lo.getState().fetchJobs()},[]),B=G.useCallback((U,le)=>{lo.getState().updateJobStatus(U,le)},[]),{subscribe:Y,unsubscribe:Z,sendChat:$,newConversation:j,sendCheckpointResponse:K}=uD({onSquadState:C,onSquadInactive:w,onChatConversationCreated:k,onChatChunk:N,onChatActivity:z,onChatDone:D,onChatError:H,onChatAgentDm:F,onAgentOutputChunk:ee,onAgentStepStart:P,onAgentStepComplete:I,onSquadCheckpoint:V,onReconnect:X,onScheduleStarted:ne,onScheduleDone:q,onScheduleError:Q,onScheduleStatusChanged:B});G.useEffect(()=>{bD($)},[$]),G.useEffect(()=>{vD(j)},[j]),G.useEffect(()=>{SD(K)},[K]),G.useEffect(()=>{x().then(()=>{const{squads:U}=Ta.getState();if(U.length>0){const le=ri.getState(),de=U.map(pe=>pe.code),ge=le.rooms,se=[...new Set([...ge,...de])];le.syncRooms(se);for(const pe of U)!le.agentVisuals[pe.code]&&pe.agents&&pe.agents.length>0&&le.setAgents(pe.code,pe.agents.map(Ae=>({id:Ae.id,name:Ae.name,status:"idle"})))}})},[x]);const te=ri(U=>U.rooms);return G.useEffect(()=>{for(const U of te)Y(U);return()=>{for(const U of te)Z(U)}},[te,Y,Z]),G.useEffect(()=>(Y("_expxagents"),()=>Z("_expxagents")),[Y,Z]),G.useEffect(()=>{if(d)return Y("_jarvis"),()=>Z("_jarvis")},[d,Y,Z]),G.useEffect(()=>{e||r()},[]),G.useEffect(()=>{!n&&!e&&s("/login",{state:{from:l.pathname}})},[n,e,s,l.pathname]),d?R.jsx(XS,{}):R.jsxs("div",{className:"noise-bg",style:{display:"flex",flexDirection:"column",height:"100vh",background:"var(--surface-0)",color:"var(--text-primary)"},children:[R.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"var(--header-height)",padding:"0 var(--sp-4)",background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)",position:"relative",zIndex:10},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[R.jsx("div",{style:{width:28,height:28,borderRadius:"var(--radius-sm)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.8rem",fontWeight:700,color:"var(--text-inverse)",boxShadow:"0 0 12px var(--accent-glow-strong)"},children:"EX"}),R.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",letterSpacing:"-0.02em"},children:"ExpxAgents"}),R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"2px 6px",borderRadius:"var(--radius-xs)",letterSpacing:"0.05em"},children:"MISSION CONTROL"})]}),R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-4)"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:[R.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--status-active)",boxShadow:"0 0 8px var(--status-active-glow)",animation:"statusPulse 2s ease-in-out infinite"}}),R.jsx("span",{children:t==null?void 0:t.username})]}),R.jsx("button",{onClick:i,className:"btn-ghost",style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.75rem",padding:"4px 8px",borderRadius:"var(--radius-xs)",transition:"color var(--duration-fast) var(--ease-out)"},onMouseEnter:U=>U.currentTarget.style.color="var(--status-error)",onMouseLeave:U=>U.currentTarget.style.color="var(--text-muted)",children:"Logout"})]})]}),R.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[R.jsxs("aside",{style:{width:"var(--sidebar-width)",background:"var(--surface-1)",borderRight:"1px solid var(--border-subtle)",display:"flex",flexDirection:"column",overflowY:"auto"},children:[!c&&R.jsxs(R.Fragment,{children:[R.jsx(mD,{squads:p,selectedSquad:m,onSelect:v}),R.jsx("div",{style:{height:1,margin:"0 var(--sp-3)",background:"var(--border-subtle)"}})]}),R.jsxs("nav",{style:{padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-1)",flex:1},children:[R.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",padding:"0 var(--sp-2)",marginBottom:"var(--sp-1)"},children:"Navigation"}),HD.map(U=>R.jsxs(SC,{to:U.to,style:({isActive:le})=>({display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:le?600:400,color:le?"var(--accent)":"var(--text-secondary)",background:le?"var(--accent-glow)":"transparent",border:le?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)"}),children:[R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:U.icon}),U.label]},U.to)),R.jsx("div",{style:{height:1,margin:"var(--sp-2) var(--sp-2)",background:"var(--border-subtle)"}}),R.jsxs("a",{href:"/jarvis",target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:500,color:"var(--status-active)",background:"var(--status-active-glow)",border:"1px solid rgba(0, 230, 138, 0.12)",transition:"all var(--duration-fast) var(--ease-out)"},children:[R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:"◉"}),"Jarvis",R.jsx("span",{style:{marginLeft:"auto",fontFamily:"var(--font-mono)",fontSize:"0.55rem",opacity:.6},children:"↗"})]})]}),R.jsxs("div",{style:{padding:"var(--sp-3)",borderTop:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",justifyContent:"space-between"},children:[R.jsxs("span",{children:[p.length," squad",p.length!==1?"s":""]}),R.jsx("span",{children:"v0.1.0"})]})]}),R.jsx("main",{className:"grid-bg",style:{flex:1,overflow:"auto",position:"relative"},children:R.jsx(XS,{})})]}),R.jsx(yD,{state:g})]})}function PD(){var x;const[t,e]=G.useState(""),[n,i]=G.useState(""),r=dl(v=>v.login),s=dl(v=>v.loading),l=dl(v=>v.error),c=dl(v=>v.isAuthenticated),d=q0(),m=((x=xl().state)==null?void 0:x.from)||"/";G.useEffect(()=>{c&&d(m,{replace:!0})},[c,d,m]);const g=v=>{v.preventDefault(),r(t,n)};return R.jsx("div",{className:"noise-bg grid-bg",style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",background:"var(--surface-0)"},children:R.jsxs("div",{style:{animation:"fadeInUp 0.6s var(--ease-out) both",width:360},children:[R.jsxs("div",{style:{textAlign:"center",marginBottom:"var(--sp-8)"},children:[R.jsx("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:"var(--radius-md)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",fontSize:"1.1rem",fontWeight:800,color:"var(--text-inverse)",boxShadow:"var(--shadow-glow-strong)",marginBottom:"var(--sp-4)"},children:"EX"}),R.jsx("h1",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.4rem",color:"var(--text-primary)",letterSpacing:"-0.02em",marginBottom:"var(--sp-1)"},children:"ExpxAgents"}),R.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.15em"},children:"Mission Control"})]}),R.jsxs("form",{onSubmit:g,className:"glass",style:{padding:"var(--sp-6)",borderRadius:"var(--radius-lg)",boxShadow:"var(--shadow-lg)"},children:[l&&R.jsx("div",{style:{padding:"var(--sp-2) var(--sp-3)",marginBottom:"var(--sp-4)",borderRadius:"var(--radius-sm)",background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",fontSize:"0.8rem",fontFamily:"var(--font-mono)"},children:l}),R.jsxs("div",{style:{marginBottom:"var(--sp-3)"},children:[R.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Username"}),R.jsx("input",{type:"text",className:"input",placeholder:"Enter username",value:t,onChange:v=>e(v.target.value),autoFocus:!0})]}),R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Password"}),R.jsx("input",{type:"password",className:"input",placeholder:"Enter password",value:n,onChange:v=>i(v.target.value)})]}),R.jsx("button",{type:"submit",disabled:s,className:"btn btn-accent",style:{width:"100%",padding:"var(--sp-3)",fontSize:"0.85rem",cursor:s?"wait":"pointer",opacity:s?.7:1},children:s?"Authenticating...":"Access Mission Control"})]}),R.jsx("p",{style:{textAlign:"center",marginTop:"var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:"AI Squad Orchestration Platform"})]})})}function AC(t,e,n){if(!t)return;if(n(t)===!0)return t;let i=t.child;for(;i;){const r=AC(i,e,n);if(r)return r;i=i.sibling}}function MC(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const B_=MC(G.createContext(null));let NC=class extends G.Component{render(){return G.createElement(B_.Provider,{value:this._reactInternals},this.props.children)}};function GD(){const t=G.useContext(B_);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=G.useId();return G.useMemo(()=>{for(const n of[t,t==null?void 0:t.alternate]){if(!n)continue;const i=AC(n,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[t,e])}const FD=Symbol.for("react.context"),qD=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===FD;function YD(){const t=GD(),[e]=G.useState(()=>new Map);e.clear();let n=t;for(;n;){const i=n.type;qD(i)&&i!==B_&&!e.has(i)&&e.set(i,G.use(MC(i))),n=n.return}return e}function VD(){const t=YD();return G.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>i=>G.createElement(e,null,G.createElement(n.Provider,{...i,value:t.get(n)})),e=>G.createElement(NC,{...e})),[t])}var Nt=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(Nt||{});const kv=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},Sy=(t,e)=>kv(t).priority??e,si={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(kv).forEach(e=>{e.type.forEach(n=>{var i,r;return(r=(i=this._removeHandlers)[n])==null?void 0:r.call(i,e)})}),this},add(...t){return t.map(kv).forEach(e=>{e.type.forEach(n=>{var s,l;const i=this._addHandlers,r=this._queue;i[n]?(l=i[n])==null||l.call(i,e):(r[n]=r[n]||[],(s=r[n])==null||s.push(e))})}),this},handle(t,e,n){var l;const i=this._addHandlers,r=this._removeHandlers;if(i[t]||r[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,r[t]=n;const s=this._queue;return s[t]&&((l=s[t])==null||l.forEach(c=>e(c)),delete s[t]),this},handleByMap(t,e){return this.handle(t,n=>{n.name&&(e[n.name]=n.ref)},n=>{n.name&&delete e[n.name]})},handleByNamedList(t,e,n=-1){return this.handle(t,i=>{e.findIndex(s=>s.name===i.name)>=0||(e.push({name:i.name,value:i.ref}),e.sort((s,l)=>Sy(l.value,n)-Sy(s.value,n)))},i=>{const r=e.findIndex(s=>s.name===i.name);r!==-1&&e.splice(r,1)})},handleByList(t,e,n=-1){return this.handle(t,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((r,s)=>Sy(s,n)-Sy(r,n)))},i=>{const r=e.indexOf(i.ref);r!==-1&&e.splice(r,1)})},mixin(t,...e){for(const n of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(n))}},XD={extension:{type:Nt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Kd(()=>import("./browserAll-3U5O7dnB.js"),__vite__mapDeps([0,1]))}},KD={extension:{type:Nt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Kd(()=>import("./webworkerAll-CBlDUJVW.js"),[])}};class yr{constructor(e,n,i){this._x=n||0,this._y=i||0,this._observer=e}clone(e){return new yr(e??this._observer,this._x,this._y)}set(e=0,n=e){return(this._x!==e||this._y!==n)&&(this._x=e,this._y=n,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}}var cx={exports:{}},oE;function WD(){return oE||(oE=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function r(d,p,m){this.fn=d,this.context=p,this.once=m||!1}function s(d,p,m,g,x){if(typeof m!="function")throw new TypeError("The listener must be a function");var v=new r(m,g||d,x),E=n?n+p:p;return d._events[E]?d._events[E].fn?d._events[E]=[d._events[E],v]:d._events[E].push(v):(d._events[E]=v,d._eventsCount++),d}function l(d,p){--d._eventsCount===0?d._events=new i:delete d._events[p]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var p=[],m,g;if(this._eventsCount===0)return p;for(g in m=this._events)e.call(m,g)&&p.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},c.prototype.listeners=function(p){var m=n?n+p:p,g=this._events[m];if(!g)return[];if(g.fn)return[g.fn];for(var x=0,v=g.length,E=new Array(v);x<v;x++)E[x]=g[x].fn;return E},c.prototype.listenerCount=function(p){var m=n?n+p:p,g=this._events[m];return g?g.fn?1:g.length:0},c.prototype.emit=function(p,m,g,x,v,E){var A=n?n+p:p;if(!this._events[A])return!1;var C=this._events[A],w=arguments.length,k,N;if(C.fn){switch(C.once&&this.removeListener(p,C.fn,void 0,!0),w){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,m),!0;case 3:return C.fn.call(C.context,m,g),!0;case 4:return C.fn.call(C.context,m,g,x),!0;case 5:return C.fn.call(C.context,m,g,x,v),!0;case 6:return C.fn.call(C.context,m,g,x,v,E),!0}for(N=1,k=new Array(w-1);N<w;N++)k[N-1]=arguments[N];C.fn.apply(C.context,k)}else{var D=C.length,H;for(N=0;N<D;N++)switch(C[N].once&&this.removeListener(p,C[N].fn,void 0,!0),w){case 1:C[N].fn.call(C[N].context);break;case 2:C[N].fn.call(C[N].context,m);break;case 3:C[N].fn.call(C[N].context,m,g);break;case 4:C[N].fn.call(C[N].context,m,g,x);break;default:if(!k)for(H=1,k=new Array(w-1);H<w;H++)k[H-1]=arguments[H];C[N].fn.apply(C[N].context,k)}}return!0},c.prototype.on=function(p,m,g){return s(this,p,m,g,!1)},c.prototype.once=function(p,m,g){return s(this,p,m,g,!0)},c.prototype.removeListener=function(p,m,g,x){var v=n?n+p:p;if(!this._events[v])return this;if(!m)return l(this,v),this;var E=this._events[v];if(E.fn)E.fn===m&&(!x||E.once)&&(!g||E.context===g)&&l(this,v);else{for(var A=0,C=[],w=E.length;A<w;A++)(E[A].fn!==m||x&&!E[A].once||g&&E[A].context!==g)&&C.push(E[A]);C.length?this._events[v]=C.length===1?C[0]:C:l(this,v)}return this},c.prototype.removeAllListeners=function(p){var m;return p?(m=n?n+p:p,this._events[m]&&l(this,m)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,t.exports=c})(cx)),cx.exports}var ZD=WD();const ho=lu(ZD),$D=Math.PI*2,QD=180/Math.PI,JD=Math.PI/180;class Dr{constructor(e=0,n=0){this.x=0,this.y=0,this.x=e,this.y=n}clone(){return new Dr(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,n=e){return this.x=e,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return ux.x=0,ux.y=0,ux}}const ux=new Dr;class jt{constructor(e=1,n=0,i=0,r=1,s=0,l=0){this.array=null,this.a=e,this.b=n,this.c=i,this.d=r,this.tx=s,this.ty=l}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,n,i,r,s,l){return this.a=e,this.b=n,this.c=i,this.d=r,this.tx=s,this.ty=l,this}toArray(e,n){this.array||(this.array=new Float32Array(9));const i=n||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,n){n=n||new Dr;const i=e.x,r=e.y;return n.x=this.a*i+this.c*r+this.tx,n.y=this.b*i+this.d*r+this.ty,n}applyInverse(e,n){n=n||new Dr;const i=this.a,r=this.b,s=this.c,l=this.d,c=this.tx,d=this.ty,p=1/(i*l+s*-r),m=e.x,g=e.y;return n.x=l*p*m+-s*p*g+(d*s-c*l)*p,n.y=i*p*g+-r*p*m+(-d*i+c*r)*p,n}translate(e,n){return this.tx+=e,this.ty+=n,this}scale(e,n){return this.a*=e,this.d*=n,this.c*=e,this.b*=n,this.tx*=e,this.ty*=n,this}rotate(e){const n=Math.cos(e),i=Math.sin(e),r=this.a,s=this.c,l=this.tx;return this.a=r*n-this.b*i,this.b=r*i+this.b*n,this.c=s*n-this.d*i,this.d=s*i+this.d*n,this.tx=l*n-this.ty*i,this.ty=l*i+this.ty*n,this}append(e){const n=this.a,i=this.b,r=this.c,s=this.d;return this.a=e.a*n+e.b*r,this.b=e.a*i+e.b*s,this.c=e.c*n+e.d*r,this.d=e.c*i+e.d*s,this.tx=e.tx*n+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*s+this.ty,this}appendFrom(e,n){const i=e.a,r=e.b,s=e.c,l=e.d,c=e.tx,d=e.ty,p=n.a,m=n.b,g=n.c,x=n.d;return this.a=i*p+r*g,this.b=i*m+r*x,this.c=s*p+l*g,this.d=s*m+l*x,this.tx=c*p+d*g+n.tx,this.ty=c*m+d*x+n.ty,this}setTransform(e,n,i,r,s,l,c,d,p){return this.a=Math.cos(c+p)*s,this.b=Math.sin(c+p)*s,this.c=-Math.sin(c-d)*l,this.d=Math.cos(c-d)*l,this.tx=e-(i*this.a+r*this.c),this.ty=n-(i*this.b+r*this.d),this}prepend(e){const n=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}return this.tx=n*e.a+this.ty*e.c+e.tx,this.ty=n*e.b+this.ty*e.d+e.ty,this}decompose(e){const n=this.a,i=this.b,r=this.c,s=this.d,l=e.pivot,c=-Math.atan2(-r,s),d=Math.atan2(i,n),p=Math.abs(c+d);return p<1e-5||Math.abs($D-p)<1e-5?(e.rotation=d,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=c,e.skew.y=d),e.scale.x=Math.sqrt(n*n+i*i),e.scale.y=Math.sqrt(r*r+s*s),e.position.x=this.tx+(l.x*n+l.y*r),e.position.y=this.ty+(l.x*i+l.y*s),e}invert(){const e=this.a,n=this.b,i=this.c,r=this.d,s=this.tx,l=e*r-n*i;return this.a=r/l,this.b=-n/l,this.c=-i/l,this.d=e/l,this.tx=(i*this.ty-r*s)/l,this.ty=-(e*this.ty-n*s)/l,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new jt;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return t4.identity()}static get shared(){return e4.identity()}}const e4=new jt,t4=new jt,nf=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],rf=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],af=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],sf=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ov=[],RC=[],Ey=Math.sign;function n4(){for(let t=0;t<16;t++){const e=[];Ov.push(e);for(let n=0;n<16;n++){const i=Ey(nf[t]*nf[n]+af[t]*rf[n]),r=Ey(rf[t]*nf[n]+sf[t]*rf[n]),s=Ey(nf[t]*af[n]+af[t]*sf[n]),l=Ey(rf[t]*af[n]+sf[t]*sf[n]);for(let c=0;c<16;c++)if(nf[c]===i&&rf[c]===r&&af[c]===s&&sf[c]===l){e.push(c);break}}}for(let t=0;t<16;t++){const e=new jt;e.set(nf[t],rf[t],af[t],sf[t],0,0),RC.push(e)}}n4();const On={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>nf[t],uY:t=>rf[t],vX:t=>af[t],vY:t=>sf[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>Ov[t][e],sub:(t,e)=>Ov[t][On.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?On.S:On.N:Math.abs(e)*2<=Math.abs(t)?t>0?On.E:On.W:e>0?t>0?On.SE:On.SW:t>0?On.NE:On.NW,matrixAppendRotationInv:(t,e,n=0,i=0,r=0,s=0)=>{const l=RC[On.inv(e)],c=l.a,d=l.b,p=l.c,m=l.d,g=n-Math.min(0,c*r,p*s,c*r+p*s),x=i-Math.min(0,d*r,m*s,d*r+m*s),v=t.a,E=t.b,A=t.c,C=t.d;t.a=c*v+d*A,t.b=c*E+d*C,t.c=p*v+m*A,t.d=p*E+m*C,t.tx=g*v+x*A+t.tx,t.ty=g*E+x*C+t.ty},transformRectCoords:(t,e,n,i)=>{const{x:r,y:s,width:l,height:c}=t,{x:d,y:p,width:m,height:g}=e;return n===On.E?(i.set(r+d,s+p,l,c),i):n===On.S?i.set(m-s-c+d,r+p,c,l):n===On.W?i.set(m-r-l+d,g-s-c+p,l,c):n===On.N?i.set(s+d,g-r-l+p,c,l):i.set(r+d,s+p,l,c)}},wy=[new Dr,new Dr,new Dr,new Dr];class Ei{constructor(e=0,n=0,i=0,r=0){this.type="rectangle",this.x=Number(e),this.y=Number(n),this.width=Number(i),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new Ei(0,0,0,0)}clone(){return new Ei(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(e,n,i,r=.5){const{width:s,height:l}=this;if(s<=0||l<=0)return!1;const c=this.x,d=this.y,p=i*(1-r),m=i-p,g=c-p,x=c+s+p,v=d-p,E=d+l+p,A=c+m,C=c+s-m,w=d+m,k=d+l-m;return e>=g&&e<=x&&n>=v&&n<=E&&!(e>A&&e<C&&n>w&&n<k)}intersects(e,n){if(!n){const ee=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=ee)return!1;const I=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>I}const i=this.left,r=this.right,s=this.top,l=this.bottom;if(r<=i||l<=s)return!1;const c=wy[0].set(e.left,e.top),d=wy[1].set(e.left,e.bottom),p=wy[2].set(e.right,e.top),m=wy[3].set(e.right,e.bottom);if(p.x<=c.x||d.y<=c.y)return!1;const g=Math.sign(n.a*n.d-n.b*n.c);if(g===0||(n.apply(c,c),n.apply(d,d),n.apply(p,p),n.apply(m,m),Math.max(c.x,d.x,p.x,m.x)<=i||Math.min(c.x,d.x,p.x,m.x)>=r||Math.max(c.y,d.y,p.y,m.y)<=s||Math.min(c.y,d.y,p.y,m.y)>=l))return!1;const x=g*(d.y-c.y),v=g*(c.x-d.x),E=x*i+v*s,A=x*r+v*s,C=x*i+v*l,w=x*r+v*l;if(Math.max(E,A,C,w)<=x*c.x+v*c.y||Math.min(E,A,C,w)>=x*m.x+v*m.y)return!1;const k=g*(c.y-p.y),N=g*(p.x-c.x),D=k*i+N*s,H=k*r+N*s,z=k*i+N*l,F=k*r+N*l;return!(Math.max(D,H,z,F)<=k*c.x+N*c.y||Math.min(D,H,z,F)>=k*m.x+N*m.y)}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),s=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(i-n,0),this.y=r,this.height=Math.max(s-r,0),this}ceil(e=1,n=.001){const i=Math.ceil((this.x+this.width-n)*e)/e,r=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=i-this.x,this.height=r-this.y,this}scale(e,n=e){return this.x*=e,this.y*=n,this.width*=e,this.height*=n,this}enlarge(e){const n=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),s=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=i-n,this.y=r,this.height=s-r,this}getBounds(e){return e||(e=new Ei),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const n=e.x,i=e.y,r=e.x+e.width,s=e.y+e.height;return n>=this.x&&n<this.x+this.width&&i>=this.y&&i<this.y+this.height&&r>=this.x&&r<this.x+this.width&&s>=this.y&&s<this.y+this.height}set(e,n,i,r){return this.x=e,this.y=n,this.width=i,this.height=r,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const fx={default:-1};function gi(t="default"){return fx[t]===void 0&&(fx[t]=-1),++fx[t]}const cE=new Set,mi="8.0.0",i4="8.3.4",Gd={quiet:!1,noColor:!1},Qt=((t,e,n=3)=>{if(Gd.quiet||cE.has(e))return;let i=new Error().stack;const r=`${e}
62
- Deprecated since v${t}`,s=typeof console.groupCollapsed=="function"&&!Gd.noColor;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",r):(i=i.split(`
63
- `).splice(n).join(`
64
- `),s?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",r),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",r),console.warn(i))),cE.add(e)});Object.defineProperties(Qt,{quiet:{get:()=>Gd.quiet,set:t=>{Gd.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>Gd.noColor,set:t=>{Gd.noColor=t},enumerable:!0,configurable:!1}});const kC=()=>{};function eh(t){return t+=t===0?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1}function uE(t){return!(t&t-1)&&!!t}function OC(t){const e={};for(const n in t)t[n]!==void 0&&(e[n]=t[n]);return e}const fE=Object.create(null);function r4(t){const e=fE[t];return e===void 0&&(fE[t]=gi("resource")),e}const DC=class zC extends ho{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,e={...zC.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){Qt(mi,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=r4(e),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};DC.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let th=DC;const BC=class LC extends ho{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=gi("textureSource"),this._resourceType="textureSource",this._resourceId=gi("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...LC.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=e.dimensions,this.viewDimension=e.viewDimension??e.dimensions,this.arrayLayerCount=e.arrayLayerCount,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new th(OC(e)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(e){var n,i;this.style!==e&&((n=this._style)==null||n.off("change",this._onStyleChange,this),this._style=e,(i=this._style)==null||i.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){var e,n;this._resourceId=gi("resource"),this.emit("change",this),this.emit("unload",this);for(const i in this._gpuData)(n=(e=this._gpuData[i])==null?void 0:e.destroy)==null||n.call(e);this._gpuData=Object.create(null)}get resourceWidth(){const{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){const{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,n,i){i||(i=this._resolution),e||(e=this.width),n||(n=this.height);const r=Math.round(e*i),s=Math.round(n*i);return this.width=r/i,this.height=s/i,this._resolution=i,this.pixelWidth===r&&this.pixelHeight===s?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=s,this.emit("resize",this),this._resourceId=gi("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=uE(this.pixelWidth)&&uE(this.pixelHeight)}static test(e){throw new Error("Unimplemented")}};BC.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let zs=BC;class L_ extends zs{constructor(e){const n=e.resource||new Float32Array(e.width*e.height*4);let i=e.format;i||(n instanceof Float32Array?i="rgba32float":n instanceof Int32Array||n instanceof Uint32Array?i="rgba32uint":n instanceof Int16Array||n instanceof Uint16Array?i="rgba16uint":(n instanceof Int8Array,i="bgra8unorm")),super({...e,resource:n,format:i}),this.uploadMethodId="buffer"}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}L_.extension=Nt.TextureSource;const dE=new jt;class a4{constructor(e,n){this.mapCoord=new jt,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof n>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=n,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){var n;this.texture!==e&&((n=this._texture)==null||n.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(e,n){n===void 0&&(n=e);const i=this.mapCoord;for(let r=0;r<e.length;r+=2){const s=e[r],l=e[r+1];n[r]=s*i.a+l*i.c+i.tx,n[r+1]=s*i.b+l*i.d+i.ty}return n}update(){const e=this._texture;this._updateID++;const n=e.uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const i=e.orig,r=e.trim;r&&(dE.set(i.width/r.width,0,0,i.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(dE));const s=e.source,l=this.uClampFrame,c=this.clampMargin/s._resolution,d=this.clampOffset/s._resolution;return l[0]=(e.frame.x+c+d)/s.width,l[1]=(e.frame.y+c+d)/s.height,l[2]=(e.frame.x+e.frame.width-c+d)/s.width,l[3]=(e.frame.y+e.frame.height-c+d)/s.height,this.uClampOffset[0]=this.clampOffset/s.pixelWidth,this.uClampOffset[1]=this.clampOffset/s.pixelHeight,this.isSimple=e.frame.width===s.width&&e.frame.height===s.height&&e.rotate===0,!0}}class Tn extends ho{constructor({source:e,label:n,frame:i,orig:r,trim:s,defaultAnchor:l,defaultBorders:c,rotate:d,dynamic:p}={}){if(super(),this.uid=gi("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Ei,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=(e==null?void 0:e.source)??new zs,this.noFrame=!i,i)this.frame.copyFrom(i);else{const{width:m,height:g}=this._source;this.frame.width=m,this.frame.height=g}this.orig=r||this.frame,this.trim=s,this.rotate=d??0,this.defaultAnchor=l,this.defaultBorders=c,this.destroyed=!1,this.dynamic=p||!1,this.updateUvs()}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new a4(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:e,frame:n}=this,{width:i,height:r}=this._source,s=n.x/i,l=n.y/r,c=n.width/i,d=n.height/r;let p=this.rotate;if(p){const m=c/2,g=d/2,x=s+m,v=l+g;p=On.add(p,On.NW),e.x0=x+m*On.uX(p),e.y0=v+g*On.uY(p),p=On.add(p,2),e.x1=x+m*On.uX(p),e.y1=v+g*On.uY(p),p=On.add(p,2),e.x2=x+m*On.uX(p),e.y2=v+g*On.uY(p),p=On.add(p,2),e.x3=x+m*On.uX(p),e.y3=v+g*On.uY(p)}else e.x0=s,e.y0=l,e.x1=s+c,e.y1=l,e.x2=s+c,e.y2=l+d,e.x3=s,e.y3=l+d}destroy(e=!1){this._source&&(this._source.off("resize",this.update,this),e&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return Qt(mi,"Texture.baseTexture is now Texture.source"),this._source}}Tn.EMPTY=new Tn({label:"EMPTY",source:new zs({label:"EMPTY"})});Tn.EMPTY.destroy=kC;Tn.WHITE=new Tn({source:new L_({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});Tn.WHITE.destroy=kC;function UC(t,e,n){const{width:i,height:r}=n.orig,s=n.trim;if(s){const l=s.width,c=s.height;t.minX=s.x-e._x*i,t.maxX=t.minX+l,t.minY=s.y-e._y*r,t.maxY=t.minY+c}else t.minX=-e._x*i,t.maxX=t.minX+i,t.minY=-e._y*r,t.maxY=t.minY+r}const hE=new jt;class Ds{constructor(e=1/0,n=1/0,i=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=hE,this.minX=e,this.minY=n,this.maxX=i,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new Ei);const e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=hE,this}set(e,n,i,r){this.minX=e,this.minY=n,this.maxX=i,this.maxY=r}addFrame(e,n,i,r,s){s||(s=this.matrix);const l=s.a,c=s.b,d=s.c,p=s.d,m=s.tx,g=s.ty;let x=this.minX,v=this.minY,E=this.maxX,A=this.maxY,C=l*e+d*n+m,w=c*e+p*n+g;C<x&&(x=C),w<v&&(v=w),C>E&&(E=C),w>A&&(A=w),C=l*i+d*n+m,w=c*i+p*n+g,C<x&&(x=C),w<v&&(v=w),C>E&&(E=C),w>A&&(A=w),C=l*e+d*r+m,w=c*e+p*r+g,C<x&&(x=C),w<v&&(v=w),C>E&&(E=C),w>A&&(A=w),C=l*i+d*r+m,w=c*i+p*r+g,C<x&&(x=C),w<v&&(v=w),C>E&&(E=C),w>A&&(A=w),this.minX=x,this.minY=v,this.maxX=E,this.maxY=A}addRect(e,n){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,n)}addBounds(e,n){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,n)}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY}applyMatrix(e){const n=this.minX,i=this.minY,r=this.maxX,s=this.maxY,{a:l,b:c,c:d,d:p,tx:m,ty:g}=e;let x=l*n+d*i+m,v=c*n+p*i+g;this.minX=x,this.minY=v,this.maxX=x,this.maxY=v,x=l*r+d*i+m,v=c*r+p*i+g,this.minX=x<this.minX?x:this.minX,this.minY=v<this.minY?v:this.minY,this.maxX=x>this.maxX?x:this.maxX,this.maxY=v>this.maxY?v:this.maxY,x=l*n+d*s+m,v=c*n+p*s+g,this.minX=x<this.minX?x:this.minX,this.minY=v<this.minY?v:this.minY,this.maxX=x>this.maxX?x:this.maxX,this.maxY=v>this.maxY?v:this.maxY,x=l*r+d*s+m,v=c*r+p*s+g,this.minX=x<this.minX?x:this.minX,this.minY=v<this.minY?v:this.minY,this.maxX=x>this.maxX?x:this.maxX,this.maxY=v>this.maxY?v:this.maxY}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,n,i,r){return this.minX<e&&(this.minX=e),this.maxX>n&&(this.maxX=n),this.minY<i&&(this.minY=i),this.maxY>r&&(this.maxY=r),this}pad(e,n=e){return this.minX-=e,this.maxX+=e,this.minY-=n,this.maxY+=n,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new Ds(this.minX,this.minY,this.maxX,this.maxY)}scale(e,n=e){return this.minX*=e,this.minY*=n,this.maxX*=e,this.maxY*=n,this}get x(){return this.minX}set x(e){const n=this.maxX-this.minX;this.minX=e,this.maxX=e+n}get y(){return this.minY}set y(e){const n=this.maxY-this.minY;this.minY=e,this.maxY=e+n}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,n,i,r){let s=this.minX,l=this.minY,c=this.maxX,d=this.maxY;r||(r=this.matrix);const p=r.a,m=r.b,g=r.c,x=r.d,v=r.tx,E=r.ty;for(let A=n;A<i;A+=2){const C=e[A],w=e[A+1],k=p*C+g*w+v,N=m*C+x*w+E;s=k<s?k:s,l=N<l?N:l,c=k>c?k:c,d=N>d?N:d}this.minX=s,this.minY=l,this.maxX=c,this.maxY=d}containsPoint(e,n){return this.minX<=e&&this.minY<=n&&this.maxX>=e&&this.maxY>=n}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}}var s4={grad:.9,turn:360,rad:360/(2*Math.PI)},Xo=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},ir=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n+0},ks=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t>e?t:e},IC=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},pE=function(t){return{r:ks(t.r,0,255),g:ks(t.g,0,255),b:ks(t.b,0,255),a:ks(t.a)}},dx=function(t){return{r:ir(t.r),g:ir(t.g),b:ir(t.b),a:ir(t.a,3)}},l4=/^#([0-9a-f]{3,8})$/i,Ty=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},HC=function(t){var e=t.r,n=t.g,i=t.b,r=t.a,s=Math.max(e,n,i),l=s-Math.min(e,n,i),c=l?s===e?(n-i)/l:s===n?2+(i-e)/l:4+(e-n)/l:0;return{h:60*(c<0?c+6:c),s:s?l/s*100:0,v:s/255*100,a:r}},jC=function(t){var e=t.h,n=t.s,i=t.v,r=t.a;e=e/360*6,n/=100,i/=100;var s=Math.floor(e),l=i*(1-n),c=i*(1-(e-s)*n),d=i*(1-(1-e+s)*n),p=s%6;return{r:255*[i,c,l,l,d,i][p],g:255*[d,i,i,c,l,l][p],b:255*[l,l,d,i,i,c][p],a:r}},mE=function(t){return{h:IC(t.h),s:ks(t.s,0,100),l:ks(t.l,0,100),a:ks(t.a)}},gE=function(t){return{h:ir(t.h),s:ir(t.s),l:ir(t.l),a:ir(t.a,3)}},yE=function(t){return jC((n=(e=t).s,{h:e.h,s:(n*=((i=e.l)<50?i:100-i)/100)>0?2*n/(i+n)*100:0,v:i+n,a:e.a}));var e,n,i},pm=function(t){return{h:(e=HC(t)).h,s:(r=(200-(n=e.s))*(i=e.v)/100)>0&&r<200?n*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:e.a};var e,n,i,r},o4=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,c4=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,u4=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,f4=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Dv={string:[[function(t){var e=l4.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?ir(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?ir(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=u4.exec(t)||f4.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:pE({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=o4.exec(t)||c4.exec(t);if(!e)return null;var n,i,r=mE({h:(n=e[1],i=e[2],i===void 0&&(i="deg"),Number(n)*(s4[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return yE(r)},"hsl"]],object:[[function(t){var e=t.r,n=t.g,i=t.b,r=t.a,s=r===void 0?1:r;return Xo(e)&&Xo(n)&&Xo(i)?pE({r:Number(e),g:Number(n),b:Number(i),a:Number(s)}):null},"rgb"],[function(t){var e=t.h,n=t.s,i=t.l,r=t.a,s=r===void 0?1:r;if(!Xo(e)||!Xo(n)||!Xo(i))return null;var l=mE({h:Number(e),s:Number(n),l:Number(i),a:Number(s)});return yE(l)},"hsl"],[function(t){var e=t.h,n=t.s,i=t.v,r=t.a,s=r===void 0?1:r;if(!Xo(e)||!Xo(n)||!Xo(i))return null;var l=(function(c){return{h:IC(c.h),s:ks(c.s,0,100),v:ks(c.v,0,100),a:ks(c.a)}})({h:Number(e),s:Number(n),v:Number(i),a:Number(s)});return jC(l)},"hsv"]]},bE=function(t,e){for(var n=0;n<e.length;n++){var i=e[n][0](t);if(i)return[i,e[n][1]]}return[null,void 0]},d4=function(t){return typeof t=="string"?bE(t.trim(),Dv.string):typeof t=="object"&&t!==null?bE(t,Dv.object):[null,void 0]},hx=function(t,e){var n=pm(t);return{h:n.h,s:ks(n.s+100*e,0,100),l:n.l,a:n.a}},px=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},xE=function(t,e){var n=pm(t);return{h:n.h,s:n.s,l:ks(n.l+100*e,0,100),a:n.a}},zv=(function(){function t(e){this.parsed=d4(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return ir(px(this.rgba),2)},t.prototype.isDark=function(){return px(this.rgba)<.5},t.prototype.isLight=function(){return px(this.rgba)>=.5},t.prototype.toHex=function(){return e=dx(this.rgba),n=e.r,i=e.g,r=e.b,l=(s=e.a)<1?Ty(ir(255*s)):"","#"+Ty(n)+Ty(i)+Ty(r)+l;var e,n,i,r,s,l},t.prototype.toRgb=function(){return dx(this.rgba)},t.prototype.toRgbString=function(){return e=dx(this.rgba),n=e.r,i=e.g,r=e.b,(s=e.a)<1?"rgba("+n+", "+i+", "+r+", "+s+")":"rgb("+n+", "+i+", "+r+")";var e,n,i,r,s},t.prototype.toHsl=function(){return gE(pm(this.rgba))},t.prototype.toHslString=function(){return e=gE(pm(this.rgba)),n=e.h,i=e.s,r=e.l,(s=e.a)<1?"hsla("+n+", "+i+"%, "+r+"%, "+s+")":"hsl("+n+", "+i+"%, "+r+"%)";var e,n,i,r,s},t.prototype.toHsv=function(){return e=HC(this.rgba),{h:ir(e.h),s:ir(e.s),v:ir(e.v),a:ir(e.a,3)};var e},t.prototype.invert=function(){return io({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),io(hx(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),io(hx(this.rgba,-e))},t.prototype.grayscale=function(){return io(hx(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),io(xE(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),io(xE(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?io({r:(n=this.rgba).r,g:n.g,b:n.b,a:e}):ir(this.rgba.a,3);var n},t.prototype.hue=function(e){var n=pm(this.rgba);return typeof e=="number"?io({h:e,s:n.s,l:n.l,a:n.a}):ir(n.h)},t.prototype.isEqual=function(e){return this.toHex()===io(e).toHex()},t})(),io=function(t){return t instanceof zv?t:new zv(t)},vE=[],h4=function(t){t.forEach(function(e){vE.indexOf(e)<0&&(e(zv,Dv),vE.push(e))})};function p4(t,e){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var r in n)i[n[r]]=r;var s={};t.prototype.toName=function(l){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var c,d,p=i[this.toHex()];if(p)return p;if(l!=null&&l.closest){var m=this.toRgb(),g=1/0,x="black";if(!s.length)for(var v in n)s[v]=new t(n[v]).toRgb();for(var E in n){var A=(c=m,d=s[E],Math.pow(c.r-d.r,2)+Math.pow(c.g-d.g,2)+Math.pow(c.b-d.b,2));A<g&&(g=A,x=E)}return x}},e.string.push([function(l){var c=l.toLowerCase(),d=c==="transparent"?"#0000":n[c];return d?new t(d).toRgb():null},"name"])}h4([p4]);const nh=class lm{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(e){return this.value=e,this}set value(e){if(e instanceof lm)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(e===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,e))&&(this._value=this._cloneSource(e),this._normalize(this._value))}}get value(){return this._value}_cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}_isSourceEqual(e,n){const i=typeof e;if(i!==typeof n)return!1;if(i==="number"||i==="string"||e instanceof Number)return e===n;if(Array.isArray(e)&&Array.isArray(n)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(n))return e.length!==n.length?!1:e.every((s,l)=>s===n[l]);if(e!==null&&n!==null){const s=Object.keys(e),l=Object.keys(n);return s.length!==l.length?!1:s.every(c=>e[c]===n[c])}return e===n}toRgba(){const[e,n,i,r]=this._components;return{r:e,g:n,b:i,a:r}}toRgb(){const[e,n,i]=this._components;return{r:e,g:n,b:i}}toRgbaString(){const[e,n,i]=this.toUint8RgbArray();return`rgba(${e},${n},${i},${this.alpha})`}toUint8RgbArray(e){const[n,i,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb),e[0]=Math.round(n*255),e[1]=Math.round(i*255),e[2]=Math.round(r*255),e}toArray(e){this._arrayRgba||(this._arrayRgba=[]),e||(e=this._arrayRgba);const[n,i,r,s]=this._components;return e[0]=n,e[1]=i,e[2]=r,e[3]=s,e}toRgbArray(e){this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb);const[n,i,r]=this._components;return e[0]=n,e[1]=i,e[2]=r,e}toNumber(){return this._int}toBgrNumber(){const[e,n,i]=this.toUint8RgbArray();return(i<<16)+(n<<8)+e}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[n,i,r,s]=lm._temp.setValue(e)._components;return this._components[0]*=n,this._components[1]*=i,this._components[2]*=r,this._components[3]*=s,this._refreshInt(),this._value=null,this}premultiply(e,n=!0){return n&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,n=!0){if(e===1)return(255<<24)+this._int;if(e===0)return n?0:this._int;let i=this._int>>16&255,r=this._int>>8&255,s=this._int&255;return n&&(i=i*e+.5|0,r=r*e+.5|0,s=s*e+.5|0),(e*255<<24)+(i<<16)+(r<<8)+s}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const n=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-n.length)+n}setAlpha(e){return this._components[3]=this._clamp(e),this._value=null,this}_normalize(e){let n,i,r,s;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const l=e;n=(l>>16&255)/255,i=(l>>8&255)/255,r=(l&255)/255,s=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[n,i,r,s=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[n,i,r,s=255]=e,n/=255,i/=255,r/=255,s/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const c=lm.HEX_PATTERN.exec(e);c&&(e=`#${c[2]}`)}const l=io(e);l.isValid()&&({r:n,g:i,b:r,a:s}=l.rgba,n/=255,i/=255,r/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=i,this._components[2]=r,this._components[3]=s,this._refreshInt();else throw new Error(`Unable to convert color ${e}`)}_refreshInt(){this._clamp(this._components);const[e,n,i]=this._components;this._int=(e*255<<16)+(n*255<<8)+(i*255|0)}_clamp(e,n=0,i=1){return typeof e=="number"?Math.min(Math.max(e,n),i):(e.forEach((r,s)=>{e[s]=Math.min(Math.max(r,n),i)}),e)}static isColorLike(e){return typeof e=="number"||typeof e=="string"||e instanceof Number||e instanceof lm||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e.r!==void 0&&e.g!==void 0&&e.b!==void 0||e.r!==void 0&&e.g!==void 0&&e.b!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0&&e.a!==void 0}};nh.shared=new nh;nh._temp=new nh;nh.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Gi=nh;const m4={cullArea:null,cullable:!1,cullableChildren:!0};let mx=0;const _E=500;function ca(...t){mx!==_E&&(mx++,mx===_E?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}const Fm={_registeredResources:new Set,register(t){this._registeredResources.add(t)},unregister(t){this._registeredResources.delete(t)},release(){this._registeredResources.forEach(t=>t.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(t){return this._registeredResources.has(t)},reset(){this._registeredResources.clear()}};class g4{constructor(e,n){this._pool=[],this._count=0,this._index=0,this._classType=e,n&&this.prepopulate(n)}prepopulate(e){for(let n=0;n<e;n++)this._pool[this._index++]=new this._classType;this._count+=e}get(e){var i;let n;return this._index>0?n=this._pool[--this._index]:(n=new this._classType,this._count++),(i=n.init)==null||i.call(n,e),n}return(e){var n;(n=e.reset)==null||n.call(e),this._pool[this._index++]=e}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let e=0;e<this._index;e++)this._pool[e].destroy();this._pool.length=0,this._count=0,this._index=0}}class y4{constructor(){this._poolsByClass=new Map}prepopulate(e,n){this.getPool(e).prepopulate(n)}get(e,n){return this.getPool(e).get(n)}return(e){this.getPool(e.constructor).return(e)}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new g4(e)),this._poolsByClass.get(e)}stats(){const e={};return this._poolsByClass.forEach(n=>{const i=e[n._classType.name]?n._classType.name+n._classType.ID:n._classType.name;e[i]={free:n.totalFree,used:n.totalUsed,size:n.totalSize}}),e}clear(){this._poolsByClass.forEach(e=>e.clear()),this._poolsByClass.clear()}}const Na=new y4;Fm.register(Na);const b4={get isCachedAsTexture(){var t;return!!((t=this.renderGroup)!=null&&t.isCachedAsTexture)},cacheAsTexture(t){typeof t=="boolean"&&t===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(t===!0?{}:t))},updateCacheTexture(){var t;(t=this.renderGroup)==null||t.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(t){Qt("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(t)}};function x4(t,e,n){const i=t.length;let r;if(e>=i||n===0)return;n=e+n>i?i-e:n;const s=i-n;for(r=e;r<s;++r)t[r]=t[r+n];t.length=s}const v4={allowChildren:!0,removeChildren(t=0,e){var s;const n=e??this.children.length,i=n-t,r=[];if(i>0&&i<=n){for(let c=n-1;c>=t;c--){const d=this.children[c];d&&(r.push(d),d.parent=null)}x4(this.children,t,n);const l=this.renderGroup||this.parentRenderGroup;l&&l.removeChildren(r);for(let c=0;c<r.length;++c){const d=r[c];(s=d.parentRenderLayer)==null||s.detach(d),this.emit("childRemoved",d,this,c),r[c].emit("removed",this)}return r.length>0&&this._didViewChangeTick++,r}else if(i===0&&this.children.length===0)return r;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(t){const e=this.getChildAt(t);return this.removeChild(e)},getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]},setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(t),this.addChildAt(t,e)},getChildIndex(t){const e=this.children.indexOf(t);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(t,e){this.allowChildren||Qt(mi,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:n}=this;if(e<0||e>n.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${n.length}`);const i=t.parent===this;if(t.parent){const s=t.parent.children.indexOf(t);if(i){if(s===e)return t;t.parent.children.splice(s,1)}else t.removeFromParent()}e===n.length?n.push(t):n.splice(e,0,t),t.parent=this,t.didChange=!0,t._updateFlags=15;const r=this.renderGroup||this.parentRenderGroup;return r&&r.addChild(t),this.sortableChildren&&(this.sortDirty=!0),i||(this.emit("childAdded",t,this,e),t.emit("added",this)),t},swapChildren(t,e){if(t===e)return;const n=this.getChildIndex(t),i=this.getChildIndex(e);this.children[n]=e,this.children[i]=t;const r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var t;(t=this.parent)==null||t.removeChild(this)},reparentChild(...t){return t.length===1?this.reparentChildAt(t[0],this.children.length):(t.forEach(e=>this.reparentChildAt(e,this.children.length)),t[0])},reparentChildAt(t,e){if(t.parent===this)return this.setChildIndex(t,e),t;const n=t.worldTransform.clone();t.removeFromParent(),this.addChildAt(t,e);const i=this.worldTransform.clone();return i.invert(),n.prepend(i),t.setFromMatrix(n),t},replaceChild(t,e){t.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(t)),e.setFromMatrix(t.localTransform),e.updateLocalTransform(),this.removeChild(t)}},_4={collectRenderables(t,e,n){this.parentRenderLayer&&this.parentRenderLayer!==n||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(t,e,n):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,t):this.collectRenderablesWithEffects(t,e,n))},collectRenderablesSimple(t,e,n){const i=this.children,r=i.length;for(let s=0;s<r;s++)i[s].collectRenderables(t,e,n)},collectRenderablesWithEffects(t,e,n){const{renderPipes:i}=e;for(let r=0;r<this.effects.length;r++){const s=this.effects[r];i[s.pipe].push(s,this,t)}this.collectRenderablesSimple(t,e,n);for(let r=this.effects.length-1;r>=0;r--){const s=this.effects[r];i[s.pipe].pop(s,this,t)}}};class SE{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null}}class S4{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e})}))}add(e){this._tests.push(e)}getMaskEffect(e){this._initialized||this.init();for(let n=0;n<this._tests.length;n++){const i=this._tests[n];if(i.test(e))return Na.get(i.maskClass,e)}return e}returnMaskEffect(e){Na.return(e)}}const Bv=new S4;si.handleByList(Nt.MaskEffect,Bv._effectClasses);const E4={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const t=this.renderGroup||this.parentRenderGroup;t&&(t.structureDidChange=!0)},addEffect(t){this.effects.indexOf(t)===-1&&(this.effects.push(t),this.effects.sort((n,i)=>n.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(t){const e=this.effects.indexOf(t);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(t){const e=this._maskEffect;(e==null?void 0:e.mask)!==t&&(e&&(this.removeEffect(e),Bv.returnMaskEffect(e),this._maskEffect=null),t!=null&&(this._maskEffect=Bv.getMaskEffect(t),this.addEffect(this._maskEffect)))},get mask(){var t;return(t=this._maskEffect)==null?void 0:t.mask},setMask(t){this._maskOptions={...this._maskOptions,...t},t.mask&&(this.mask=t.mask),this._markStructureAsChanged()},set filters(t){var s;!Array.isArray(t)&&t&&(t=[t]);const e=this._filterEffect||(this._filterEffect=new SE);t=t;const n=(t==null?void 0:t.length)>0,i=((s=e.filters)==null?void 0:s.length)>0,r=n!==i;t=Array.isArray(t)?t.slice(0):t,e.filters=Object.freeze(t),r&&(n?this.addEffect(e):(this.removeEffect(e),e.filters=t??null))},get filters(){var t;return(t=this._filterEffect)==null?void 0:t.filters},set filterArea(t){this._filterEffect||(this._filterEffect=new SE),this._filterEffect.filterArea=t},get filterArea(){var t;return(t=this._filterEffect)==null?void 0:t.filterArea}},w4={label:null,get name(){return Qt(mi,"Container.name property has been removed, use Container.label instead"),this.label},set name(t){Qt(mi,"Container.name property has been removed, use Container.label instead"),this.label=t},getChildByName(t,e=!1){return this.getChildByLabel(t,e)},getChildByLabel(t,e=!1){const n=this.children;for(let i=0;i<n.length;i++){const r=n[i];if(r.label===t||t instanceof RegExp&&t.test(r.label))return r}if(e)for(let i=0;i<n.length;i++){const s=n[i].getChildByLabel(t,!0);if(s)return s}return null},getChildrenByLabel(t,e=!1,n=[]){const i=this.children;for(let r=0;r<i.length;r++){const s=i[r];(s.label===t||t instanceof RegExp&&t.test(s.label))&&n.push(s)}if(e)for(let r=0;r<i.length;r++)i[r].getChildrenByLabel(t,!0,n);return n}},oa=Na.getPool(jt),ec=Na.getPool(Ds),T4=new jt,C4={getFastGlobalBounds(t,e){e||(e=new Ds),e.clear(),this._getGlobalBoundsRecursive(!!t,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);const n=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(n.worldTransform),e},_getGlobalBoundsRecursive(t,e,n){let i=e;if(t&&this.parentRenderLayer&&this.parentRenderLayer!==n||this.localDisplayStatus!==7||!this.measurable)return;const r=!!this.effects.length;if((this.renderGroup||r)&&(i=ec.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const l=this.bounds;i.addFrame(l.minX,l.minY,l.maxX,l.maxY,this.groupTransform)}const s=this.children;for(let l=0;l<s.length;l++)s[l]._getGlobalBoundsRecursive(t,i,n)}if(r){let s=!1;const l=this.renderGroup||this.parentRenderGroup;for(let c=0;c<this.effects.length;c++)this.effects[c].addBounds&&(s||(s=!0,i.applyMatrix(l.worldTransform)),this.effects[c].addBounds(i,!0));s&&i.applyMatrix(l.worldTransform.copyTo(T4).invert()),e.addBounds(i),ec.return(i)}else this.renderGroup&&(e.addBounds(i,this.relativeGroupTransform),ec.return(i))}};function PC(t,e,n){n.clear();let i,r;return t.parent?e?i=t.parent.worldTransform:(r=oa.get().identity(),i=U_(t,r)):i=jt.IDENTITY,GC(t,n,i,e),r&&oa.return(r),n.isValid||n.set(0,0,0,0),n}function GC(t,e,n,i){var c,d;if(!t.visible||!t.measurable)return;let r;i?r=t.worldTransform:(t.updateLocalTransform(),r=oa.get(),r.appendFrom(t.localTransform,n));const s=e,l=!!t.effects.length;if(l&&(e=ec.get().clear()),t.boundsArea)e.addRect(t.boundsArea,r);else{const p=t.bounds;p&&!p.isEmpty()&&(e.matrix=r,e.addBounds(p));for(let m=0;m<t.children.length;m++)GC(t.children[m],e,r,i)}if(l){for(let p=0;p<t.effects.length;p++)(d=(c=t.effects[p]).addBounds)==null||d.call(c,e);s.addBounds(e,jt.IDENTITY),ec.return(e)}i||oa.return(r)}function U_(t,e){const n=t.parent;return n&&(U_(n,e),n.updateLocalTransform(),e.append(n.localTransform)),e}function FC(t,e){if(t===16777215||!e)return e;if(e===16777215||!t)return t;const n=t>>16&255,i=t>>8&255,r=t&255,s=e>>16&255,l=e>>8&255,c=e&255,d=n*s/255|0,p=i*l/255|0,m=r*c/255|0;return(d<<16)+(p<<8)+m}const EE=16777215;function wE(t,e){return t===EE?e:e===EE?t:FC(t,e)}function o0(t){return((t&255)<<16)+(t&65280)+(t>>16&255)}const A4={getGlobalAlpha(t){if(t)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,n=this.parent;for(;n;)e*=n.alpha,n=n.parent;return e},getGlobalTransform(t=new jt,e){if(e)return t.copyFrom(this.worldTransform);this.updateLocalTransform();const n=U_(this,oa.get().identity());return t.appendFrom(this.localTransform,n),oa.return(n),t},getGlobalTint(t){if(t)return this.renderGroup?o0(this.renderGroup.worldColor):this.parentRenderGroup?o0(wE(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,n=this.parent;for(;n;)e=wE(e,n.localColor),n=n.parent;return o0(e)}};function qC(t,e,n){return e.clear(),n||(n=jt.IDENTITY),YC(t,e,n,t,!0),e.isValid||e.set(0,0,0,0),e}function YC(t,e,n,i,r){var d,p;let s;if(r)s=oa.get(),s=n.copyTo(s);else{if(!t.visible||!t.measurable)return;t.updateLocalTransform();const m=t.localTransform;s=oa.get(),s.appendFrom(m,n)}const l=e,c=!!t.effects.length;if(c&&(e=ec.get().clear()),t.boundsArea)e.addRect(t.boundsArea,s);else{t.renderPipeId&&(e.matrix=s,e.addBounds(t.bounds));const m=t.children;for(let g=0;g<m.length;g++)YC(m[g],e,s,i,!1)}if(c){for(let m=0;m<t.effects.length;m++)(p=(d=t.effects[m]).addLocalBounds)==null||p.call(d,e,i);l.addBounds(e,jt.IDENTITY),ec.return(e)}oa.return(s)}function VC(t,e){const n=t.children;for(let i=0;i<n.length;i++){const r=n[i],s=r.uid,l=(r._didViewChangeTick&65535)<<16|r._didContainerChangeTick&65535,c=e.index;(e.data[c]!==s||e.data[c+1]!==l)&&(e.data[e.index]=s,e.data[e.index+1]=l,e.didChange=!0),e.index=c+2,r.children.length&&VC(r,e)}return e.didChange}const M4=new jt,N4={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(t,e){const n=Math.sign(this.scale.x)||1;e!==0?this.scale.x=t/e*n:this.scale.x=n},_setHeight(t,e){const n=Math.sign(this.scale.y)||1;e!==0?this.scale.y=t/e*n:this.scale.y=n},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new Ds});const t=this._localBoundsCacheData;return t.index=1,t.didChange=!1,t.data[0]!==this._didViewChangeTick&&(t.didChange=!0,t.data[0]=this._didViewChangeTick),VC(this,t),t.didChange&&qC(this,t.localBounds,M4),t.localBounds},getBounds(t,e){return PC(this,t,e||new Ds)}},R4={_onRender:null,set onRender(t){const e=this.renderGroup||this.parentRenderGroup;if(!t){this._onRender&&(e==null||e.removeOnRender(this)),this._onRender=null;return}this._onRender||e==null||e.addOnRender(this),this._onRender=t},get onRender(){return this._onRender}},k4={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(O4))}};function O4(t,e){return t._zIndex-e._zIndex}const D4={getGlobalPosition(t=new Dr,e=!1){return this.parent?this.parent.toGlobal(this._position,t,e):(t.x=this._position.x,t.y=this._position.y),t},toGlobal(t,e,n=!1){const i=this.getGlobalTransform(oa.get(),n);return e=i.apply(t,e),oa.return(i),e},toLocal(t,e,n,i){e&&(t=e.toGlobal(t,n,i));const r=this.getGlobalTransform(oa.get(),i);return n=r.applyInverse(t,n),oa.return(r),n}};class I_{constructor(){this.uid=gi("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(e){this.instructions[this.instructionSize++]=e}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let z4=0;class B4{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this.textureStyle=new th(this.textureOptions)}createTexture(e,n,i,r){const s=new zs({...this.textureOptions,width:e,height:n,resolution:1,antialias:i,autoGarbageCollect:!1,autoGenerateMipmaps:r});return new Tn({source:s,label:`texturePool_${z4++}`})}getOptimalTexture(e,n,i=1,r,s=!1){let l=Math.ceil(e*i-1e-6),c=Math.ceil(n*i-1e-6);l=eh(l),c=eh(c);const d=r?1:0,p=s?1:0,m=(l<<17)+(c<<2)+(p<<1)+d;this._texturePool[m]||(this._texturePool[m]=[]);let g=this._texturePool[m].pop();return g||(g=this.createTexture(l,c,r,s)),g.source._resolution=i,g.source.width=l/i,g.source.height=c/i,g.source.pixelWidth=l,g.source.pixelHeight=c,g.frame.x=0,g.frame.y=0,g.frame.width=e,g.frame.height=n,g.updateUvs(),this._poolKeyHash[g.uid]=m,g}getSameSizeTexture(e,n=!1){const i=e.source;return this.getOptimalTexture(e.width,e.height,i._resolution,n)}returnTexture(e,n=!1){const i=this._poolKeyHash[e.uid];n&&(e.source.style=this.textureStyle),this._texturePool[i].push(e)}clear(e){if(e=e!==!1,e)for(const n in this._texturePool){const i=this._texturePool[n];if(i)for(let r=0;r<i.length;r++)i[r].destroy(!0)}this._texturePool={}}}const V0=new B4;Fm.register(V0);class L4{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new jt,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new I_,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=!0;const n=e.children;for(let i=0;i<n.length;i++){const r=n[i];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(V0.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const e=this._parentCacheAsTextureRenderGroup;e&&!e.textureNeedsUpdate&&e.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const e in this.childrenToUpdate){const n=this.childrenToUpdate[e];n.list.fill(null),n.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e)}_removeRenderGroupChild(e){const n=this.renderGroupChildren.indexOf(e);n>-1&&this.renderGroupChildren.splice(n,1),e.renderGroupParent=null}addChild(e){if(this.structureDidChange=!0,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=!0,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);const n=e.children;for(let i=0;i<n.length;i++)this.addChild(n[i])}removeChild(e){if(this.structureDidChange=!0,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}const n=e.children;for(let i=0;i<n.length;i++)this.removeChild(n[i])}removeChildren(e){for(let n=0;n<e.length;n++)this.removeChild(e[n])}onChildUpdate(e){let n=this.childrenToUpdate[e.relativeRenderGroupDepth];n||(n=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),n.list[n.index++]=e}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=!1)}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e)}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1)}runOnRender(e){for(let n=0;n<this._onRenderContainers.length;n++)this._onRenderContainers[n]._onRender(e)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(e=[]){const n=this.root.children;for(let i=0;i<n.length;i++)this._getChildren(n[i],e);return e}_getChildren(e,n=[]){if(n.push(e),e.renderGroup)return n;const i=e.children;for(let r=0;r<i.length;r++)this._getChildren(i[r],n);return n}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new jt),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new jt),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;const e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new jt),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function U4(t,e,n={}){for(const i in e)!n[i]&&e[i]!==void 0&&(t[i]=e[i])}const gx=new yr(null),Cy=new yr(null),yx=new yr(null,1,1),Ay=new yr(null),TE=1,I4=2,bx=4;class br extends ho{constructor(e={}){var n,i;super(),this.uid=gi("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new jt,this.relativeGroupTransform=new jt,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new yr(this,0,0),this._scale=yx,this._pivot=Cy,this._origin=Ay,this._skew=gx,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],U4(this,e,{children:!0,parent:!0,effects:!0}),(n=e.children)==null||n.forEach(r=>this.addChild(r)),(i=e.parent)==null||i.addChild(this)}static mixin(e){Qt("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),si.mixin(br,e)}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||Qt(mi,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let r=0;r<e.length;r++)this.addChild(e[r]);return e[0]}const n=e[0],i=this.renderGroup||this.parentRenderGroup;return n.parent===this?(this.children.splice(this.children.indexOf(n),1),this.children.push(n),i&&(i.structureDidChange=!0),n):(n.parent&&n.parent.removeChild(n),this.children.push(n),this.sortableChildren&&(this.sortDirty=!0),n.parent=this,n.didChange=!0,n._updateFlags=15,i&&i.addChild(n),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this),this._didViewChangeTick++,n._zIndex!==0&&n.depthOfChildModified(),n)}removeChild(...e){if(e.length>1){for(let r=0;r<e.length;r++)this.removeChild(e[r]);return e[0]}const n=e[0],i=this.children.indexOf(n);return i>-1&&(this._didViewChangeTick++,this.children.splice(i,1),this.renderGroup?this.renderGroup.removeChild(n):this.parentRenderGroup&&this.parentRenderGroup.removeChild(n),n.parentRenderLayer&&n.parentRenderLayer.detach(n),n.parent=null,this.emit("childRemoved",n,this,i),n.emit("removed",this)),n}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),this.renderGroup=Na.get(L4,this),this.groupTransform=jt.IDENTITY,e==null||e.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),Na.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e==null||e.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new jt),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e}get y(){return this._position.y}set y(e){this._position.y=e}get position(){return this._position}set position(e){this._position.copyFrom(e)}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew))}get angle(){return this.rotation*QD}set angle(e){this.rotation=e*JD}get pivot(){return this._pivot===Cy&&(this._pivot=new yr(this,0,0)),this._pivot}set pivot(e){this._pivot===Cy&&(this._pivot=new yr(this,0,0),this._origin!==Ay&&ca("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e)}get skew(){return this._skew===gx&&(this._skew=new yr(this,0,0)),this._skew}set skew(e){this._skew===gx&&(this._skew=new yr(this,0,0)),this._skew.copyFrom(e)}get scale(){return this._scale===yx&&(this._scale=new yr(this,1,1)),this._scale}set scale(e){this._scale===yx&&(this._scale=new yr(this,0,0)),typeof e=="string"&&(e=parseFloat(e)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e)}get origin(){return this._origin===Ay&&(this._origin=new yr(this,0,0)),this._origin}set origin(e){this._origin===Ay&&(this._origin=new yr(this,0,0),this._pivot!==Cy&&ca("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._origin.set(e):this._origin.copyFrom(e)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){const n=this.getLocalBounds().width;this._setWidth(e,n)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){const n=this.getLocalBounds().height;this._setHeight(e,n)}getSize(e){e||(e={});const n=this.getLocalBounds();return e.width=Math.abs(this.scale.x*n.width),e.height=Math.abs(this.scale.y*n.height),e}setSize(e,n){const i=this.getLocalBounds();typeof e=="object"?(n=e.height??e.width,e=e.width):n??(n=e),e!==void 0&&this._setWidth(e,i.width),n!==void 0&&this._setHeight(n,i.height)}_updateSkew(){const e=this._rotation,n=this._skew;this._cx=Math.cos(e+n._y),this._sx=Math.sin(e+n._y),this._cy=-Math.sin(e-n._x),this._sy=Math.cos(e-n._x)}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this.origin.set(typeof e.originX=="number"?e.originX:this.origin.x,typeof e.originY=="number"?e.originY:this.origin.y),this}setFromMatrix(e){e.decompose(this)}updateLocalTransform(){const e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;const n=this.localTransform,i=this._scale,r=this._pivot,s=this._origin,l=this._position,c=i._x,d=i._y,p=r._x,m=r._y,g=-s._x,x=-s._y;n.a=this._cx*c,n.b=this._sx*c,n.c=this._cy*d,n.d=this._sy*d,n.tx=l._x-(p*n.a+m*n.c)+(g*n.a+x*n.c)-g,n.ty=l._y-(p*n.b+m*n.d)+(g*n.b+x*n.d)-x}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=TE,this._onUpdate())}get alpha(){return this.localAlpha}set tint(e){const i=Gi.shared.setValue(e??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=TE,this._onUpdate())}get tint(){return o0(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=I4,this.localBlendMode=e,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(e){const n=e?2:0;(this.localDisplayStatus&2)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=bx,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",e))}get culled(){return!(this.localDisplayStatus&4)}set culled(e){const n=e?0:4;(this.localDisplayStatus&4)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=bx,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(e){const n=e?1:0;(this.localDisplayStatus&1)!==n&&(this._updateFlags|=bx,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=!1){var r;if(this.destroyed)return;this.destroyed=!0;let n;if(this.children.length&&(n=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof e=="boolean"?e:e==null?void 0:e.children)&&n)for(let s=0;s<n.length;++s)n[s].destroy(e);(r=this.renderGroup)==null||r.destroy(),this.renderGroup=null}}si.mixin(br,v4,C4,D4,R4,N4,E4,w4,k4,m4,b4,A4,_4);class H_ extends br{constructor(e){super(e),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new Ds(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=e.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(e){this._roundPixels=e?1:0}containsPoint(e){const n=this.bounds,{x:i,y:r}=e;return i>=n.minX&&i<=n.maxX&&r>=n.minY&&r<=n.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(e){this.unload(),super.destroy(e),this._bounds=null}collectRenderablesSimple(e,n,i){const{renderPipes:r}=n;r.blendMode.pushBlendMode(this,this.groupBlendMode,e);const l=r[this.renderPipeId];l!=null&&l.addRenderable&&l.addRenderable(this,e),this.didViewUpdate=!1;const c=this.children,d=c.length;for(let p=0;p<d;p++)c[p].collectRenderables(e,n,i);r.blendMode.popBlendMode(e)}}class ih extends H_{constructor(e=Tn.EMPTY){e instanceof Tn&&(e={texture:e});const{texture:n=Tn.EMPTY,anchor:i,roundPixels:r,width:s,height:l,...c}=e;super({label:"Sprite",...c}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new yr({_onUpdate:()=>{this.onViewUpdate()}}),i?this.anchor=i:n.defaultAnchor&&(this.anchor=n.defaultAnchor),this.texture=n,this.allowChildren=!1,this.roundPixels=r??!1,s!==void 0&&(this.width=s),l!==void 0&&(this.height=l)}static from(e,n=!1){return e instanceof Tn?new ih(e):new ih(Tn.from(e,n))}set texture(e){e||(e=Tn.EMPTY);const n=this._texture;n!==e&&(n&&n.dynamic&&n.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return UC(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return Qt("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const e=this._anchor,n=this._texture,i=this._bounds,{width:r,height:s}=n.orig;i.minX=-e._x*r,i.maxX=i.minX+r,i.minY=-e._y*s,i.maxY=i.minY+s}destroy(e=!1){if(super.destroy(e),typeof e=="boolean"?e:e==null?void 0:e.texture){const i=typeof e=="boolean"?e:e==null?void 0:e.textureSource;this._texture.destroy(i)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,n){typeof e=="object"?(n=e.height??e.width,e=e.width):n??(n=e),e!==void 0&&this._setWidth(e,this._texture.orig.width),n!==void 0&&this._setHeight(n,this._texture.orig.height)}}const H4=new Ds;function XC(t,e,n){const i=H4;t.measurable=!0,PC(t,n,i),e.addBoundsMask(i),t.measurable=!1}function KC(t,e,n){const i=ec.get();t.measurable=!0;const r=oa.get().identity(),s=WC(t,n,r);qC(t,i,s),t.measurable=!1,e.addBoundsMask(i),oa.return(r),ec.return(i)}function WC(t,e,n){return t?(t!==e&&(WC(t.parent,e,n),t.updateLocalTransform(),n.append(t.localTransform)),n):(ca("Mask bounds, renderable is not inside the root container"),n)}class ZC{constructor(e){this.priority=0,this.inverse=!1,this.pipe="alphaMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof ih),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(e,n){this.inverse||XC(this.mask,e,n)}addLocalBounds(e,n){KC(this.mask,e,n)}containsPoint(e,n){const i=this.mask;return n(i,e)}destroy(){this.reset()}static test(e){return e instanceof ih}}ZC.extension=Nt.MaskEffect;class $C{constructor(e){this.priority=0,this.pipe="colorMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e=="number"}}$C.extension=Nt.MaskEffect;class QC{constructor(e){this.priority=0,this.pipe="stencilMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(e,n){XC(this.mask,e,n)}addLocalBounds(e,n){KC(this.mask,e,n)}containsPoint(e,n){const i=this.mask;return n(i,e)}destroy(){this.reset()}static test(e){return e instanceof br}}QC.extension=Nt.MaskEffect;const j4={createCanvas:(t,e)=>{const n=document.createElement("canvas");return n.width=t,n.height=e,n},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")};let CE=j4;const Ja={get(){return CE},set(t){CE=t}};class JC extends zs{constructor(e){e.resource||(e.resource=Ja.get().createCanvas()),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId="image",this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(e=this.width,n=this.height,i=this._resolution){const r=super.resize(e,n,i);return r&&this.resizeCanvas(),r}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}JC.extension=Nt.TextureSource;class b0 extends zs{constructor(e){super(e),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}}b0.extension=Nt.TextureSource;var x0=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(x0||{});class xx{constructor(e,n=null,i=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=e,this._context=n,this.priority=i,this._once=r}match(e,n=null){return this._fn===e&&this._context===n}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));const n=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),n}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const n=this.next;return this.next=e?null:n,this.previous=null,n}}const eA=class Za{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new xx(null,null,1/0),this.deltaMS=1/Za.targetFPMS,this.elapsedMS=1/Za.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,n,i=x0.NORMAL){return this._addListener(new xx(e,n,i))}addOnce(e,n,i=x0.NORMAL){return this._addListener(new xx(e,n,i,!0))}_addListener(e){let n=this._head.next,i=this._head;if(!n)e.connect(i);else{for(;n;){if(e.priority>n.priority){e.connect(i);break}i=n,n=n.next}e.previous||e.connect(i)}return this._startIfPossible(),this}remove(e,n){let i=this._head.next;for(;i;)i.match(e,n)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,n=this._head;for(;n=n.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let n;if(e>this.lastTime){if(n=this.elapsedMS=e-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){const s=e-this._lastFrame|0;if(s<this._minElapsedMS)return;this._lastFrame=e-s%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*Za.targetFPMS;const i=this._head;let r=i.next;for(;r;)r=r.emit(this);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const n=Math.min(Math.max(0,e)/1e3,Za.targetFPMS);this._maxElapsedMS=1/n,this._minElapsedMS&&e>this.maxFPS&&(this.maxFPS=e)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){e===0?this._minElapsedMS=0:(e<this.minFPS&&(this.minFPS=e),this._minElapsedMS=1/(e/1e3))}static get shared(){if(!Za._shared){const e=Za._shared=new Za;e.autoStart=!0,e._protected=!0}return Za._shared}static get system(){if(!Za._system){const e=Za._system=new Za;e.autoStart=!0,e._protected=!0}return Za._system}};eA.targetFPMS=.06;let Fd=eA,vx;async function P4(){return vx??(vx=(async()=>{var l;const e=Ja.get().createCanvas(1,1).getContext("webgl");if(!e)return"premultiply-alpha-on-upload";const n=await new Promise(c=>{const d=document.createElement("video");d.onloadeddata=()=>c(d),d.onerror=()=>c(null),d.autoplay=!1,d.crossOrigin="anonymous",d.preload="auto",d.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",d.load()});if(!n)return"premultiply-alpha-on-upload";const i=e.createTexture();e.bindTexture(e.TEXTURE_2D,i);const r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n);const s=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,s),e.deleteFramebuffer(r),e.deleteTexture(i),(l=e.getExtension("WEBGL_lose_context"))==null||l.loseContext(),s[0]<=s[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),vx}const X0=class tA extends zs{constructor(e){super(e),this.isReady=!1,this.uploadMethodId="video",e={...tA.defaultOptions,...e},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this.alphaMode=e.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),e.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const e=Fd.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const e=this.resource,n=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(n.preload||e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlayThrough),e.addEventListener("error",this._onError,!0)),this.alphaMode=await P4(),this._load=new Promise((i,r)=>{this.isValid?i(this):(this._resolve=i,this._reject=r,n.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${n.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const e=this.resource;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlayThrough),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Fd.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Fd.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Fd.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};X0.extension=Nt.TextureSource;X0.defaultOptions={...zs.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};X0.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let G4=X0;const Ud=(t,e,n=!1)=>(Array.isArray(t)||(t=[t]),e?t.map(i=>typeof i=="string"||n?e(i):i):t);class F4{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const n=this._cache.get(e);return n||ca(`[Assets] Asset id ${e} was not found in the Cache`),n}set(e,n){const i=Ud(e);let r;for(let d=0;d<this.parsers.length;d++){const p=this.parsers[d];if(p.test(n)){r=p.getCacheableAssets(i,n);break}}const s=new Map(Object.entries(r||{}));r||i.forEach(d=>{s.set(d,n)});const l=[...s.keys()],c={cacheKeys:l,keys:i};i.forEach(d=>{this._cacheMap.set(d,c)}),l.forEach(d=>{const p=r?r[d]:n;this._cache.has(d)&&this._cache.get(d)!==p&&ca("[Cache] already has key:",d),this._cache.set(d,s.get(d))})}remove(e){if(!this._cacheMap.has(e)){ca(`[Assets] Asset id ${e} was not found in the Cache`);return}const n=this._cacheMap.get(e);n.cacheKeys.forEach(r=>{this._cache.delete(r)}),n.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const Id=new F4,Lv=[];si.handleByList(Nt.TextureSource,Lv);function nA(t={}){const e=t&&t.resource,n=e?t.resource:t,i=e?t:{resource:t};for(let r=0;r<Lv.length;r++){const s=Lv[r];if(s.test(n))return new s(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}function q4(t={},e=!1){const n=t&&t.resource,i=n?t.resource:t,r=n?t:{resource:t};if(!e&&Id.has(i))return Id.get(i);const s=new Tn({source:nA(r)});return s.on("destroy",()=>{Id.has(i)&&Id.remove(i)}),e||Id.set(i,s),s}function Y4(t,e=!1){return typeof t=="string"?Id.get(t):t instanceof zs?new Tn({source:t}):q4(t,e)}Tn.from=Y4;zs.from=nA;si.add(ZC,$C,QC,G4,b0,JC,L_);var iA=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(iA||{});function ll(t){if(typeof t!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function qp(t){return t.split("?")[0].split("#")[0]}function V4(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function X4(t,e,n){return t.replace(new RegExp(V4(e),"g"),n)}function K4(t,e){let n="",i=0,r=-1,s=0,l=-1;for(let c=0;c<=t.length;++c){if(c<t.length)l=t.charCodeAt(c);else{if(l===47)break;l=47}if(l===47){if(!(r===c-1||s===1))if(r!==c-1&&s===2){if(n.length<2||i!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){const d=n.lastIndexOf("/");if(d!==n.length-1){d===-1?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),r=c,s=0;continue}}else if(n.length===2||n.length===1){n="",i=0,r=c,s=0;continue}}}else n.length>0?n+=`/${t.slice(r+1,c)}`:n=t.slice(r+1,c),i=c-r-1;r=c,s=0}else l===46&&s!==-1?++s:s=-1}return n}const wm={toPosix(t){return X4(t,"\\","/")},isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl(t){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t)},isBlobUrl(t){return t.startsWith("blob:")},hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){ll(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const n=/^[^/:]+:\/{0,2}/.exec(t);return n?n[0]:""},toAbsolute(t,e,n){if(ll(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const i=qp(this.toPosix(e??Ja.get().getBaseUrl())),r=qp(this.toPosix(n??this.rootname(i)));return t=this.toPosix(t),t.startsWith("/")?wm.join(r,t.slice(1)):this.isAbsolute(t)?t:this.join(i,t)},normalize(t){if(ll(t),t.length===0)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;t=this.toPosix(t);let e="";const n=t.startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const i=t.endsWith("/");return t=K4(t),t.length>0&&i&&(t+="/"),n?`/${t}`:e+t},isAbsolute(t){return ll(t),t=this.toPosix(t),this.hasProtocol(t)?!0:t.startsWith("/")},join(...t){if(t.length===0)return".";let e;for(let n=0;n<t.length;++n){const i=t[n];if(ll(i),i.length>0)if(e===void 0)e=i;else{const r=t[n-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?e+=`/../${i}`:e+=`/${i}`}}return e===void 0?".":this.normalize(e)},dirname(t){if(ll(t),t.length===0)return".";t=this.toPosix(t);let e=t.charCodeAt(0);const n=e===47;let i=-1,r=!0;const s=this.getProtocol(t),l=t;t=t.slice(s.length);for(let c=t.length-1;c>=1;--c)if(e=t.charCodeAt(c),e===47){if(!r){i=c;break}}else r=!1;return i===-1?n?"/":this.isUrl(l)?s+t:s:n&&i===1?"//":s+t.slice(0,i)},rootname(t){ll(t),t=this.toPosix(t);let e="";if(t.startsWith("/")?e="/":e=this.getProtocol(t),this.isUrl(t)){const n=t.indexOf("/",e.length);n!==-1?e=t.slice(0,n):e=t,e.endsWith("/")||(e+="/")}return e},basename(t,e){ll(t),e&&ll(e),t=qp(this.toPosix(t));let n=0,i=-1,r=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let l=e.length-1,c=-1;for(s=t.length-1;s>=0;--s){const d=t.charCodeAt(s);if(d===47){if(!r){n=s+1;break}}else c===-1&&(r=!1,c=s+1),l>=0&&(d===e.charCodeAt(l)?--l===-1&&(i=s):(l=-1,i=c))}return n===i?i=c:i===-1&&(i=t.length),t.slice(n,i)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===47){if(!r){n=s+1;break}}else i===-1&&(r=!1,i=s+1);return i===-1?"":t.slice(n,i)},extname(t){ll(t),t=qp(this.toPosix(t));let e=-1,n=0,i=-1,r=!0,s=0;for(let l=t.length-1;l>=0;--l){const c=t.charCodeAt(l);if(c===47){if(!r){n=l+1;break}continue}i===-1&&(r=!1,i=l+1),c===46?e===-1?e=l:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||i===-1||s===0||s===1&&e===i-1&&e===n+1?"":t.slice(e,i)},parse(t){ll(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;t=qp(this.toPosix(t));let n=t.charCodeAt(0);const i=this.isAbsolute(t);let r;e.root=this.rootname(t),i||this.hasProtocol(t)?r=1:r=0;let s=-1,l=0,c=-1,d=!0,p=t.length-1,m=0;for(;p>=r;--p){if(n=t.charCodeAt(p),n===47){if(!d){l=p+1;break}continue}c===-1&&(d=!1,c=p+1),n===46?s===-1?s=p:m!==1&&(m=1):s!==-1&&(m=-1)}return s===-1||c===-1||m===0||m===1&&s===c-1&&s===l+1?c!==-1&&(l===0&&i?e.base=e.name=t.slice(1,c):e.base=e.name=t.slice(l,c)):(l===0&&i?(e.name=t.slice(1,s),e.base=t.slice(1,c)):(e.name=t.slice(l,s),e.base=t.slice(l,c)),e.ext=t.slice(s,c)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]};function rA(t,e,n,i,r){const s=e[n];for(let l=0;l<s.length;l++){const c=s[l];n<e.length-1?rA(t.replace(i[n],c),e,n+1,i,r):r.push(t.replace(i[n],c))}}function W4(t){const e=/\{(.*?)\}/g,n=t.match(e),i=[];if(n){const r=[];n.forEach(s=>{const l=s.substring(1,s.length-1).split(",");r.push(l)}),rA(t,r,0,n,i)}else i.push(t);return i}const AE=t=>!Array.isArray(t);class aA{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,n)=>`${e}${this._bundleIdConnector}${n}`,extractAssetIdFromBundle:(e,n)=>n.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(n=>{this._preferredOrder.push(n),n.priority||(n.priority=Object.keys(n.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e=="string")this._defaultSearchParams=e;else{const n=e;this._defaultSearchParams=Object.keys(n).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(n[i])}`).join("&")}}getAlias(e){const{alias:n,src:i}=e;return Ud(n||i,s=>typeof s=="string"?s:Array.isArray(s)?s.map(l=>(l==null?void 0:l.src)??l):s!=null&&s.src?s.src:s,!0)}removeAlias(e,n){this._assetMap[e]&&(n&&n!==this._resolverHash[e]||(delete this._resolverHash[e],delete this._assetMap[e]))}addManifest(e){this._manifest&&ca("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(n=>{this.addBundle(n.name,n.assets)})}addBundle(e,n){const i=[];let r=n;Array.isArray(n)||(r=Object.entries(n).map(([s,l])=>typeof l=="string"||Array.isArray(l)?{alias:s,src:l}:{alias:s,...l})),r.forEach(s=>{const l=s.src,c=s.alias;let d;if(typeof c=="string"){const p=this._createBundleAssetId(e,c);i.push(p),d=[c,p]}else{const p=c.map(m=>this._createBundleAssetId(e,m));i.push(...p),d=[...c,...p]}this.add({...s,alias:d,src:l})}),this._bundles[e]=i}add(e){const n=[];Array.isArray(e)?n.push(...e):n.push(e);let i;i=s=>{this.hasKey(s)&&ca(`[Resolver] already has key: ${s} overwriting`)},Ud(n).forEach(s=>{const{src:l}=s;let{data:c,format:d,loadParser:p,parser:m}=s;const g=Ud(l).map(A=>typeof A=="string"?W4(A):Array.isArray(A)?A:[A]),x=this.getAlias(s);Array.isArray(x)?x.forEach(i):i(x);const v=[],E=A=>{const C=this._parsers.find(w=>w.test(A));return{src:A,...C==null?void 0:C.parse(A)}};g.forEach(A=>{A.forEach(C=>{let w={};if(typeof C!="object"?w=E(C):(c=C.data??c,d=C.format??d,(C.loadParser||C.parser)&&(p=C.loadParser??p,m=C.parser??m),w={...E(C.src),...C}),!x)throw new Error(`[Resolver] alias is undefined for this asset: ${w.src}`);w=this._buildResolvedAsset(w,{aliases:x,data:c,format:d,loadParser:p,parser:m,progressSize:s.progressSize}),v.push(w)})}),x.forEach(A=>{this._assetMap[A]=v})})}resolveBundle(e){const n=AE(e);e=Ud(e);const i={};return e.forEach(r=>{const s=this._bundles[r];if(s){const l=this.resolve(s),c={};for(const d in l){const p=l[d];c[this._extractAssetIdFromBundle(r,d)]=p}i[r]=c}}),n?i[e[0]]:i}resolveUrl(e){const n=this.resolve(e);if(typeof e!="string"){const i={};for(const r in n)i[r]=n[r].src;return i}return n.src}resolve(e){const n=AE(e);e=Ud(e);const i={};return e.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let s=this._assetMap[r];const l=this._getPreferredOrder(s);l==null||l.priority.forEach(c=>{l.params[c].forEach(d=>{const p=s.filter(m=>m[c]?m[c]===d:!1);p.length&&(s=p)})}),this._resolverHash[r]=s[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});i[r]=this._resolverHash[r]}),n?i[e[0]]:i}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let n=0;n<e.length;n++){const i=e[n],r=this._preferredOrder.find(s=>s.params.format.includes(i.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const n=/\?/.test(e)?"&":"?";return`${e}${n}${this._defaultSearchParams}`}_buildResolvedAsset(e,n){const{aliases:i,data:r,loadParser:s,parser:l,format:c,progressSize:d}=n;return(this._basePath||this._rootPath)&&(e.src=wm.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=i??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=s??e.loadParser,e.parser=l??e.parser,e.format=c??e.format??Z4(e.src),d!==void 0&&(e.progressSize=d),e}}aA.RETINA_PREFIX=/@([0-9\.]+)x/;function Z4(t){return t.split(".").pop().split("?").shift().split("#").shift()}const ME=(t,e)=>{const n=e.split("?")[1];return n&&(t+=`?${n}`),t},sA=class om{constructor(e,n){this.linkedSheets=[];let i=e;(e==null?void 0:e.source)instanceof zs&&(i={texture:e,data:n});const{texture:r,data:s,cachePrefix:l=""}=i;this.cachePrefix=l,this._texture=r instanceof Tn?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=s;const c=parseFloat(s.meta.scale);c?(this.resolution=c,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=om.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(e,n=!1){let i=e;const r=n?1/0:om.BATCH_SIZE;for(;i-e<r&&i<this._frameKeys.length;){const s=this._frameKeys[i],l=this._frames[s],c=l.frame;if(c){let d=null,p=null;const m=l.trimmed!==!1&&l.sourceSize?l.sourceSize:l.frame,g=new Ei(0,0,Math.floor(m.w)/this.resolution,Math.floor(m.h)/this.resolution);l.rotated?d=new Ei(Math.floor(c.x)/this.resolution,Math.floor(c.y)/this.resolution,Math.floor(c.h)/this.resolution,Math.floor(c.w)/this.resolution):d=new Ei(Math.floor(c.x)/this.resolution,Math.floor(c.y)/this.resolution,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution),l.trimmed!==!1&&l.spriteSourceSize&&(p=new Ei(Math.floor(l.spriteSourceSize.x)/this.resolution,Math.floor(l.spriteSourceSize.y)/this.resolution,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution)),this.textures[s]=new Tn({source:this.textureSource,frame:d,orig:g,trim:p,rotate:l.rotated?2:0,defaultAnchor:l.anchor,defaultBorders:l.borders,label:s.toString()})}i++}}_processAnimations(){const e=this.data.animations||{};for(const n in e){this.animations[n]=[];for(let i=0;i<e[n].length;i++){const r=e[n][i];this.animations[n].push(this.textures[r])}}}_parseComplete(){const e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*om.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*om.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){var n;for(const i in this.textures)this.textures[i].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&((n=this._texture)==null||n.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};sA.BATCH_SIZE=1e3;let NE=sA;const $4=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function lA(t,e,n){const i={};if(t.forEach(r=>{i[r]=e}),Object.keys(e.textures).forEach(r=>{i[`${e.cachePrefix}${r}`]=e.textures[r]}),!n){const r=wm.dirname(t[0]);e.linkedSheets.forEach((s,l)=>{const c=lA([`${r}/${e.data.meta.related_multi_packs[l]}`],s,!0);Object.assign(i,c)})}return i}const Q4={extension:Nt.Asset,cache:{test:t=>t instanceof NE,getCacheableAssets:(t,e)=>lA(t,e,!1)},resolver:{extension:{type:Nt.ResolveParser,name:"resolveSpritesheet"},test:t=>{const n=t.split("?")[0].split("."),i=n.pop(),r=n.pop();return i==="json"&&$4.includes(r)},parse:t=>{var n;const e=t.split(".");return{resolution:parseFloat(((n=aA.RETINA_PREFIX.exec(t))==null?void 0:n[1])??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:Nt.LoadParser,priority:iA.Normal,name:"spritesheetLoader"},async testParse(t,e){return wm.extname(e.src).toLowerCase()===".json"&&!!t.frames},async parse(t,e,n){var g,x;const{texture:i,imageFilename:r,textureOptions:s,cachePrefix:l}=(e==null?void 0:e.data)??{};let c=wm.dirname(e.src);c&&c.lastIndexOf("/")!==c.length-1&&(c+="/");let d;if(i instanceof Tn)d=i;else{const v=ME(c+(r??t.meta.image),e.src);d=(await n.load([{src:v,data:s}]))[v]}const p=new NE({texture:d.source,data:t,cachePrefix:l});await p.parse();const m=(g=t==null?void 0:t.meta)==null?void 0:g.related_multi_packs;if(Array.isArray(m)){const v=[];for(const A of m){if(typeof A!="string")continue;let C=c+A;(x=e.data)!=null&&x.ignoreMultiPack||(C=ME(C,e.src),v.push(n.load({src:C,data:{textureOptions:s,ignoreMultiPack:!0}})))}const E=await Promise.all(v);p.linkedSheets=E,E.forEach(A=>{A.linkedSheets=[p].concat(p.linkedSheets.filter(C=>C!==A))})}return p},async unload(t,e,n){await n.unload(t.textureSource._sourceOrigin),t.destroy(!1)}}};si.add(Q4);const _x=Object.create(null),RE=Object.create(null);function j_(t,e){let n=RE[t];return n===void 0&&(_x[e]===void 0&&(_x[e]=1),RE[t]=n=_x[e]++),n}let Nd;function oA(){return(!Nd||Nd!=null&&Nd.isContextLost())&&(Nd=Ja.get().createCanvas().getContext("webgl",{})),Nd}let My;function J4(){if(!My){My="mediump";const t=oA();t&&t.getShaderPrecisionFormat&&(My=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?"highp":"mediump")}return My}function ez(t,e,n){return e?t:n?(t=t.replace("out vec4 finalColor;",""),`
65
-
66
- #ifdef GL_ES // This checks if it is WebGL1
67
- #define in varying
68
- #define finalColor gl_FragColor
69
- #define texture texture2D
70
- #endif
71
- ${t}
72
- `):`
73
-
74
- #ifdef GL_ES // This checks if it is WebGL1
75
- #define in attribute
76
- #define out varying
77
- #endif
78
- ${t}
79
- `}function tz(t,e,n){const i=n?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if(t.substring(0,9)!=="precision"){let r=n?e.requestedFragmentPrecision:e.requestedVertexPrecision;return r==="highp"&&i!=="highp"&&(r="mediump"),`precision ${r} float;
80
- ${t}`}else if(i!=="highp"&&t.substring(0,15)==="precision highp")return t.replace("precision highp","precision mediump");return t}function nz(t,e){return e?`#version 300 es
81
- ${t}`:t}const iz={},rz={};function az(t,{name:e="pixi-program"},n=!0){e=e.replace(/\s+/g,"-"),e+=n?"-fragment":"-vertex";const i=n?iz:rz;return i[e]?(i[e]++,e+=`-${i[e]}`):i[e]=1,t.indexOf("#define SHADER_NAME")!==-1?t:`${`#define SHADER_NAME ${e}`}
82
- ${t}`}function sz(t,e){return e?t.replace("#version 300 es",""):t}const Sx={stripVersion:sz,ensurePrecision:tz,addProgramDefines:ez,setProgramName:az,insertVersion:nz},Yp=Object.create(null),cA=class Uv{constructor(e){e={...Uv.defaultOptions,...e};const n=e.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:J4()},setProgramName:{name:e.name},addProgramDefines:n,insertVersion:n};let r=e.fragment,s=e.vertex;Object.keys(Sx).forEach(l=>{const c=i[l];r=Sx[l](r,c,!0),s=Sx[l](s,c,!1)}),this.fragment=r,this.vertex=s,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=j_(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Yp[this._cacheKey]=null}static from(e){const n=`${e.vertex}:${e.fragment}`;return Yp[n]||(Yp[n]=new Uv(e),Yp[n]._cacheKey=n),Yp[n]}};cA.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let P_=cA;const kE={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function lz(t){return kE[t]??kE.float32}const oz={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},OE=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function DE(t,e){let n;for(;(n=OE.exec(t))!==null;){const i=oz[n[3]]??"float32";e[n[2]]={location:parseInt(n[1],10),format:i,stride:lz(i).stride,offset:0,instance:!1,start:0}}OE.lastIndex=0}function cz(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function uz({source:t,entryPoint:e}){const n={},i=cz(t),r=i.indexOf(`fn ${e}(`);if(r===-1)return n;const s=i.indexOf("->",r);if(s===-1)return n;const l=i.substring(r,s);if(DE(l,n),Object.keys(n).length===0){const c=l.match(/\(\s*\w+\s*:\s*(\w+)/);if(c){const d=c[1],p=new RegExp(`struct\\s+${d}\\s*\\{([^}]+)\\}`,"s"),m=i.match(p);m&&DE(m[1],n)}}return n}function Ex(t){var g,x;const e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,s=/:\s*([\w<>]+)/,l=/struct\s+(\w+)\s*{([^}]+)}/g,c=/(\w+)\s*:\s*([\w\<\>]+)/g,d=/struct\s+(\w+)/,p=(g=t.match(e))==null?void 0:g.map(v=>({group:parseInt(v.match(n)[1],10),binding:parseInt(v.match(i)[1],10),name:v.match(r)[2],isUniform:v.match(r)[1]==="<uniform>",type:v.match(s)[1]}));if(!p)return{groups:[],structs:[]};const m=((x=t.match(l))==null?void 0:x.map(v=>{const E=v.match(d)[1],A=v.match(c).reduce((C,w)=>{const[k,N]=w.split(":");return C[k.trim()]=N.trim(),C},{});return A?{name:E,members:A}:null}).filter(({name:v})=>p.some(E=>E.type===v||E.type.includes(`<${v}>`))))??[];return{groups:p,structs:m}}var lf=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(lf||{});function fz({groups:t}){const e=[];for(let n=0;n<t.length;n++){const i=t[n];e[i.group]||(e[i.group]=[]),i.isUniform?e[i.group].push({binding:i.binding,visibility:lf.VERTEX|lf.FRAGMENT,buffer:{type:"uniform"}}):i.type==="sampler"?e[i.group].push({binding:i.binding,visibility:lf.FRAGMENT,sampler:{type:"filtering"}}):i.type==="texture_2d"||i.type.startsWith("texture_2d<")?e[i.group].push({binding:i.binding,visibility:lf.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):i.type==="texture_2d_array"||i.type.startsWith("texture_2d_array<")?e[i.group].push({binding:i.binding,visibility:lf.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(i.type==="texture_cube"||i.type.startsWith("texture_cube<"))&&e[i.group].push({binding:i.binding,visibility:lf.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let n=0;n<e.length;n++)e[n]||(e[n]=[]);return e}function dz({groups:t}){const e=[];for(let n=0;n<t.length;n++){const i=t[n];e[i.group]||(e[i.group]={}),e[i.group][i.name]=i.binding}return e}function hz(t,e){const n=new Set,i=new Set,r=[...t.structs,...e.structs].filter(l=>n.has(l.name)?!1:(n.add(l.name),!0)),s=[...t.groups,...e.groups].filter(l=>{const c=`${l.name}-${l.binding}`;return i.has(c)?!1:(i.add(c),!0)});return{structs:r,groups:s}}const Vp=Object.create(null);class qm{constructor(e){var c,d;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:i,layout:r,gpuLayout:s,name:l}=e;if(this.name=l,this.fragment=n,this.vertex=i,n.source===i.source){const p=Ex(n.source);this.structsAndGroups=p}else{const p=Ex(i.source),m=Ex(n.source);this.structsAndGroups=hz(p,m)}this.layout=r??dz(this.structsAndGroups),this.gpuLayout=s??fz(this.structsAndGroups),this.autoAssignGlobalUniforms=((c=this.layout[0])==null?void 0:c.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((d=this.layout[1])==null?void 0:d.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:n}=this,i=e.source+n.source+e.entryPoint+n.entryPoint;this._layoutKey=j_(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=uz(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Vp[this._cacheKey]=null}static from(e){const n=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return Vp[n]||(Vp[n]=new qm(e),Vp[n]._cacheKey=n),Vp[n]}}const uA=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],pz=uA.reduce((t,e)=>(t[e]=!0,t),{});function mz(t,e){switch(t){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const fA=class dA{constructor(e,n){this._touched=0,this.uid=gi("uniform"),this._resourceType="uniformGroup",this._resourceId=gi("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...dA.defaultOptions,...n},this.uniformStructures=e;const i={};for(const r in e){const s=e[r];if(s.name=r,s.size=s.size??1,!pz[s.type]){const l=s.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(l){const[,c,d]=l;throw new Error(`Uniform type ${s.type} is not supported. Use type: '${c}', size: ${d} instead.`)}throw new Error(`Uniform type ${s.type} is not supported. Supported uniform types are: ${uA.join(", ")}`)}s.value??(s.value=mz(s.type,s.size)),i[r]=s.value}this.uniforms=i,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=j_(Object.keys(i).map(r=>`${r}-${e[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};fA.defaultOptions={ubo:!1,isStatic:!1};let hA=fA;class c0{constructor(e){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const i in e){const r=e[i];this.setResource(r,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const e=[];let n=0;for(const i in this.resources)e[n++]=this.resources[i]._resourceId;this._key=e.join("|")}setResource(e,n){var r,s;const i=this.resources[n];e!==i&&((r=i==null?void 0:i.off)==null||r.call(i,"change",this.onResourceChange,this),(s=e.on)==null||s.call(e,"change",this.onResourceChange,this),this.resources[n]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e,n){const i=this.resources;for(const r in i)i[r]._gcLastUsed=e,i[r]._touched=n}destroy(){var n;const e=this.resources;for(const i in e){const r=e[i];(n=r==null?void 0:r.off)==null||n.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(e){this._dirty=!0,e.destroyed?this.destroy():this._updateKey()}}var Iv=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(Iv||{});class K0 extends ho{constructor(e){super(),this.uid=gi("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:i,groups:r,resources:s,compatibleRenderers:l,groupMap:c}=e;this.gpuProgram=n,this.glProgram=i,l===void 0&&(l=0,n&&(l|=Iv.WEBGPU),i&&(l|=Iv.WEBGL)),this.compatibleRenderers=l;const d={};if(!s&&!r&&(s={}),s&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&r&&!c)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&r&&c)for(const p in c)for(const m in c[p]){const g=c[p][m];d[g]={group:p,binding:m,name:g}}else if(n&&r&&!c){const p=n.structsAndGroups.groups;c={},p.forEach(m=>{c[m.group]=c[m.group]||{},c[m.group][m.binding]=m.name,d[m.name]=m})}else if(s){r={},c={},n&&n.structsAndGroups.groups.forEach(g=>{c[g.group]=c[g.group]||{},c[g.group][g.binding]=g.name,d[g.name]=g});let p=0;for(const m in s)d[m]||(r[99]||(r[99]=new c0,this._ownedBindGroups.push(r[99])),d[m]={group:99,binding:p,name:m},c[99]=c[99]||{},c[99][p]=m,p++);for(const m in s){const g=m;let x=s[m];!x.source&&!x._resourceType&&(x=new hA(x));const v=d[g];v&&(r[v.group]||(r[v.group]=new c0,this._ownedBindGroups.push(r[v.group])),r[v.group].setResource(x,v.binding))}}this.groups=r,this._uniformBindMap=c,this.resources=this._buildResourceAccessor(r,d)}addResource(e,n,i){var r,s;(r=this._uniformBindMap)[n]||(r[n]={}),(s=this._uniformBindMap[n])[i]||(s[i]=e),this.groups[n]||(this.groups[n]=new c0,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(e,n){const i={};for(const r in n){const s=n[r];Object.defineProperty(i,s.name,{get(){return e[s.group].getResource(s.binding)},set(l){e[s.group].setResource(l,s.binding)}})}return i}destroy(e=!1){var n,i;this._destroyed||(this._destroyed=!0,this.emit("destroy",this),e&&((n=this.gpuProgram)==null||n.destroy(),(i=this.glProgram)==null||i.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(r=>{r.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(e){const{gpu:n,gl:i,...r}=e;let s,l;return n&&(s=qm.from(n)),i&&(l=P_.from(i)),new K0({gpuProgram:s,glProgram:l,...r})}}const gz={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},wx=0,Tx=1,Cx=2,Ax=3,Mx=4,Nx=5,Hv=class pA{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<wx)}set blend(e){!!(this.data&1<<wx)!==e&&(this.data^=1<<wx)}get offsets(){return!!(this.data&1<<Tx)}set offsets(e){!!(this.data&1<<Tx)!==e&&(this.data^=1<<Tx)}set cullMode(e){if(e==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<Cx)}set culling(e){!!(this.data&1<<Cx)!==e&&(this.data^=1<<Cx)}get depthTest(){return!!(this.data&1<<Ax)}set depthTest(e){!!(this.data&1<<Ax)!==e&&(this.data^=1<<Ax)}get depthMask(){return!!(this.data&1<<Nx)}set depthMask(e){!!(this.data&1<<Nx)!==e&&(this.data^=1<<Nx)}get clockwiseFrontFace(){return!!(this.data&1<<Mx)}set clockwiseFrontFace(e){!!(this.data&1<<Mx)!==e&&(this.data^=1<<Mx)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=gz[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new pA;return e.depthTest=!1,e.blend=!0,e}};Hv.default2d=Hv.for2d();let G_=Hv;const mA=class jv extends K0{constructor(e){e={...jv.defaultOptions,...e},super(e),this.enabled=!0,this._state=G_.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1),e.blendRequired&&this.addResource("uBackTexture",0,3)}apply(e,n,i,r){e.applyFilter(this,n,i,r)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:n,gl:i,...r}=e;let s,l;return n&&(s=qm.from(n)),i&&(l=P_.from(i)),new jv({gpuProgram:s,glProgram:l,...r})}};mA.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let Ef=mA;const Pv=[];si.handleByNamedList(Nt.Environment,Pv);async function yz(t){if(!t)for(let e=0;e<Pv.length;e++){const n=Pv[e];if(n.value.test()){await n.value.load();return}}}let Xp;function bz(){if(typeof Xp=="boolean")return Xp;try{Xp=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Xp=!1}return Xp}function zE(t,e,n=2){const i=e&&e.length,r=i?e[0]*n:t.length;let s=gA(t,0,r,n,!0);const l=[];if(!s||s.next===s.prev)return l;let c,d,p;if(i&&(s=Ez(t,e,s,n)),t.length>80*n){c=t[0],d=t[1];let m=c,g=d;for(let x=n;x<r;x+=n){const v=t[x],E=t[x+1];v<c&&(c=v),E<d&&(d=E),v>m&&(m=v),E>g&&(g=E)}p=Math.max(m-c,g-d),p=p!==0?32767/p:0}return Tm(s,l,n,c,d,p,0),l}function gA(t,e,n,i,r){let s;if(r===zz(t,e,n,i)>0)for(let l=e;l<n;l+=i)s=BE(l/i|0,t[l],t[l+1],s);else for(let l=n-i;l>=e;l-=i)s=BE(l/i|0,t[l],t[l+1],s);return s&&rh(s,s.next)&&(Am(s),s=s.next),s}function mf(t,e){if(!t)return t;e||(e=t);let n=t,i;do if(i=!1,!n.steiner&&(rh(n,n.next)||ai(n.prev,n,n.next)===0)){if(Am(n),n=e=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==e);return e}function Tm(t,e,n,i,r,s,l){if(!t)return;!l&&s&&Mz(t,i,r,s);let c=t;for(;t.prev!==t.next;){const d=t.prev,p=t.next;if(s?vz(t,i,r,s):xz(t)){e.push(d.i,t.i,p.i),Am(t),t=p.next,c=p.next;continue}if(t=p,t===c){l?l===1?(t=_z(mf(t),e),Tm(t,e,n,i,r,s,2)):l===2&&Sz(t,e,n,i,r,s):Tm(mf(t),e,n,i,r,s,1);break}}}function xz(t){const e=t.prev,n=t,i=t.next;if(ai(e,n,i)>=0)return!1;const r=e.x,s=n.x,l=i.x,c=e.y,d=n.y,p=i.y,m=Math.min(r,s,l),g=Math.min(c,d,p),x=Math.max(r,s,l),v=Math.max(c,d,p);let E=i.next;for(;E!==e;){if(E.x>=m&&E.x<=x&&E.y>=g&&E.y<=v&&cm(r,c,s,d,l,p,E.x,E.y)&&ai(E.prev,E,E.next)>=0)return!1;E=E.next}return!0}function vz(t,e,n,i){const r=t.prev,s=t,l=t.next;if(ai(r,s,l)>=0)return!1;const c=r.x,d=s.x,p=l.x,m=r.y,g=s.y,x=l.y,v=Math.min(c,d,p),E=Math.min(m,g,x),A=Math.max(c,d,p),C=Math.max(m,g,x),w=Gv(v,E,e,n,i),k=Gv(A,C,e,n,i);let N=t.prevZ,D=t.nextZ;for(;N&&N.z>=w&&D&&D.z<=k;){if(N.x>=v&&N.x<=A&&N.y>=E&&N.y<=C&&N!==r&&N!==l&&cm(c,m,d,g,p,x,N.x,N.y)&&ai(N.prev,N,N.next)>=0||(N=N.prevZ,D.x>=v&&D.x<=A&&D.y>=E&&D.y<=C&&D!==r&&D!==l&&cm(c,m,d,g,p,x,D.x,D.y)&&ai(D.prev,D,D.next)>=0))return!1;D=D.nextZ}for(;N&&N.z>=w;){if(N.x>=v&&N.x<=A&&N.y>=E&&N.y<=C&&N!==r&&N!==l&&cm(c,m,d,g,p,x,N.x,N.y)&&ai(N.prev,N,N.next)>=0)return!1;N=N.prevZ}for(;D&&D.z<=k;){if(D.x>=v&&D.x<=A&&D.y>=E&&D.y<=C&&D!==r&&D!==l&&cm(c,m,d,g,p,x,D.x,D.y)&&ai(D.prev,D,D.next)>=0)return!1;D=D.nextZ}return!0}function _z(t,e){let n=t;do{const i=n.prev,r=n.next.next;!rh(i,r)&&bA(i,n,n.next,r)&&Cm(i,r)&&Cm(r,i)&&(e.push(i.i,n.i,r.i),Am(n),Am(n.next),n=t=r),n=n.next}while(n!==t);return mf(n)}function Sz(t,e,n,i,r,s){let l=t;do{let c=l.next.next;for(;c!==l.prev;){if(l.i!==c.i&&kz(l,c)){let d=xA(l,c);l=mf(l,l.next),d=mf(d,d.next),Tm(l,e,n,i,r,s,0),Tm(d,e,n,i,r,s,0);return}c=c.next}l=l.next}while(l!==t)}function Ez(t,e,n,i){const r=[];for(let s=0,l=e.length;s<l;s++){const c=e[s]*i,d=s<l-1?e[s+1]*i:t.length,p=gA(t,c,d,i,!1);p===p.next&&(p.steiner=!0),r.push(Rz(p))}r.sort(wz);for(let s=0;s<r.length;s++)n=Tz(r[s],n);return n}function wz(t,e){let n=t.x-e.x;if(n===0&&(n=t.y-e.y,n===0)){const i=(t.next.y-t.y)/(t.next.x-t.x),r=(e.next.y-e.y)/(e.next.x-e.x);n=i-r}return n}function Tz(t,e){const n=Cz(t,e);if(!n)return e;const i=xA(n,t);return mf(i,i.next),mf(n,n.next)}function Cz(t,e){let n=e;const i=t.x,r=t.y;let s=-1/0,l;if(rh(t,n))return n;do{if(rh(t,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const g=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(g<=i&&g>s&&(s=g,l=n.x<n.next.x?n:n.next,g===i))return l}n=n.next}while(n!==e);if(!l)return null;const c=l,d=l.x,p=l.y;let m=1/0;n=l;do{if(i>=n.x&&n.x>=d&&i!==n.x&&yA(r<p?i:s,r,d,p,r<p?s:i,r,n.x,n.y)){const g=Math.abs(r-n.y)/(i-n.x);Cm(n,t)&&(g<m||g===m&&(n.x>l.x||n.x===l.x&&Az(l,n)))&&(l=n,m=g)}n=n.next}while(n!==c);return l}function Az(t,e){return ai(t.prev,t,e.prev)<0&&ai(e.next,t,t.next)<0}function Mz(t,e,n,i){let r=t;do r.z===0&&(r.z=Gv(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,Nz(r)}function Nz(t){let e,n=1;do{let i=t,r;t=null;let s=null;for(e=0;i;){e++;let l=i,c=0;for(let p=0;p<n&&(c++,l=l.nextZ,!!l);p++);let d=n;for(;c>0||d>0&&l;)c!==0&&(d===0||!l||i.z<=l.z)?(r=i,i=i.nextZ,c--):(r=l,l=l.nextZ,d--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=l}s.nextZ=null,n*=2}while(e>1);return t}function Gv(t,e,n,i,r){return t=(t-n)*r|0,e=(e-i)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function Rz(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function yA(t,e,n,i,r,s,l,c){return(r-l)*(e-c)>=(t-l)*(s-c)&&(t-l)*(i-c)>=(n-l)*(e-c)&&(n-l)*(s-c)>=(r-l)*(i-c)}function cm(t,e,n,i,r,s,l,c){return!(t===l&&e===c)&&yA(t,e,n,i,r,s,l,c)}function kz(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Oz(t,e)&&(Cm(t,e)&&Cm(e,t)&&Dz(t,e)&&(ai(t.prev,t,e.prev)||ai(t,e.prev,e))||rh(t,e)&&ai(t.prev,t,t.next)>0&&ai(e.prev,e,e.next)>0)}function ai(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function rh(t,e){return t.x===e.x&&t.y===e.y}function bA(t,e,n,i){const r=Ry(ai(t,e,n)),s=Ry(ai(t,e,i)),l=Ry(ai(n,i,t)),c=Ry(ai(n,i,e));return!!(r!==s&&l!==c||r===0&&Ny(t,n,e)||s===0&&Ny(t,i,e)||l===0&&Ny(n,t,i)||c===0&&Ny(n,e,i))}function Ny(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Ry(t){return t>0?1:t<0?-1:0}function Oz(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&bA(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Cm(t,e){return ai(t.prev,t,t.next)<0?ai(t,e,t.next)>=0&&ai(t,t.prev,e)>=0:ai(t,e,t.prev)<0||ai(t,t.next,e)<0}function Dz(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==t);return i}function xA(t,e){const n=Fv(t.i,t.x,t.y),i=Fv(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function BE(t,e,n,i){const r=Fv(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Am(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Fv(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function zz(t,e,n,i){let r=0;for(let s=e,l=n-i;s<n;s+=i)r+=(t[l]-t[s])*(t[s+1]+t[l+1]),l=s;return r}const Bz=zE.default||zE;var vA=(t=>(t[t.NONE=0]="NONE",t[t.COLOR=16384]="COLOR",t[t.STENCIL=1024]="STENCIL",t[t.DEPTH=256]="DEPTH",t[t.COLOR_DEPTH=16640]="COLOR_DEPTH",t[t.COLOR_STENCIL=17408]="COLOR_STENCIL",t[t.DEPTH_STENCIL=1280]="DEPTH_STENCIL",t[t.ALL=17664]="ALL",t))(vA||{});class Lz{constructor(e){this.items=[],this._name=e}emit(e,n,i,r,s,l,c,d){const{name:p,items:m}=this;for(let g=0,x=m.length;g<x;g++)m[g][p](e,n,i,r,s,l,c,d);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){const n=this.items.indexOf(e);return n!==-1&&this.items.splice(n,1),this}contains(e){return this.items.indexOf(e)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const Uz=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],_A=class SA extends ho{constructor(e){super(),this.tick=0,this.uid=gi("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;const n=[...Uz,...this.config.runners??[]];this._addRunners(...n),this._unsafeEvalCheck()}async init(e={}){const n=e.skipExtensionImports===!0?!0:e.manageImports===!1;await yz(n),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const i in this._systemsHash)e={...this._systemsHash[i].constructor.defaultOptions,...e};e={...SA.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let i=0;i<this.runners.init.items.length;i++)await this.runners.init.items[i].init(e);this._initOptions=e}render(e,n){this.tick++;let i=e;if(i instanceof br&&(i={container:i},n&&(Qt(mi,"passing a second argument is deprecated, please use render options instead"),i.target=n.renderTexture)),i.target||(i.target=this.view.renderTarget),i.target===this.view.renderTarget&&(this._lastObjectRendered=i.container,i.clearColor??(i.clearColor=this.background.colorRgba),i.clear??(i.clear=this.background.clearBeforeRender)),i.clearColor){const r=Array.isArray(i.clearColor)&&i.clearColor.length===4;i.clearColor=r?i.clearColor:Gi.shared.setValue(i.clearColor).toArray()}i.transform||(i.container.updateLocalTransform(),i.transform=i.container.localTransform),i.container.visible&&(i.container.enableRenderGroup(),this.runners.prerender.emit(i),this.runners.renderStart.emit(i),this.runners.render.emit(i),this.runners.renderEnd.emit(i),this.runners.postrender.emit(i))}resize(e,n,i){const r=this.view.resolution;this.view.resize(e,n,i),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),i!==void 0&&i!==r&&this.runners.resolutionChange.emit(i)}clear(e={}){const n=this;e.target||(e.target=n.renderTarget.renderTarget),e.clearColor||(e.clearColor=this.background.colorRgba),e.clear??(e.clear=vA.ALL);const{clear:i,clearColor:r,target:s,mipLevel:l,layer:c}=e;Gi.shared.setValue(r??this.background.colorRgba),n.renderTarget.clear(s,i,Gi.shared.toArray(),l??0,c??0)}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...e){e.forEach(n=>{this.runners[n]=new Lz(n)})}_addSystems(e){let n;for(n in e){const i=e[n];this._addSystem(i.value,i.name)}}_addSystem(e,n){const i=new e(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=i,this._systemsHash[n]=i;for(const r in this.runners)this.runners[r].add(i);return this}_addPipes(e,n){const i=n.reduce((r,s)=>(r[s.name]=s.value,r),{});e.forEach(r=>{const s=r.value,l=r.name,c=i[l];this.renderPipes[l]=new s(this,c?new c:null),this.runners.destroy.add(this.renderPipes[l])})}destroy(e=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),(e===!0||typeof e=="object"&&e.releaseGlobalResources)&&Fm.release(),Object.values(this.runners).forEach(n=>{n.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!bz())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};_A.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let EA=_A,ky;function Iz(t){return ky!==void 0||(ky=(()=>{var n;const e={stencil:!0,failIfMajorPerformanceCaveat:t??EA.defaultOptions.failIfMajorPerformanceCaveat};try{if(!Ja.get().getWebGLRenderingContext())return!1;let r=Ja.get().createCanvas().getContext("webgl",e);const s=!!((n=r==null?void 0:r.getContextAttributes())!=null&&n.stencil);if(r){const l=r.getExtension("WEBGL_lose_context");l&&l.loseContext()}return r=null,s}catch{return!1}})()),ky}let Oy;async function Hz(t={}){return Oy!==void 0||(Oy=await(async()=>{const e=Ja.get().getNavigator().gpu;if(!e)return!1;try{return await(await e.requestAdapter(t)).requestDevice(),!0}catch{return!1}})()),Oy}const LE=["webgl","webgpu","canvas"];async function jz(t){let e=[];t.preference?(e.push(t.preference),LE.forEach(s=>{s!==t.preference&&e.push(s)})):e=LE.slice();let n,i={};for(let s=0;s<e.length;s++){const l=e[s];if(l==="webgpu"&&await Hz()){const{WebGPURenderer:c}=await Kd(async()=>{const{WebGPURenderer:d}=await import("./WebGPURenderer-DeKuexG2.js");return{WebGPURenderer:d}},__vite__mapDeps([2,3,4]));n=c,i={...t,...t.webgpu};break}else if(l==="webgl"&&Iz(t.failIfMajorPerformanceCaveat??EA.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:c}=await Kd(async()=>{const{WebGLRenderer:d}=await import("./WebGLRenderer-BKreDG7Z.js");return{WebGLRenderer:d}},__vite__mapDeps([5,3,4]));n=c,i={...t,...t.webgl};break}else if(l==="canvas"){const{CanvasRenderer:c}=await Kd(async()=>{const{CanvasRenderer:d}=await import("./CanvasRenderer-DfAInYD0.js");return{CanvasRenderer:d}},__vite__mapDeps([6,4]));n=c,i={...t,...t.canvasOptions};break}}if(delete i.webgpu,delete i.webgl,delete i.canvasOptions,!n)throw new Error("No available renderer for the current environment");const r=new n;return await r.init(i),r}const wA="8.17.0";class TA{static init(){var e;(e=globalThis.__PIXI_APP_INIT__)==null||e.call(globalThis,this,wA)}static destroy(){}}TA.extension=Nt.Application;class Pz{constructor(e){this._renderer=e}init(){var e;(e=globalThis.__PIXI_RENDERER_INIT__)==null||e.call(globalThis,this._renderer,wA)}destroy(){this._renderer=null}}Pz.extension={type:[Nt.WebGLSystem,Nt.WebGPUSystem],name:"initHook",priority:-10};class CA{static init(e){Object.defineProperty(this,"resizeTo",{configurable:!0,set(n){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=n,n&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let n,i;if(this._resizeTo===globalThis.window)n=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:s}=this._resizeTo;n=r,i=s}this.renderer.resize(n,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}CA.extension=Nt.Application;class AA{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{configurable:!0,set(n){this._ticker&&this._ticker.remove(this.render,this),this._ticker=n,n&&n.add(this.render,this,x0.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Fd.shared:new Fd,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}AA.extension=Nt.Application;si.add(CA);si.add(AA);const MA=class qv{constructor(...e){this.stage=new br,e[0]!==void 0&&Qt(mi,"Application constructor options are deprecated, please use Application.init() instead.")}async init(e){e={...e},this.stage||(this.stage=new br),this.renderer=await jz(e),qv._plugins.forEach(n=>{n.init.call(this,e)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return Qt(mi,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=!1,n=!1){const i=qv._plugins.slice(0);i.reverse(),i.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(e),this.renderer=null}};MA._plugins=[];let F_=MA;si.handleByList(Nt.Application,F_._plugins);si.add(TA);var Rx,UE;function Gz(){if(UE)return Rx;UE=1,Rx=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(s){var l=[];return s.replace(e,function(c,d,p){var m=d.toLowerCase();for(p=r(p),m=="m"&&p.length>2&&(l.push([d].concat(p.splice(0,2))),m="l",d=d=="m"?"l":"L");;){if(p.length==t[m])return p.unshift(d),l.push(p);if(p.length<t[m])throw new Error("malformed path data");l.push([d].concat(p.splice(0,t[m])))}}),l}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function r(s){var l=s.match(i);return l?l.map(Number):[]}return Rx}var Fz=Gz();const qz=lu(Fz);function Yz(t,e){const n=qz(t),i=[];let r=null,s=0,l=0;for(let c=0;c<n.length;c++){const d=n[c],p=d[0],m=d;switch(p){case"M":s=m[1],l=m[2],e.moveTo(s,l);break;case"m":s+=m[1],l+=m[2],e.moveTo(s,l);break;case"H":s=m[1],e.lineTo(s,l);break;case"h":s+=m[1],e.lineTo(s,l);break;case"V":l=m[1],e.lineTo(s,l);break;case"v":l+=m[1],e.lineTo(s,l);break;case"L":s=m[1],l=m[2],e.lineTo(s,l);break;case"l":s+=m[1],l+=m[2],e.lineTo(s,l);break;case"C":s=m[5],l=m[6],e.bezierCurveTo(m[1],m[2],m[3],m[4],s,l);break;case"c":e.bezierCurveTo(s+m[1],l+m[2],s+m[3],l+m[4],s+m[5],l+m[6]),s+=m[5],l+=m[6];break;case"S":s=m[3],l=m[4],e.bezierCurveToShort(m[1],m[2],s,l);break;case"s":e.bezierCurveToShort(s+m[1],l+m[2],s+m[3],l+m[4]),s+=m[3],l+=m[4];break;case"Q":s=m[3],l=m[4],e.quadraticCurveTo(m[1],m[2],s,l);break;case"q":e.quadraticCurveTo(s+m[1],l+m[2],s+m[3],l+m[4]),s+=m[3],l+=m[4];break;case"T":s=m[1],l=m[2],e.quadraticCurveToShort(s,l);break;case"t":s+=m[1],l+=m[2],e.quadraticCurveToShort(s,l);break;case"A":s=m[6],l=m[7],e.arcToSvg(m[1],m[2],m[3],m[4],m[5],s,l);break;case"a":s+=m[6],l+=m[7],e.arcToSvg(m[1],m[2],m[3],m[4],m[5],s,l);break;case"Z":case"z":e.closePath(),i.length>0&&(r=i.pop(),r?(s=r.startX,l=r.startY):(s=0,l=0)),r=null;break;default:ca(`Unknown SVG path command: ${p}`)}p!=="Z"&&p!=="z"&&r===null&&(r={startX:s,startY:l},i.push(r))}return e}class q_{constructor(e=0,n=0,i=0){this.type="circle",this.x=e,this.y=n,this.radius=i}clone(){return new q_(this.x,this.y,this.radius)}contains(e,n){if(this.radius<=0)return!1;const i=this.radius*this.radius;let r=this.x-e,s=this.y-n;return r*=r,s*=s,r+s<=i}strokeContains(e,n,i,r=.5){if(this.radius===0)return!1;const s=this.x-e,l=this.y-n,c=this.radius,d=(1-r)*i,p=Math.sqrt(s*s+l*l);return p<=c+d&&p>c-(i-d)}getBounds(e){return e||(e=new Ei),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Y_{constructor(e=0,n=0,i=0,r=0){this.type="ellipse",this.x=e,this.y=n,this.halfWidth=i,this.halfHeight=r}clone(){return new Y_(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let i=(e-this.x)/this.halfWidth,r=(n-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1}strokeContains(e,n,i,r=.5){const{halfWidth:s,halfHeight:l}=this;if(s<=0||l<=0)return!1;const c=i*(1-r),d=i-c,p=s-d,m=l-d,g=s+c,x=l+c,v=e-this.x,E=n-this.y,A=v*v/(p*p)+E*E/(m*m),C=v*v/(g*g)+E*E/(x*x);return A>1&&C<=1}getBounds(e){return e||(e=new Ei),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function Vz(t,e,n,i,r,s){const l=t-n,c=e-i,d=r-n,p=s-i,m=l*d+c*p,g=d*d+p*p;let x=-1;g!==0&&(x=m/g);let v,E;x<0?(v=n,E=i):x>1?(v=r,E=s):(v=n+x*d,E=i+x*p);const A=t-v,C=e-E;return A*A+C*C}let Xz,Kz;class mm{constructor(...e){this.type="polygon";let n=Array.isArray(e[0])?e[0]:e;if(typeof n[0]!="number"){const i=[];for(let r=0,s=n.length;r<s;r++)i.push(n[r].x,n[r].y);n=i}this.points=n,this.closePath=!0}isClockwise(){let e=0;const n=this.points,i=n.length;for(let r=0;r<i;r+=2){const s=n[r],l=n[r+1],c=n[(r+2)%i],d=n[(r+3)%i];e+=(c-s)*(d+l)}return e<0}containsPolygon(e){const n=this.getBounds(Xz),i=e.getBounds(Kz);if(!n.containsRect(i))return!1;const r=e.points;for(let s=0;s<r.length;s+=2){const l=r[s],c=r[s+1];if(!this.contains(l,c))return!1}return!0}clone(){const e=this.points.slice(),n=new mm(e);return n.closePath=this.closePath,n}contains(e,n){let i=!1;const r=this.points.length/2;for(let s=0,l=r-1;s<r;l=s++){const c=this.points[s*2],d=this.points[s*2+1],p=this.points[l*2],m=this.points[l*2+1];d>n!=m>n&&e<(p-c)*((n-d)/(m-d))+c&&(i=!i)}return i}strokeContains(e,n,i,r=.5){const s=i*i,l=s*(1-r),c=s-l,{points:d}=this,p=d.length-(this.closePath?0:2);for(let m=0;m<p;m+=2){const g=d[m],x=d[m+1],v=d[(m+2)%d.length],E=d[(m+3)%d.length],A=Vz(e,n,g,x,v,E),C=Math.sign((v-g)*(n-x)-(E-x)*(e-g));if(A<=(C<0?c:l))return!0}return!1}getBounds(e){e||(e=new Ei);const n=this.points;let i=1/0,r=-1/0,s=1/0,l=-1/0;for(let c=0,d=n.length;c<d;c+=2){const p=n[c],m=n[c+1];i=p<i?p:i,r=p>r?p:r,s=m<s?m:s,l=m>l?m:l}return e.x=i,e.width=r-i,e.y=s,e.height=l-s,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,n)=>`${e}, ${n}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return Qt("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return Qt("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const Dy=(t,e,n,i,r,s,l)=>{const c=t-n,d=e-i,p=Math.sqrt(c*c+d*d);return p>=r-s&&p<=r+l};class V_{constructor(e=0,n=0,i=0,r=0,s=20){this.type="roundedRectangle",this.x=e,this.y=n,this.width=i,this.height=r,this.radius=s}getBounds(e){return e||(e=new Ei),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new V_(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&n>=this.y&&n<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+i&&n<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;let r=e-(this.x+i),s=n-(this.y+i);const l=i*i;if(r*r+s*s<=l||(r=e-(this.x+this.width-i),r*r+s*s<=l)||(s=n-(this.y+this.height-i),r*r+s*s<=l)||(r=e-(this.x+i),r*r+s*s<=l))return!0}return!1}strokeContains(e,n,i,r=.5){const{x:s,y:l,width:c,height:d,radius:p}=this,m=i*(1-r),g=i-m,x=s+p,v=l+p,E=c-p*2,A=d-p*2,C=s+c,w=l+d;return(e>=s-m&&e<=s+g||e>=C-g&&e<=C+m)&&n>=v&&n<=v+A||(n>=l-m&&n<=l+g||n>=w-g&&n<=w+m)&&e>=x&&e<=x+E?!0:e<x&&n<v&&Dy(e,n,x,v,p,g,m)||e>C-p&&n<v&&Dy(e,n,C-p,v,p,g,m)||e>C-p&&n>w-p&&Dy(e,n,C-p,w-p,p,g,m)||e<x&&n>w-p&&Dy(e,n,x,w-p,p,g,m)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const NA={};function Wz(t,e,n){let i=2166136261;for(let r=0;r<e;r++)i^=t[r].uid,i=Math.imul(i,16777619),i>>>=0;return NA[i]||Zz(t,e,i,n)}function Zz(t,e,n,i){const r={};let s=0;for(let c=0;c<i;c++){const d=c<e?t[c]:Tn.EMPTY.source;r[s++]=d.source,r[s++]=d.style}const l=new c0(r);return NA[n]=l,l}class IE{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}function HE(t,e,n,i){if(n??(n=0),i??(i=Math.min(t.byteLength-n,e.byteLength)),!(n&7)&&!(i&7)){const r=i/8;new Float64Array(e,0,r).set(new Float64Array(t,n,r))}else if(!(n&3)&&!(i&3)){const r=i/4;new Float32Array(e,0,r).set(new Float32Array(t,n,r))}else new Uint8Array(e).set(new Uint8Array(t,n,i))}const $z={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var Qz=(t=>(t[t.DISABLED=0]="DISABLED",t[t.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",t[t.MASK_ACTIVE=2]="MASK_ACTIVE",t[t.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",t[t.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",t[t.NONE=5]="NONE",t))(Qz||{});function jE(t,e){return e.alphaMode==="no-premultiply-alpha"&&$z[t]||t}const Jz=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
83
- `);function e5(t){let e="";for(let n=0;n<t;++n)n>0&&(e+=`
84
- else `),n<t-1&&(e+=`if(test == ${n}.0){}`);return e}function t5(t,e){if(t===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const n=e.createShader(e.FRAGMENT_SHADER);try{for(;;){const i=Jz.replace(/%forloop%/gi,e5(t));if(e.shaderSource(n,i),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))t=t/2|0;else break}}finally{e.deleteShader(n)}return t}let Rd=null;function n5(){var e;if(Rd)return Rd;const t=oA();return Rd=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),Rd=t5(Rd,t),(e=t.getExtension("WEBGL_lose_context"))==null||e.loseContext(),Rd}class i5{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let e=0;e<this.count;e++){const n=this.textures[e];this.textures[e]=null,this.ids[n.uid]=null}this.count=0}}class r5{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new i5,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}}const gm=[];let v0=0;Fm.register({clear:()=>{if(gm.length>0)for(const t of gm)t&&t.destroy();gm.length=0,v0=0}});function PE(){return v0>0?gm[--v0]:new r5}function GE(t){t.elements=null,gm[v0++]=t}let Kp=0;const RA=class kA{constructor(e){this.uid=gi("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],e={...kA.defaultOptions,...e},e.maxTextures||(Qt("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=n5());const{maxTextures:n,attributesInitialSize:i,indicesInitialSize:r}=e;this.attributeBuffer=new IE(i*4),this.indexBuffer=new Uint16Array(r),this.maxTextures=n}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let e=0;e<this.batchIndex;e++)GE(this.batches[e]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(e){this._elements[this.elementSize++]=e,e._indexStart=this.indexSize,e._attributeStart=this.attributeSize,e._batcher=this,this.indexSize+=e.indexSize,this.attributeSize+=e.attributeSize*this.vertexSize}checkAndUpdateTexture(e,n){const i=e._batch.textures.ids[n._source.uid];return!i&&i!==0?!1:(e._textureId=i,e.texture=n,!0)}updateElement(e){this.dirty=!0;const n=this.attributeBuffer;e.packAsQuad?this.packQuadAttributes(e,n.float32View,n.uint32View,e._attributeStart,e._textureId):this.packAttributes(e,n.float32View,n.uint32View,e._attributeStart,e._textureId)}break(e){const n=this._elements;if(!n[this.elementStart])return;let i=PE(),r=i.textures;r.clear();const s=n[this.elementStart];let l=jE(s.blendMode,s.texture._source),c=s.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const d=this.attributeBuffer.float32View,p=this.attributeBuffer.uint32View,m=this.indexBuffer;let g=this._batchIndexSize,x=this._batchIndexStart,v="startBatch",E=[];const A=this.maxTextures;for(let C=this.elementStart;C<this.elementSize;++C){const w=n[C];n[C]=null;const N=w.texture._source,D=jE(w.blendMode,N),H=l!==D||c!==w.topology;if(N._batchTick===Kp&&!H){w._textureId=N._textureBindLocation,g+=w.indexSize,w.packAsQuad?(this.packQuadAttributes(w,d,p,w._attributeStart,w._textureId),this.packQuadIndex(m,w._indexStart,w._attributeStart/this.vertexSize)):(this.packAttributes(w,d,p,w._attributeStart,w._textureId),this.packIndex(w,m,w._indexStart,w._attributeStart/this.vertexSize)),w._batch=i,E.push(w);continue}N._batchTick=Kp,(r.count>=A||H)&&(this._finishBatch(i,x,g-x,r,l,c,e,v,E),v="renderBatch",x=g,l=D,c=w.topology,i=PE(),r=i.textures,r.clear(),E=[],++Kp),w._textureId=N._textureBindLocation=r.count,r.ids[N.uid]=r.count,r.textures[r.count++]=N,w._batch=i,E.push(w),g+=w.indexSize,w.packAsQuad?(this.packQuadAttributes(w,d,p,w._attributeStart,w._textureId),this.packQuadIndex(m,w._indexStart,w._attributeStart/this.vertexSize)):(this.packAttributes(w,d,p,w._attributeStart,w._textureId),this.packIndex(w,m,w._indexStart,w._attributeStart/this.vertexSize))}r.count>0&&(this._finishBatch(i,x,g-x,r,l,c,e,v,E),x=g,++Kp),this.elementStart=this.elementSize,this._batchIndexStart=x,this._batchIndexSize=g}_finishBatch(e,n,i,r,s,l,c,d,p){e.gpuBindGroup=null,e.bindGroup=null,e.action=d,e.batcher=this,e.textures=r,e.blendMode=s,e.topology=l,e.start=n,e.size=i,e.elements=p,++Kp,this.batches[this.batchIndex++]=e,c.add(e)}finish(e){this.break(e)}ensureAttributeBuffer(e){e*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(e*4)}ensureIndexBuffer(e){e<=this.indexBuffer.length||this._resizeIndexBuffer(e)}_resizeAttributeBuffer(e){const n=Math.max(e,this.attributeBuffer.size*2),i=new IE(n);HE(this.attributeBuffer.rawBinaryData,i.rawBinaryData),this.attributeBuffer=i}_resizeIndexBuffer(e){const n=this.indexBuffer;let i=Math.max(e,n.length*1.5);i+=i%2;const r=i>65535?new Uint32Array(i):new Uint16Array(i);if(r.BYTES_PER_ELEMENT!==n.BYTES_PER_ELEMENT)for(let s=0;s<n.length;s++)r[s]=n[s];else HE(n.buffer,r.buffer);this.indexBuffer=r}packQuadIndex(e,n,i){e[n]=i+0,e[n+1]=i+1,e[n+2]=i+2,e[n+3]=i+0,e[n+4]=i+2,e[n+5]=i+3}packIndex(e,n,i,r){const s=e.indices,l=e.indexSize,c=e.indexOffset,d=e.attributeOffset;for(let p=0;p<l;p++)n[i++]=r+s[p+c]-d}destroy(e={}){var n;if(this.batches!==null){for(let i=0;i<this.batchIndex;i++)GE(this.batches[i]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,e.shader&&((n=this.shader)==null||n.destroy(),this.shader=null);for(let i=0;i<this._elements.length;i++)this._elements[i]&&(this._elements[i]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};RA.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let a5=RA;var Ca=(t=>(t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE",t[t.STATIC=1024]="STATIC",t))(Ca||{});class Mm extends ho{constructor(e){let{data:n,size:i}=e;const{usage:r,label:s,shrinkToFit:l}=e;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=gi("buffer"),this._resourceType="buffer",this._resourceId=gi("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,n instanceof Array&&(n=new Float32Array(n)),this._data=n,i??(i=n==null?void 0:n.byteLength);const c=!!n;this.descriptor={size:i,usage:r,mappedAtCreation:c,label:s},this.shrinkToFit=l??!0}get data(){return this._data}set data(e){this.setDataWithSize(e,e.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&Ca.STATIC)}set static(e){e?this.descriptor.usage|=Ca.STATIC:this.descriptor.usage&=~Ca.STATIC}setDataWithSize(e,n,i){if(this._updateID++,this._updateSize=n*e.BYTES_PER_ELEMENT,this._data===e){i&&this.emit("update",this);return}const r=this._data;if(this._data=e,this._dataInt32=null,!r||r.length!==e.length){!this.shrinkToFit&&r&&e.byteLength<r.byteLength?i&&this.emit("update",this):(this.descriptor.size=e.byteLength,this._resourceId=gi("resource"),this.emit("change",this));return}i&&this.emit("update",this)}update(e){this._updateSize=e??this._updateSize,this._updateID++,this.emit("update",this)}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}function OA(t,e){if(!(t instanceof Mm)){let n=e?Ca.INDEX:Ca.VERTEX;t instanceof Array&&(e?(t=new Uint32Array(t),n=Ca.INDEX|Ca.COPY_DST):(t=new Float32Array(t),n=Ca.VERTEX|Ca.COPY_DST)),t=new Mm({data:t,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:n})}return t}function s5(t,e,n){const i=t.getAttribute(e);if(!i)return n.minX=0,n.minY=0,n.maxX=0,n.maxY=0,n;const r=i.buffer.data;let s=1/0,l=1/0,c=-1/0,d=-1/0;const p=r.BYTES_PER_ELEMENT,m=(i.offset||0)/p,g=(i.stride||8)/p;for(let x=m;x<r.length;x+=g){const v=r[x],E=r[x+1];v>c&&(c=v),E>d&&(d=E),v<s&&(s=v),E<l&&(l=E)}return n.minX=s,n.minY=l,n.maxX=c,n.maxY=d,n}function l5(t){return(t instanceof Mm||Array.isArray(t)||t.BYTES_PER_ELEMENT)&&(t={buffer:t}),t.buffer=OA(t.buffer,!1),t}class o5 extends ho{constructor(e={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=gi("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new Ds,this._boundsDirty=!0;const{attributes:n,indexBuffer:i,topology:r}=e;if(this.buffers=[],this.attributes={},n)for(const s in n)this.addAttribute(s,n[s]);this.instanceCount=e.instanceCount??1,i&&this.addIndex(i),this.topology=r||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(e){return this.attributes[e]}getIndex(){return this.indexBuffer}getBuffer(e){return this.getAttribute(e).buffer}getSize(){for(const e in this.attributes){const n=this.attributes[e];return n.buffer.data.length/(n.stride/4||n.size)}return 0}addAttribute(e,n){const i=l5(n);this.buffers.indexOf(i.buffer)===-1&&(this.buffers.push(i.buffer),i.buffer.on("update",this.onBufferUpdate,this),i.buffer.on("change",this.onBufferUpdate,this)),this.attributes[e]=i}addIndex(e){this.indexBuffer=OA(e,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,s5(this,"aPosition",this._bounds)):this._bounds}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null)}destroy(e=!1){var n;this.emit("destroy",this),this.removeAllListeners(),e&&this.buffers.forEach(i=>i.destroy()),this.unload(),(n=this.indexBuffer)==null||n.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const c5=new Float32Array(1),u5=new Uint32Array(1);class f5 extends o5{constructor(){const n=new Mm({data:c5,label:"attribute-batch-buffer",usage:Ca.VERTEX|Ca.COPY_DST,shrinkToFit:!1}),i=new Mm({data:u5,label:"index-batch-buffer",usage:Ca.INDEX|Ca.COPY_DST,shrinkToFit:!1}),r=24;super({attributes:{aPosition:{buffer:n,format:"float32x2",stride:r,offset:0},aUV:{buffer:n,format:"float32x2",stride:r,offset:8},aColor:{buffer:n,format:"unorm8x4",stride:r,offset:16},aTextureIdAndRound:{buffer:n,format:"uint16x2",stride:r,offset:20}},indexBuffer:i})}}function FE(t,e,n){if(t)for(const i in t){const r=i.toLocaleLowerCase(),s=e[r];if(s){let l=t[i];i==="header"&&(l=l.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),n&&s.push(`//----${n}----//`),s.push(l)}else ca(`${i} placement hook does not exist in shader`)}}const d5=/\{\{(.*?)\}\}/g;function qE(t){var i;const e={};return(((i=t.match(d5))==null?void 0:i.map(r=>r.replace(/[{()}]/g,"")))??[]).forEach(r=>{e[r]=[]}),e}function YE(t,e){let n;const i=/@in\s+([^;]+);/g;for(;(n=i.exec(t))!==null;)e.push(n[1])}function VE(t,e,n=!1){const i=[];YE(e,i),t.forEach(c=>{c.header&&YE(c.header,i)});const r=i;n&&r.sort();const s=r.map((c,d)=>` @location(${d}) ${c},`).join(`
85
- `);let l=e.replace(/@in\s+[^;]+;\s*/g,"");return l=l.replace("{{in}}",`
86
- ${s}
87
- `),l}function XE(t,e){let n;const i=/@out\s+([^;]+);/g;for(;(n=i.exec(t))!==null;)e.push(n[1])}function h5(t){const n=/\b(\w+)\s*:/g.exec(t);return n?n[1]:""}function p5(t){const e=/@.*?\s+/g;return t.replace(e,"")}function m5(t,e){const n=[];XE(e,n),t.forEach(d=>{d.header&&XE(d.header,n)});let i=0;const r=n.sort().map(d=>d.indexOf("builtin")>-1?d:`@location(${i++}) ${d}`).join(`,
88
- `),s=n.sort().map(d=>` var ${p5(d)};`).join(`
89
- `),l=`return VSOutput(
90
- ${n.sort().map(d=>` ${h5(d)}`).join(`,
91
- `)});`;let c=e.replace(/@out\s+[^;]+;\s*/g,"");return c=c.replace("{{struct}}",`
92
- ${r}
93
- `),c=c.replace("{{start}}",`
94
- ${s}
95
- `),c=c.replace("{{return}}",`
96
- ${l}
97
- `),c}function KE(t,e){let n=t;for(const i in e){const r=e[i];r.join(`
98
- `).length?n=n.replace(`{{${i}}}`,`//-----${i} START-----//
99
- ${r.join(`
100
- `)}
101
- //----${i} FINISH----//`):n=n.replace(`{{${i}}}`,"")}return n}const iu=Object.create(null),kx=new Map;let g5=0;function y5({template:t,bits:e}){const n=DA(t,e);if(iu[n])return iu[n];const{vertex:i,fragment:r}=x5(t,e);return iu[n]=zA(i,r,e),iu[n]}function b5({template:t,bits:e}){const n=DA(t,e);return iu[n]||(iu[n]=zA(t.vertex,t.fragment,e)),iu[n]}function x5(t,e){const n=e.map(l=>l.vertex).filter(l=>!!l),i=e.map(l=>l.fragment).filter(l=>!!l);let r=VE(n,t.vertex,!0);r=m5(n,r);const s=VE(i,t.fragment,!0);return{vertex:r,fragment:s}}function DA(t,e){return e.map(n=>(kx.has(n)||kx.set(n,g5++),kx.get(n))).sort((n,i)=>n-i).join("-")+t.vertex+t.fragment}function zA(t,e,n){const i=qE(t),r=qE(e);return n.forEach(s=>{FE(s.vertex,i,s.name),FE(s.fragment,r,s.name)}),{vertex:KE(t,i),fragment:KE(e,r)}}const v5=`
102
- @in aPosition: vec2<f32>;
103
- @in aUV: vec2<f32>;
104
-
105
- @out @builtin(position) vPosition: vec4<f32>;
106
- @out vUV : vec2<f32>;
107
- @out vColor : vec4<f32>;
108
-
109
- {{header}}
110
-
111
- struct VSOutput {
112
- {{struct}}
113
- };
114
-
115
- @vertex
116
- fn main( {{in}} ) -> VSOutput {
117
-
118
- var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
119
- var modelMatrix = mat3x3<f32>(
120
- 1.0, 0.0, 0.0,
121
- 0.0, 1.0, 0.0,
122
- 0.0, 0.0, 1.0
123
- );
124
- var position = aPosition;
125
- var uv = aUV;
126
-
127
- {{start}}
128
-
129
- vColor = vec4<f32>(1., 1., 1., 1.);
130
-
131
- {{main}}
132
-
133
- vUV = uv;
134
-
135
- var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
136
-
137
- vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
138
-
139
- vColor *= globalUniforms.uWorldColorAlpha;
140
-
141
- {{end}}
142
-
143
- {{return}}
144
- };
145
- `,_5=`
146
- @in vUV : vec2<f32>;
147
- @in vColor : vec4<f32>;
148
-
149
- {{header}}
150
-
151
- @fragment
152
- fn main(
153
- {{in}}
154
- ) -> @location(0) vec4<f32> {
155
-
156
- {{start}}
157
-
158
- var outColor:vec4<f32>;
159
-
160
- {{main}}
161
-
162
- var finalColor:vec4<f32> = outColor * vColor;
163
-
164
- {{end}}
165
-
166
- return finalColor;
167
- };
168
- `,S5=`
169
- in vec2 aPosition;
170
- in vec2 aUV;
171
-
172
- out vec4 vColor;
173
- out vec2 vUV;
174
-
175
- {{header}}
176
-
177
- void main(void){
178
-
179
- mat3 worldTransformMatrix = uWorldTransformMatrix;
180
- mat3 modelMatrix = mat3(
181
- 1.0, 0.0, 0.0,
182
- 0.0, 1.0, 0.0,
183
- 0.0, 0.0, 1.0
184
- );
185
- vec2 position = aPosition;
186
- vec2 uv = aUV;
187
-
188
- {{start}}
189
-
190
- vColor = vec4(1.);
191
-
192
- {{main}}
193
-
194
- vUV = uv;
195
-
196
- mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
197
-
198
- gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
199
-
200
- vColor *= uWorldColorAlpha;
201
-
202
- {{end}}
203
- }
204
- `,E5=`
205
-
206
- in vec4 vColor;
207
- in vec2 vUV;
208
-
209
- out vec4 finalColor;
210
-
211
- {{header}}
212
-
213
- void main(void) {
214
-
215
- {{start}}
216
-
217
- vec4 outColor;
218
-
219
- {{main}}
220
-
221
- finalColor = outColor * vColor;
222
-
223
- {{end}}
224
- }
225
- `,w5={name:"global-uniforms-bit",vertex:{header:`
226
- struct GlobalUniforms {
227
- uProjectionMatrix:mat3x3<f32>,
228
- uWorldTransformMatrix:mat3x3<f32>,
229
- uWorldColorAlpha: vec4<f32>,
230
- uResolution: vec2<f32>,
231
- }
232
-
233
- @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
234
- `}},T5={name:"global-uniforms-bit",vertex:{header:`
235
- uniform mat3 uProjectionMatrix;
236
- uniform mat3 uWorldTransformMatrix;
237
- uniform vec4 uWorldColorAlpha;
238
- uniform vec2 uResolution;
239
- `}};function C5({bits:t,name:e}){const n=y5({template:{fragment:_5,vertex:v5},bits:[w5,...t]});return qm.from({name:e,vertex:{source:n.vertex,entryPoint:"main"},fragment:{source:n.fragment,entryPoint:"main"}})}function A5({bits:t,name:e}){return new P_({name:e,...b5({template:{vertex:S5,fragment:E5},bits:[T5,...t]})})}const M5={name:"color-bit",vertex:{header:`
240
- @in aColor: vec4<f32>;
241
- `,main:`
242
- vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
243
- `}},N5={name:"color-bit",vertex:{header:`
244
- in vec4 aColor;
245
- `,main:`
246
- vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
247
- `}},Ox={};function R5(t){const e=[];if(t===1)e.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),e.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let n=0;for(let i=0;i<t;i++)e.push(`@group(1) @binding(${n++}) var textureSource${i+1}: texture_2d<f32>;`),e.push(`@group(1) @binding(${n++}) var textureSampler${i+1}: sampler;`)}return e.join(`
248
- `)}function k5(t){const e=[];if(t===1)e.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{e.push("switch vTextureId {");for(let n=0;n<t;n++)n===t-1?e.push(" default:{"):e.push(` case ${n}:{`),e.push(` outColor = textureSampleGrad(textureSource${n+1}, textureSampler${n+1}, vUV, uvDx, uvDy);`),e.push(" break;}");e.push("}")}return e.join(`
249
- `)}function O5(t){return Ox[t]||(Ox[t]={name:"texture-batch-bit",vertex:{header:`
250
- @in aTextureIdAndRound: vec2<u32>;
251
- @out @interpolate(flat) vTextureId : u32;
252
- `,main:`
253
- vTextureId = aTextureIdAndRound.y;
254
- `,end:`
255
- if(aTextureIdAndRound.x == 1)
256
- {
257
- vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
258
- }
259
- `},fragment:{header:`
260
- @in @interpolate(flat) vTextureId: u32;
261
-
262
- ${R5(t)}
263
- `,main:`
264
- var uvDx = dpdx(vUV);
265
- var uvDy = dpdy(vUV);
266
-
267
- ${k5(t)}
268
- `}}),Ox[t]}const Dx={};function D5(t){const e=[];for(let n=0;n<t;n++)n>0&&e.push("else"),n<t-1&&e.push(`if(vTextureId < ${n}.5)`),e.push("{"),e.push(` outColor = texture(uTextures[${n}], vUV);`),e.push("}");return e.join(`
269
- `)}function z5(t){return Dx[t]||(Dx[t]={name:"texture-batch-bit",vertex:{header:`
270
- in vec2 aTextureIdAndRound;
271
- out float vTextureId;
272
-
273
- `,main:`
274
- vTextureId = aTextureIdAndRound.y;
275
- `,end:`
276
- if(aTextureIdAndRound.x == 1.)
277
- {
278
- gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
279
- }
280
- `},fragment:{header:`
281
- in float vTextureId;
282
-
283
- uniform sampler2D uTextures[${t}];
284
-
285
- `,main:`
286
-
287
- ${D5(t)}
288
- `}}),Dx[t]}const B5={name:"round-pixels-bit",vertex:{header:`
289
- fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
290
- {
291
- return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
292
- }
293
- `}},L5={name:"round-pixels-bit",vertex:{header:`
294
- vec2 roundPixels(vec2 position, vec2 targetSize)
295
- {
296
- return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
297
- }
298
- `}},WE={};function U5(t){let e=WE[t];if(e)return e;const n=new Int32Array(t);for(let i=0;i<t;i++)n[i]=i;return e=WE[t]=new hA({uTextures:{value:n,type:"i32",size:t}},{isStatic:!0}),e}class ZE extends K0{constructor(e){const n=A5({name:"batch",bits:[N5,z5(e),L5]}),i=C5({name:"batch",bits:[M5,O5(e),B5]});super({glProgram:n,gpuProgram:i,resources:{batchSamplers:U5(e)}}),this.maxTextures=e}}let Wp=null;const BA=class LA extends a5{constructor(e){super(e),this.geometry=new f5,this.name=LA.extension.name,this.vertexSize=6,Wp??(Wp=new ZE(e.maxTextures)),this.shader=Wp}packAttributes(e,n,i,r,s){const l=s<<16|e.roundPixels&65535,c=e.transform,d=c.a,p=c.b,m=c.c,g=c.d,x=c.tx,v=c.ty,{positions:E,uvs:A}=e,C=e.color,w=e.attributeOffset,k=w+e.attributeSize;for(let N=w;N<k;N++){const D=N*2,H=E[D],z=E[D+1];n[r++]=d*H+m*z+x,n[r++]=g*z+p*H+v,n[r++]=A[D],n[r++]=A[D+1],i[r++]=C,i[r++]=l}}packQuadAttributes(e,n,i,r,s){const l=e.texture,c=e.transform,d=c.a,p=c.b,m=c.c,g=c.d,x=c.tx,v=c.ty,E=e.bounds,A=E.maxX,C=E.minX,w=E.maxY,k=E.minY,N=l.uvs,D=e.color,H=s<<16|e.roundPixels&65535;n[r+0]=d*C+m*k+x,n[r+1]=g*k+p*C+v,n[r+2]=N.x0,n[r+3]=N.y0,i[r+4]=D,i[r+5]=H,n[r+6]=d*A+m*k+x,n[r+7]=g*k+p*A+v,n[r+8]=N.x1,n[r+9]=N.y1,i[r+10]=D,i[r+11]=H,n[r+12]=d*A+m*w+x,n[r+13]=g*w+p*A+v,n[r+14]=N.x2,n[r+15]=N.y2,i[r+16]=D,i[r+17]=H,n[r+18]=d*C+m*w+x,n[r+19]=g*w+p*C+v,n[r+20]=N.x3,n[r+21]=N.y3,i[r+22]=D,i[r+23]=H}_updateMaxTextures(e){this.shader.maxTextures!==e&&(Wp=new ZE(e),this.shader=Wp)}destroy(){this.shader=null,super.destroy()}};BA.extension={type:[Nt.Batcher],name:"default"};let I5=BA;class Ym{constructor(e){this.items=Object.create(null);const{renderer:n,type:i,onUnload:r,priority:s,name:l}=e;this._renderer=n,n.gc.addResourceHash(this,"items",i,s??0),this._onUnload=r,this.name=l}add(e){return this.items[e.uid]?!1:(this.items[e.uid]=e,e.once("unload",this.remove,this),e._gcLastUsed=this._renderer.gc.now,!0)}remove(e,...n){var r;if(!this.items[e.uid])return;const i=e._gpuData[this._renderer.uid];i&&((r=this._onUnload)==null||r.call(this,e,...n),i.destroy(),e._gpuData[this._renderer.uid]=null,this.items[e.uid]=null)}removeAll(...e){Object.values(this.items).forEach(n=>n&&this.remove(n,...e))}destroy(...e){this.removeAll(...e),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}function H5(t,e,n,i,r,s,l,c=null){let d=0;n*=e,r*=s;const p=c.a,m=c.b,g=c.c,x=c.d,v=c.tx,E=c.ty;for(;d<l;){const A=t[n],C=t[n+1];i[r]=p*A+g*C+v,i[r+1]=m*A+x*C+E,r+=s,n+=e,d++}}function j5(t,e,n,i){let r=0;for(e*=n;r<i;)t[e]=0,t[e+1]=0,e+=n,r++}function UA(t,e,n,i,r){const s=e.a,l=e.b,c=e.c,d=e.d,p=e.tx,m=e.ty;n||(n=0),i||(i=2),r||(r=t.length/i-n);let g=n*i;for(let x=0;x<r;x++){const v=t[g],E=t[g+1];t[g]=s*v+c*E+p,t[g+1]=l*v+d*E+m,g+=i}}const P5=new jt;class X_{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){const e=this.baseColor,n=e>>16|e&65280|(e&255)<<16,i=this.renderable;return i?FC(n,i.groupColor)+(this.alpha*i.groupAlpha*255<<24):n+(this.alpha*255<<24)}get transform(){var e;return((e=this.renderable)==null?void 0:e.groupTransform)||P5}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}}const Nm={extension:{type:Nt.ShapeBuilder,name:"circle"},build(t,e){let n,i,r,s,l,c;if(t.type==="circle"){const D=t;if(l=c=D.radius,l<=0)return!1;n=D.x,i=D.y,r=s=0}else if(t.type==="ellipse"){const D=t;if(l=D.halfWidth,c=D.halfHeight,l<=0||c<=0)return!1;n=D.x,i=D.y,r=s=0}else{const D=t,H=D.width/2,z=D.height/2;n=D.x+H,i=D.y+z,l=c=Math.max(0,Math.min(D.radius,Math.min(H,z))),r=H-l,s=z-c}if(r<0||s<0)return!1;const d=Math.ceil(2.3*Math.sqrt(l+c)),p=d*8+(r?4:0)+(s?4:0);if(p===0)return!1;if(d===0)return e[0]=e[6]=n+r,e[1]=e[3]=i+s,e[2]=e[4]=n-r,e[5]=e[7]=i-s,!0;let m=0,g=d*4+(r?2:0)+2,x=g,v=p,E=r+l,A=s,C=n+E,w=n-E,k=i+A;if(e[m++]=C,e[m++]=k,e[--g]=k,e[--g]=w,s){const D=i-A;e[x++]=w,e[x++]=D,e[--v]=D,e[--v]=C}for(let D=1;D<d;D++){const H=Math.PI/2*(D/d),z=r+Math.cos(H)*l,F=s+Math.sin(H)*c,ee=n+z,P=n-z,I=i+F,V=i-F;e[m++]=ee,e[m++]=I,e[--g]=I,e[--g]=P,e[x++]=P,e[x++]=V,e[--v]=V,e[--v]=ee}E=r,A=s+c,C=n+E,w=n-E,k=i+A;const N=i-A;return e[m++]=C,e[m++]=k,e[--v]=N,e[--v]=C,r&&(e[m++]=w,e[m++]=k,e[--v]=N,e[--v]=w),!0},triangulate(t,e,n,i,r,s){if(t.length===0)return;let l=0,c=0;for(let m=0;m<t.length;m+=2)l+=t[m],c+=t[m+1];l/=t.length/2,c/=t.length/2;let d=i;e[d*n]=l,e[d*n+1]=c;const p=d++;for(let m=0;m<t.length;m+=2)e[d*n]=t[m],e[d*n+1]=t[m+1],m>0&&(r[s++]=d,r[s++]=p,r[s++]=d-1),d++;r[s++]=p+1,r[s++]=p,r[s++]=d-1}},G5={...Nm,extension:{...Nm.extension,name:"ellipse"}},F5={...Nm,extension:{...Nm.extension,name:"roundedRectangle"}},IA=1e-4,$E=1e-4;function q5(t){const e=t.length;if(e<6)return 1;let n=0;for(let i=0,r=t[e-2],s=t[e-1];i<e;i+=2){const l=t[i],c=t[i+1];n+=(l-r)*(c+s),r=l,s=c}return n<0?-1:1}function QE(t,e,n,i,r,s,l,c){const d=t-n*r,p=e-i*r,m=t+n*s,g=e+i*s;let x,v;l?(x=i,v=-n):(x=-i,v=n);const E=d+x,A=p+v,C=m+x,w=g+v;return c.push(E,A),c.push(C,w),2}function Ju(t,e,n,i,r,s,l,c){const d=n-t,p=i-e;let m=Math.atan2(d,p),g=Math.atan2(r-t,s-e);c&&m<g?m+=Math.PI*2:!c&&m>g&&(g+=Math.PI*2);let x=m;const v=g-m,E=Math.abs(v),A=Math.sqrt(d*d+p*p),C=(15*E*Math.sqrt(A)/Math.PI>>0)+1,w=v/C;if(x+=w,c){l.push(t,e),l.push(n,i);for(let k=1,N=x;k<C;k++,N+=w)l.push(t,e),l.push(t+Math.sin(N)*A,e+Math.cos(N)*A);l.push(t,e),l.push(r,s)}else{l.push(n,i),l.push(t,e);for(let k=1,N=x;k<C;k++,N+=w)l.push(t+Math.sin(N)*A,e+Math.cos(N)*A),l.push(t,e);l.push(r,s),l.push(t,e)}return C*2}function Y5(t,e,n,i,r,s){const l=IA;if(t.length===0)return;const c=e;let d=c.alignment;if(e.alignment!==.5){let $=q5(t);d=(d-.5)*$+.5}const p=new Dr(t[0],t[1]),m=new Dr(t[t.length-2],t[t.length-1]),g=i,x=Math.abs(p.x-m.x)<l&&Math.abs(p.y-m.y)<l;if(g){t=t.slice(),x&&(t.pop(),t.pop(),m.set(t[t.length-2],t[t.length-1]));const $=(p.x+m.x)*.5,j=(m.y+p.y)*.5;t.unshift($,j),t.push($,j)}const v=r,E=t.length/2;let A=t.length;const C=v.length/2,w=c.width/2,k=w*w,N=c.miterLimit*c.miterLimit;let D=t[0],H=t[1],z=t[2],F=t[3],ee=0,P=0,I=-(H-F),V=D-z,X=0,ne=0,q=Math.sqrt(I*I+V*V);I/=q,V/=q,I*=w,V*=w;const Q=d,B=(1-Q)*2,Y=Q*2;g||(c.cap==="round"?A+=Ju(D-I*(B-Y)*.5,H-V*(B-Y)*.5,D-I*B,H-V*B,D+I*Y,H+V*Y,v,!0)+2:c.cap==="square"&&(A+=QE(D,H,I,V,B,Y,!0,v))),v.push(D-I*B,H-V*B),v.push(D+I*Y,H+V*Y);for(let $=1;$<E-1;++$){D=t[($-1)*2],H=t[($-1)*2+1],z=t[$*2],F=t[$*2+1],ee=t[($+1)*2],P=t[($+1)*2+1],I=-(H-F),V=D-z,q=Math.sqrt(I*I+V*V),I/=q,V/=q,I*=w,V*=w,X=-(F-P),ne=z-ee,q=Math.sqrt(X*X+ne*ne),X/=q,ne/=q,X*=w,ne*=w;const j=z-D,K=H-F,te=z-ee,U=P-F,le=j*te+K*U,de=K*te-U*j,ge=de<0;if(Math.abs(de)<.001*Math.abs(le)){v.push(z-I*B,F-V*B),v.push(z+I*Y,F+V*Y),le>=0&&(c.join==="round"?A+=Ju(z,F,z-I*B,F-V*B,z-X*B,F-ne*B,v,!1)+4:A+=2,v.push(z-X*Y,F-ne*Y),v.push(z+X*B,F+ne*B));continue}const se=(-I+D)*(-V+F)-(-I+z)*(-V+H),pe=(-X+ee)*(-ne+F)-(-X+z)*(-ne+P),Ae=(j*pe-te*se)/de,Le=(U*se-K*pe)/de,Ge=(Ae-z)*(Ae-z)+(Le-F)*(Le-F),Pe=z+(Ae-z)*B,Ie=F+(Le-F)*B,We=z-(Ae-z)*Y,ut=F-(Le-F)*Y,Ue=Math.min(j*j+K*K,te*te+U*U),At=ge?B:Y,zn=Ue+At*At*k;Ge<=zn?c.join==="bevel"||Ge/k>N?(ge?(v.push(Pe,Ie),v.push(z+I*Y,F+V*Y),v.push(Pe,Ie),v.push(z+X*Y,F+ne*Y)):(v.push(z-I*B,F-V*B),v.push(We,ut),v.push(z-X*B,F-ne*B),v.push(We,ut)),A+=2):c.join==="round"?ge?(v.push(Pe,Ie),v.push(z+I*Y,F+V*Y),A+=Ju(z,F,z+I*Y,F+V*Y,z+X*Y,F+ne*Y,v,!0)+4,v.push(Pe,Ie),v.push(z+X*Y,F+ne*Y)):(v.push(z-I*B,F-V*B),v.push(We,ut),A+=Ju(z,F,z-I*B,F-V*B,z-X*B,F-ne*B,v,!1)+4,v.push(z-X*B,F-ne*B),v.push(We,ut)):(v.push(Pe,Ie),v.push(We,ut)):(v.push(z-I*B,F-V*B),v.push(z+I*Y,F+V*Y),c.join==="round"?ge?A+=Ju(z,F,z+I*Y,F+V*Y,z+X*Y,F+ne*Y,v,!0)+2:A+=Ju(z,F,z-I*B,F-V*B,z-X*B,F-ne*B,v,!1)+2:c.join==="miter"&&Ge/k<=N&&(ge?(v.push(We,ut),v.push(We,ut)):(v.push(Pe,Ie),v.push(Pe,Ie)),A+=2),v.push(z-X*B,F-ne*B),v.push(z+X*Y,F+ne*Y),A+=2)}D=t[(E-2)*2],H=t[(E-2)*2+1],z=t[(E-1)*2],F=t[(E-1)*2+1],I=-(H-F),V=D-z,q=Math.sqrt(I*I+V*V),I/=q,V/=q,I*=w,V*=w,v.push(z-I*B,F-V*B),v.push(z+I*Y,F+V*Y),g||(c.cap==="round"?A+=Ju(z-I*(B-Y)*.5,F-V*(B-Y)*.5,z-I*B,F-V*B,z+I*Y,F+V*Y,v,!1)+2:c.cap==="square"&&(A+=QE(z,F,I,V,B,Y,!1,v)));const Z=$E*$E;for(let $=C;$<A+C-2;++$)D=v[$*2],H=v[$*2+1],z=v[($+1)*2],F=v[($+1)*2+1],ee=v[($+2)*2],P=v[($+2)*2+1],!(Math.abs(D*(F-P)+z*(P-H)+ee*(H-F))<Z)&&s.push($,$+1,$+2)}function V5(t,e,n,i){const r=IA;if(t.length===0)return;const s=t[0],l=t[1],c=t[t.length-2],d=t[t.length-1],p=e||Math.abs(s-c)<r&&Math.abs(l-d)<r,m=n,g=t.length/2,x=m.length/2;for(let v=0;v<g;v++)m.push(t[v*2]),m.push(t[v*2+1]);for(let v=0;v<g-1;v++)i.push(x+v,x+v+1);p&&i.push(x+g-1,x)}function HA(t,e,n,i,r,s,l){const c=Bz(t,e,2);if(!c)return;for(let p=0;p<c.length;p+=3)s[l++]=c[p]+r,s[l++]=c[p+1]+r,s[l++]=c[p+2]+r;let d=r*i;for(let p=0;p<t.length;p+=2)n[d]=t[p],n[d+1]=t[p+1],d+=i}const X5=[],K5={extension:{type:Nt.ShapeBuilder,name:"polygon"},build(t,e){for(let n=0;n<t.points.length;n++)e[n]=t.points[n];return!0},triangulate(t,e,n,i,r,s){HA(t,X5,e,n,i,r,s)}},W5={extension:{type:Nt.ShapeBuilder,name:"rectangle"},build(t,e){const n=t,i=n.x,r=n.y,s=n.width,l=n.height;return s>0&&l>0?(e[0]=i,e[1]=r,e[2]=i+s,e[3]=r,e[4]=i+s,e[5]=r+l,e[6]=i,e[7]=r+l,!0):!1},triangulate(t,e,n,i,r,s){let l=0;i*=n,e[i+l]=t[0],e[i+l+1]=t[1],l+=n,e[i+l]=t[2],e[i+l+1]=t[3],l+=n,e[i+l]=t[6],e[i+l+1]=t[7],l+=n,e[i+l]=t[4],e[i+l+1]=t[5],l+=n;const c=i/n;r[s++]=c,r[s++]=c+1,r[s++]=c+2,r[s++]=c+1,r[s++]=c+3,r[s++]=c+2}},Z5={extension:{type:Nt.ShapeBuilder,name:"triangle"},build(t,e){return e[0]=t.x,e[1]=t.y,e[2]=t.x2,e[3]=t.y2,e[4]=t.x3,e[5]=t.y3,!0},triangulate(t,e,n,i,r,s){let l=0;i*=n,e[i+l]=t[0],e[i+l+1]=t[1],l+=n,e[i+l]=t[2],e[i+l+1]=t[3],l+=n,e[i+l]=t[4],e[i+l+1]=t[5];const c=i/n;r[s++]=c,r[s++]=c+1,r[s++]=c+2}},JE=[{offset:0,color:"white"},{offset:1,color:"black"}],K_=class Yv{constructor(...e){this.uid=gi("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let n=$5(e);n={...n.type==="radial"?Yv.defaultRadialOptions:Yv.defaultLinearOptions,...OC(n)},this._textureSize=n.textureSize,this._wrapMode=n.wrapMode,n.type==="radial"?(this.center=n.center,this.outerCenter=n.outerCenter??this.center,this.innerRadius=n.innerRadius,this.outerRadius=n.outerRadius,this.scale=n.scale,this.rotation=n.rotation):(this.start=n.start,this.end=n.end),this.textureSpace=n.textureSpace,this.type=n.type,n.colorStops.forEach(r=>{this.addColorStop(r.offset,r.color)})}addColorStop(e,n){return this.colorStops.push({offset:e,color:Gi.shared.setValue(n).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:n}=this.start,{x:i,y:r}=this.end,s=i-e,l=r-n;const c=s<0||l<0;if(this._wrapMode==="clamp-to-edge"){if(s<0){const C=e;e=i,i=C,s*=-1}if(l<0){const C=n;n=r,r=C,l*=-1}}const d=this.colorStops.length?this.colorStops:JE,p=this._textureSize,{canvas:m,context:g}=tw(p,1),x=c?g.createLinearGradient(this._textureSize,0,0,0):g.createLinearGradient(0,0,this._textureSize,0);ew(x,d),g.fillStyle=x,g.fillRect(0,0,p,1),this.texture=new Tn({source:new b0({resource:m,addressMode:this._wrapMode})});const v=Math.sqrt(s*s+l*l),E=Math.atan2(l,s),A=new jt;A.scale(v/p,1),A.rotate(E),A.translate(e,n),this.textureSpace==="local"&&A.scale(p,p),this.transform=A}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const e=this.colorStops.length?this.colorStops:JE,n=this._textureSize,{canvas:i,context:r}=tw(n,n),{x:s,y:l}=this.center,{x:c,y:d}=this.outerCenter,p=this.innerRadius,m=this.outerRadius,g=c-m,x=d-m,v=n/(m*2),E=(s-g)*v,A=(l-x)*v,C=r.createRadialGradient(E,A,p*v,(c-g)*v,(d-x)*v,m*v);ew(C,e),r.fillStyle=e[e.length-1].color,r.fillRect(0,0,n,n),r.fillStyle=C,r.translate(E,A),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-E,-A),r.fillRect(0,0,n,n),this.texture=new Tn({source:new b0({resource:i,addressMode:this._wrapMode})});const w=new jt;w.scale(1/v,1/v),w.translate(g,x),this.textureSpace==="local"&&w.scale(n,n),this.transform=w}destroy(){var e;(e=this.texture)==null||e.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};K_.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};K_.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let ic=K_;function ew(t,e){for(let n=0;n<e.length;n++){const i=e[n];t.addColorStop(i.offset,i.color)}}function tw(t,e){const n=Ja.get().createCanvas(t,e),i=n.getContext("2d");return{canvas:n,context:i}}function $5(t){let e=t[0]??{};return(typeof e=="number"||t[1])&&(Qt("8.5.2","use options object instead"),e={type:"linear",start:{x:t[0],y:t[1]},end:{x:t[2],y:t[3]},textureSpace:t[4],textureSize:t[5]??ic.defaultLinearOptions.textureSize}),e}const Q5=new jt,J5=new Ei;function e6(t,e,n,i){const r=e.matrix?t.copyFrom(e.matrix).invert():t.identity();if(e.textureSpace==="local"){const l=n.getBounds(J5);e.width&&l.pad(e.width);const{x:c,y:d}=l,p=1/l.width,m=1/l.height,g=-c*p,x=-d*m,v=r.a,E=r.b,A=r.c,C=r.d;r.a*=p,r.b*=p,r.c*=m,r.d*=m,r.tx=g*v+x*A+r.tx,r.ty=g*E+x*C+r.ty}else r.translate(e.texture.frame.x,e.texture.frame.y),r.scale(1/e.texture.source.width,1/e.texture.source.height);const s=e.texture.source.style;return!(e.fill instanceof ic)&&s.addressMode==="clamp-to-edge"&&(s.addressMode="repeat",s.update()),i&&r.append(Q5.copyFrom(i).invert()),r}const W0={};si.handleByMap(Nt.ShapeBuilder,W0);si.add(W5,K5,Z5,Nm,G5,F5);const t6=new Ei,n6=new jt;function i6(t,e){const{geometryData:n,batches:i}=e;i.length=0,n.indices.length=0,n.vertices.length=0,n.uvs.length=0;for(let r=0;r<t.instructions.length;r++){const s=t.instructions[r];if(s.action==="texture")r6(s.data,i,n);else if(s.action==="fill"||s.action==="stroke"){const l=s.action==="stroke",c=s.data.path.shapePath,d=s.data.style,p=s.data.hole;l&&p&&nw(p.shapePath,d,!0,i,n),p&&(c.shapePrimitives[c.shapePrimitives.length-1].holes=p.shapePath.shapePrimitives),nw(c,d,l,i,n)}}}function r6(t,e,n){const i=[],r=W0.rectangle,s=t6;s.x=t.dx,s.y=t.dy,s.width=t.dw,s.height=t.dh;const l=t.transform;if(!r.build(s,i))return;const{vertices:c,uvs:d,indices:p}=n,m=p.length,g=c.length/2;l&&UA(i,l),r.triangulate(i,c,2,g,p,m);const x=t.image,v=x.uvs;d.push(v.x0,v.y0,v.x1,v.y1,v.x3,v.y3,v.x2,v.y2);const E=Na.get(X_);E.indexOffset=m,E.indexSize=p.length-m,E.attributeOffset=g,E.attributeSize=c.length/2-g,E.baseColor=t.style,E.alpha=t.alpha,E.texture=x,E.geometryData=n,e.push(E)}function nw(t,e,n,i,r){const{vertices:s,uvs:l,indices:c}=r;t.shapePrimitives.forEach(({shape:d,transform:p,holes:m})=>{const g=[],x=W0[d.type];if(!x.build(d,g))return;const v=c.length,E=s.length/2;let A="triangle-list";if(p&&UA(g,p),n){const N=d.closePath??!0,D=e;D.pixelLine?(V5(g,N,s,c),A="line-list"):Y5(g,D,!1,N,s,c)}else if(m){const N=[],D=g.slice();a6(m).forEach(z=>{N.push(D.length/2),D.push(...z)}),HA(D,N,s,2,E,c,v)}else x.triangulate(g,s,2,E,c,v);const C=l.length/2,w=e.texture;if(w!==Tn.WHITE){const N=e6(n6,e,d,p);H5(s,2,E,l,C,2,s.length/2-E,N)}else j5(l,C,2,s.length/2-E);const k=Na.get(X_);k.indexOffset=v,k.indexSize=c.length-v,k.attributeOffset=E,k.attributeSize=s.length/2-E,k.baseColor=e.color,k.alpha=e.alpha,k.texture=w,k.geometryData=r,k.topology=A,i.push(k)})}function a6(t){const e=[];for(let n=0;n<t.length;n++){const i=t[n].shape,r=[];W0[i.type].build(i,r)&&e.push(r)}return e}class s6{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(e=>{Na.return(e)}),this.graphicsData&&Na.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}}class l6{constructor(){this.instructions=new I_}init(e){const n=e.maxTextures;this.batcher?this.batcher._updateMaxTextures(n):this.batcher=new I5({maxTextures:n}),this.instructions.reset()}get geometry(){return Qt(i4,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}}const W_=class Vv{constructor(e){this._renderer=e,this._managedContexts=new Ym({renderer:e,type:"resource",name:"graphicsContext"})}init(e){Vv.defaultOptions.bezierSmoothness=(e==null?void 0:e.bezierSmoothness)??Vv.defaultOptions.bezierSmoothness}getContextRenderData(e){return e._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(e)}updateGpuContext(e){const n=!!e._gpuData[this._renderer.uid],i=e._gpuData[this._renderer.uid]||this._initContext(e);if(e.dirty||!n){n&&i.reset(),i6(e,i);const r=e.batchMode;e.customShader||r==="no-batch"?i.isBatchable=!1:r==="auto"?i.isBatchable=i.geometryData.vertices.length<400:i.isBatchable=!0,e.dirty=!1}return i}getGpuContext(e){return e._gpuData[this._renderer.uid]||this._initContext(e)}_initContextRenderData(e){const n=Na.get(l6,{maxTextures:this._renderer.limits.maxBatchableTextures}),i=e._gpuData[this._renderer.uid],{batches:r,geometryData:s}=i;i.graphicsData=n;const l=s.vertices.length,c=s.indices.length;for(let g=0;g<r.length;g++)r[g].applyTransform=!1;const d=n.batcher;d.ensureAttributeBuffer(l),d.ensureIndexBuffer(c),d.begin();for(let g=0;g<r.length;g++){const x=r[g];d.add(x)}d.finish(n.instructions);const p=d.geometry;p.indexBuffer.setDataWithSize(d.indexBuffer,d.indexSize,!0),p.buffers[0].setDataWithSize(d.attributeBuffer.float32View,d.attributeSize,!0);const m=d.batches;for(let g=0;g<m.length;g++){const x=m[g];x.bindGroup=Wz(x.textures.textures,x.textures.count,this._renderer.limits.maxBatchableTextures)}return n}_initContext(e){const n=new s6;return n.context=e,e._gpuData[this._renderer.uid]=n,this._managedContexts.add(e),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};W_.extension={type:[Nt.WebGLSystem,Nt.WebGPUSystem],name:"graphicsContext"};W_.defaultOptions={bezierSmoothness:.5};let Z_=W_;const o6=8,zy=11920929e-14,c6=1;function jA(t,e,n,i,r,s,l,c,d,p){const g=Math.min(.99,Math.max(0,p??Z_.defaultOptions.bezierSmoothness));let x=(c6-g)/1;return x*=x,u6(e,n,i,r,s,l,c,d,t,x),t}function u6(t,e,n,i,r,s,l,c,d,p){Xv(t,e,n,i,r,s,l,c,d,p,0),d.push(l,c)}function Xv(t,e,n,i,r,s,l,c,d,p,m){if(m>o6)return;const g=(t+n)/2,x=(e+i)/2,v=(n+r)/2,E=(i+s)/2,A=(r+l)/2,C=(s+c)/2,w=(g+v)/2,k=(x+E)/2,N=(v+A)/2,D=(E+C)/2,H=(w+N)/2,z=(k+D)/2;if(m>0){let F=l-t,ee=c-e;const P=Math.abs((n-l)*ee-(i-c)*F),I=Math.abs((r-l)*ee-(s-c)*F);if(P>zy&&I>zy){if((P+I)*(P+I)<=p*(F*F+ee*ee)){d.push(H,z);return}}else if(P>zy){if(P*P<=p*(F*F+ee*ee)){d.push(H,z);return}}else if(I>zy){if(I*I<=p*(F*F+ee*ee)){d.push(H,z);return}}else if(F=H-(t+l)/2,ee=z-(e+c)/2,F*F+ee*ee<=p){d.push(H,z);return}}Xv(t,e,g,x,w,k,H,z,d,p,m+1),Xv(H,z,N,D,A,C,l,c,d,p,m+1)}const f6=8,d6=11920929e-14,h6=1;function p6(t,e,n,i,r,s,l,c){const p=Math.min(.99,Math.max(0,c??Z_.defaultOptions.bezierSmoothness));let m=(h6-p)/1;return m*=m,m6(e,n,i,r,s,l,t,m),t}function m6(t,e,n,i,r,s,l,c){Kv(l,t,e,n,i,r,s,c,0),l.push(r,s)}function Kv(t,e,n,i,r,s,l,c,d){if(d>f6)return;const p=(e+i)/2,m=(n+r)/2,g=(i+s)/2,x=(r+l)/2,v=(p+g)/2,E=(m+x)/2;let A=s-e,C=l-n;const w=Math.abs((i-s)*C-(r-l)*A);if(w>d6){if(w*w<=c*(A*A+C*C)){t.push(v,E);return}}else if(A=v-(e+s)/2,C=E-(n+l)/2,A*A+C*C<=c){t.push(v,E);return}Kv(t,e,n,p,m,v,E,c,d+1),Kv(t,v,E,g,x,s,l,c,d+1)}function PA(t,e,n,i,r,s,l,c){let d=Math.abs(r-s);(!l&&r>s||l&&s>r)&&(d=2*Math.PI-d),c||(c=Math.max(6,Math.floor(6*Math.pow(i,1/3)*(d/Math.PI)))),c=Math.max(c,3);let p=d/c,m=r;p*=l?-1:1;for(let g=0;g<c+1;g++){const x=Math.cos(m),v=Math.sin(m),E=e+x*i,A=n+v*i;t.push(E,A),m+=p}}function g6(t,e,n,i,r,s){const l=t[t.length-2],d=t[t.length-1]-n,p=l-e,m=r-n,g=i-e,x=Math.abs(d*g-p*m);if(x<1e-8||s===0){(t[t.length-2]!==e||t[t.length-1]!==n)&&t.push(e,n);return}const v=d*d+p*p,E=m*m+g*g,A=d*m+p*g,C=s*Math.sqrt(v)/x,w=s*Math.sqrt(E)/x,k=C*A/v,N=w*A/E,D=C*g+w*p,H=C*m+w*d,z=p*(w+k),F=d*(w+k),ee=g*(C+N),P=m*(C+N),I=Math.atan2(F-H,z-D),V=Math.atan2(P-H,ee-D);PA(t,D+e,H+n,s,I,V,p*m>g*d)}const ym=Math.PI*2,zx={centerX:0,centerY:0,ang1:0,ang2:0},Bx=({x:t,y:e},n,i,r,s,l,c,d)=>{t*=n,e*=i;const p=r*t-s*e,m=s*t+r*e;return d.x=p+l,d.y=m+c,d};function y6(t,e){const n=e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=e===1.5707963267948966?.551915024494:n,r=Math.cos(t),s=Math.sin(t),l=Math.cos(t+e),c=Math.sin(t+e);return[{x:r-s*i,y:s+r*i},{x:l+c*i,y:c-l*i},{x:l,y:c}]}const iw=(t,e,n,i)=>{const r=t*i-e*n<0?-1:1;let s=t*n+e*i;return s>1&&(s=1),s<-1&&(s=-1),r*Math.acos(s)},b6=(t,e,n,i,r,s,l,c,d,p,m,g,x)=>{const v=Math.pow(r,2),E=Math.pow(s,2),A=Math.pow(m,2),C=Math.pow(g,2);let w=v*E-v*C-E*A;w<0&&(w=0),w/=v*C+E*A,w=Math.sqrt(w)*(l===c?-1:1);const k=w*r/s*g,N=w*-s/r*m,D=p*k-d*N+(t+n)/2,H=d*k+p*N+(e+i)/2,z=(m-k)/r,F=(g-N)/s,ee=(-m-k)/r,P=(-g-N)/s,I=iw(1,0,z,F);let V=iw(z,F,ee,P);c===0&&V>0&&(V-=ym),c===1&&V<0&&(V+=ym),x.centerX=D,x.centerY=H,x.ang1=I,x.ang2=V};function x6(t,e,n,i,r,s,l,c=0,d=0,p=0){if(s===0||l===0)return;const m=Math.sin(c*ym/360),g=Math.cos(c*ym/360),x=g*(e-i)/2+m*(n-r)/2,v=-m*(e-i)/2+g*(n-r)/2;if(x===0&&v===0)return;s=Math.abs(s),l=Math.abs(l);const E=Math.pow(x,2)/Math.pow(s,2)+Math.pow(v,2)/Math.pow(l,2);E>1&&(s*=Math.sqrt(E),l*=Math.sqrt(E)),b6(e,n,i,r,s,l,d,p,m,g,x,v,zx);let{ang1:A,ang2:C}=zx;const{centerX:w,centerY:k}=zx;let N=Math.abs(C)/(ym/4);Math.abs(1-N)<1e-7&&(N=1);const D=Math.max(Math.ceil(N),1);C/=D;let H=t[t.length-2],z=t[t.length-1];const F={x:0,y:0};for(let ee=0;ee<D;ee++){const P=y6(A,C),{x:I,y:V}=Bx(P[0],s,l,g,m,w,k,F),{x:X,y:ne}=Bx(P[1],s,l,g,m,w,k,F),{x:q,y:Q}=Bx(P[2],s,l,g,m,w,k,F);jA(t,H,z,I,V,X,ne,q,Q),H=q,z=Q,A+=C}}function v6(t,e,n){const i=(l,c)=>{const d=c.x-l.x,p=c.y-l.y,m=Math.sqrt(d*d+p*p),g=d/m,x=p/m;return{len:m,nx:g,ny:x}},r=(l,c)=>{l===0?t.moveTo(c.x,c.y):t.lineTo(c.x,c.y)};let s=e[e.length-1];for(let l=0;l<e.length;l++){const c=e[l%e.length],d=c.radius??n;if(d<=0){r(l,c),s=c;continue}const p=e[(l+1)%e.length],m=i(c,s),g=i(c,p);if(m.len<1e-4||g.len<1e-4){r(l,c),s=c;continue}let x=Math.asin(m.nx*g.ny-m.ny*g.nx),v=1,E=!1;m.nx*g.nx-m.ny*-g.ny<0?x<0?x=Math.PI+x:(x=Math.PI-x,v=-1,E=!0):x>0&&(v=-1,E=!0);const A=x/2;let C,w=Math.abs(Math.cos(A)*d/Math.sin(A));w>Math.min(m.len/2,g.len/2)?(w=Math.min(m.len/2,g.len/2),C=Math.abs(w*Math.sin(A)/Math.cos(A))):C=d;const k=c.x+g.nx*w+-g.ny*C*v,N=c.y+g.ny*w+g.nx*C*v,D=Math.atan2(m.ny,m.nx)+Math.PI/2*v,H=Math.atan2(g.ny,g.nx)-Math.PI/2*v;l===0&&t.moveTo(k+Math.cos(D)*C,N+Math.sin(D)*C),t.arc(k,N,C,D,H,E),s=c}}function _6(t,e,n,i){const r=(c,d)=>Math.sqrt((c.x-d.x)**2+(c.y-d.y)**2),s=(c,d,p)=>({x:c.x+(d.x-c.x)*p,y:c.y+(d.y-c.y)*p}),l=e.length;for(let c=0;c<l;c++){const d=e[(c+1)%l],p=d.radius??n;if(p<=0){c===0?t.moveTo(d.x,d.y):t.lineTo(d.x,d.y);continue}const m=e[c],g=e[(c+2)%l],x=r(m,d);let v;if(x<1e-4)v=d;else{const C=Math.min(x/2,p);v=s(d,m,C/x)}const E=r(g,d);let A;if(E<1e-4)A=d;else{const C=Math.min(E/2,p);A=s(d,g,C/E)}c===0?t.moveTo(v.x,v.y):t.lineTo(v.x,v.y),t.quadraticCurveTo(d.x,d.y,A.x,A.y,i)}}const S6=new Ei;class E6{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new Ds,this._graphicsPath2D=e,this.signed=e.checkForHoles}moveTo(e,n){return this.startPoly(e,n),this}lineTo(e,n){this._ensurePoly();const i=this._currentPoly.points,r=i[i.length-2],s=i[i.length-1];return(r!==e||s!==n)&&i.push(e,n),this}arc(e,n,i,r,s,l){this._ensurePoly(!1);const c=this._currentPoly.points;return PA(c,e,n,i,r,s,l),this}arcTo(e,n,i,r,s){this._ensurePoly();const l=this._currentPoly.points;return g6(l,e,n,i,r,s),this}arcToSvg(e,n,i,r,s,l,c){const d=this._currentPoly.points;return x6(d,this._currentPoly.lastX,this._currentPoly.lastY,l,c,e,n,i,r,s),this}bezierCurveTo(e,n,i,r,s,l,c){this._ensurePoly();const d=this._currentPoly;return jA(this._currentPoly.points,d.lastX,d.lastY,e,n,i,r,s,l,c),this}quadraticCurveTo(e,n,i,r,s){this._ensurePoly();const l=this._currentPoly;return p6(this._currentPoly.points,l.lastX,l.lastY,e,n,i,r,s),this}closePath(){return this.endPoly(!0),this}addPath(e,n){this.endPoly(),n&&!n.isIdentity()&&(e=e.clone(!0),e.transform(n));const i=this.shapePrimitives,r=i.length;for(let s=0;s<e.instructions.length;s++){const l=e.instructions[s];this[l.action](...l.data)}if(e.checkForHoles&&i.length-r>1){let s=null;for(let l=r;l<i.length;l++){const c=i[l];if(c.shape.type==="polygon"){const d=c.shape,p=s==null?void 0:s.shape;p&&p.containsPolygon(d)?(s.holes||(s.holes=[]),s.holes.push(c),i.copyWithin(l,l+1),i.length--,l--):s=c}}}return this}finish(e=!1){this.endPoly(e)}rect(e,n,i,r,s){return this.drawShape(new Ei(e,n,i,r),s),this}circle(e,n,i,r){return this.drawShape(new q_(e,n,i),r),this}poly(e,n,i){const r=new mm(e);return r.closePath=n,this.drawShape(r,i),this}regularPoly(e,n,i,r,s=0,l){r=Math.max(r|0,3);const c=-1*Math.PI/2+s,d=Math.PI*2/r,p=[];for(let m=0;m<r;m++){const g=c-m*d;p.push(e+i*Math.cos(g),n+i*Math.sin(g))}return this.poly(p,!0,l),this}roundPoly(e,n,i,r,s,l=0,c){if(r=Math.max(r|0,3),s<=0)return this.regularPoly(e,n,i,r,l);const d=i*Math.sin(Math.PI/r)-.001;s=Math.min(s,d);const p=-1*Math.PI/2+l,m=Math.PI*2/r,g=(r-2)*Math.PI/r/2;for(let x=0;x<r;x++){const v=x*m+p,E=e+i*Math.cos(v),A=n+i*Math.sin(v),C=v+Math.PI+g,w=v-Math.PI-g,k=E+s*Math.cos(C),N=A+s*Math.sin(C),D=E+s*Math.cos(w),H=A+s*Math.sin(w);x===0?this.moveTo(k,N):this.lineTo(k,N),this.quadraticCurveTo(E,A,D,H,c)}return this.closePath()}roundShape(e,n,i=!1,r){return e.length<3?this:(i?_6(this,e,n,r):v6(this,e,n),this.closePath())}filletRect(e,n,i,r,s){if(s===0)return this.rect(e,n,i,r);const l=Math.min(i,r)/2,c=Math.min(l,Math.max(-l,s)),d=e+i,p=n+r,m=c<0?-c:0,g=Math.abs(c);return this.moveTo(e,n+g).arcTo(e+m,n+m,e+g,n,g).lineTo(d-g,n).arcTo(d-m,n+m,d,n+g,g).lineTo(d,p-g).arcTo(d-m,p-m,e+i-g,p,g).lineTo(e+g,p).arcTo(e+m,p-m,e,p-g,g).closePath()}chamferRect(e,n,i,r,s,l){if(s<=0)return this.rect(e,n,i,r);const c=Math.min(s,Math.min(i,r)/2),d=e+i,p=n+r,m=[e+c,n,d-c,n,d,n+c,d,p-c,d-c,p,e+c,p,e,p-c,e,n+c];for(let g=m.length-1;g>=2;g-=2)m[g]===m[g-2]&&m[g-1]===m[g-3]&&m.splice(g-1,2);return this.poly(m,!0,l)}ellipse(e,n,i,r,s){return this.drawShape(new Y_(e,n,i,r),s),this}roundRect(e,n,i,r,s,l){return this.drawShape(new V_(e,n,i,r,s),l),this}drawShape(e,n){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:n}),this}startPoly(e,n){let i=this._currentPoly;return i&&this.endPoly(),i=new mm,i.points.push(e,n),this._currentPoly=i,this}endPoly(e=!1){const n=this._currentPoly;return n&&n.points.length>2&&(n.closePath=e,this.shapePrimitives.push({shape:n})),this._currentPoly=null,this}_ensurePoly(e=!0){if(!this._currentPoly&&(this._currentPoly=new mm,e)){const n=this.shapePrimitives[this.shapePrimitives.length-1];if(n){let i=n.shape.x,r=n.shape.y;if(n.transform&&!n.transform.isIdentity()){const s=n.transform,l=i;i=s.a*i+s.c*r+s.tx,r=s.b*l+s.d*r+s.ty}this._currentPoly.points.push(i,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let n=0;n<e.instructions.length;n++){const i=e.instructions[n];this[i.action](...i.data)}this.finish()}get bounds(){const e=this._bounds;e.clear();const n=this.shapePrimitives;for(let i=0;i<n.length;i++){const r=n[i],s=r.shape.getBounds(S6);r.transform?e.addRect(s,r.transform):e.addRect(s)}return e}}class tc{constructor(e,n=!1){this.instructions=[],this.uid=gi("graphicsPath"),this._dirty=!0,this.checkForHoles=n,typeof e=="string"?Yz(e,this):this.instructions=(e==null?void 0:e.slice())??[]}get shapePath(){return this._shapePath||(this._shapePath=new E6(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(e,n){return e=e.clone(),this.instructions.push({action:"addPath",data:[e,n]}),this._dirty=!0,this}arc(...e){return this.instructions.push({action:"arc",data:e}),this._dirty=!0,this}arcTo(...e){return this.instructions.push({action:"arcTo",data:e}),this._dirty=!0,this}arcToSvg(...e){return this.instructions.push({action:"arcToSvg",data:e}),this._dirty=!0,this}bezierCurveTo(...e){return this.instructions.push({action:"bezierCurveTo",data:e}),this._dirty=!0,this}bezierCurveToShort(e,n,i,r,s){const l=this.instructions[this.instructions.length-1],c=this.getLastPoint(Dr.shared);let d=0,p=0;if(!l||l.action!=="bezierCurveTo")d=c.x,p=c.y;else{d=l.data[2],p=l.data[3];const m=c.x,g=c.y;d=m+(m-d),p=g+(g-p)}return this.instructions.push({action:"bezierCurveTo",data:[d,p,e,n,i,r,s]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...e){return this.instructions.push({action:"ellipse",data:e}),this._dirty=!0,this}lineTo(...e){return this.instructions.push({action:"lineTo",data:e}),this._dirty=!0,this}moveTo(...e){return this.instructions.push({action:"moveTo",data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:"quadraticCurveTo",data:e}),this._dirty=!0,this}quadraticCurveToShort(e,n,i){const r=this.instructions[this.instructions.length-1],s=this.getLastPoint(Dr.shared);let l=0,c=0;if(!r||r.action!=="quadraticCurveTo")l=s.x,c=s.y;else{l=r.data[0],c=r.data[1];const d=s.x,p=s.y;l=d+(d-l),c=p+(p-c)}return this.instructions.push({action:"quadraticCurveTo",data:[l,c,e,n,i]}),this._dirty=!0,this}rect(e,n,i,r,s){return this.instructions.push({action:"rect",data:[e,n,i,r,s]}),this._dirty=!0,this}circle(e,n,i,r){return this.instructions.push({action:"circle",data:[e,n,i,r]}),this._dirty=!0,this}roundRect(...e){return this.instructions.push({action:"roundRect",data:e}),this._dirty=!0,this}poly(...e){return this.instructions.push({action:"poly",data:e}),this._dirty=!0,this}regularPoly(...e){return this.instructions.push({action:"regularPoly",data:e}),this._dirty=!0,this}roundPoly(...e){return this.instructions.push({action:"roundPoly",data:e}),this._dirty=!0,this}roundShape(...e){return this.instructions.push({action:"roundShape",data:e}),this._dirty=!0,this}filletRect(...e){return this.instructions.push({action:"filletRect",data:e}),this._dirty=!0,this}chamferRect(...e){return this.instructions.push({action:"chamferRect",data:e}),this._dirty=!0,this}star(e,n,i,r,s,l,c){s||(s=r/2);const d=-1*Math.PI/2+l,p=i*2,m=Math.PI*2/p,g=[];for(let x=0;x<p;x++){const v=x%2?s:r,E=x*m+d;g.push(e+v*Math.cos(E),n+v*Math.sin(E))}return this.poly(g,!0,c),this}clone(e=!1){const n=new tc;if(n.checkForHoles=this.checkForHoles,!e)n.instructions=this.instructions.slice();else for(let i=0;i<this.instructions.length;i++){const r=this.instructions[i];n.instructions.push({action:r.action,data:r.data.slice()})}return n}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(e){if(e.isIdentity())return this;const n=e.a,i=e.b,r=e.c,s=e.d,l=e.tx,c=e.ty;let d=0,p=0,m=0,g=0,x=0,v=0,E=0,A=0;for(let C=0;C<this.instructions.length;C++){const w=this.instructions[C],k=w.data;switch(w.action){case"moveTo":case"lineTo":d=k[0],p=k[1],k[0]=n*d+r*p+l,k[1]=i*d+s*p+c;break;case"bezierCurveTo":m=k[0],g=k[1],x=k[2],v=k[3],d=k[4],p=k[5],k[0]=n*m+r*g+l,k[1]=i*m+s*g+c,k[2]=n*x+r*v+l,k[3]=i*x+s*v+c,k[4]=n*d+r*p+l,k[5]=i*d+s*p+c;break;case"quadraticCurveTo":m=k[0],g=k[1],d=k[2],p=k[3],k[0]=n*m+r*g+l,k[1]=i*m+s*g+c,k[2]=n*d+r*p+l,k[3]=i*d+s*p+c;break;case"arcToSvg":d=k[5],p=k[6],E=k[0],A=k[1],k[0]=n*E+r*A,k[1]=i*E+s*A,k[5]=n*d+r*p+l,k[6]=i*d+s*p+c;break;case"circle":k[4]=Zp(k[3],e);break;case"rect":k[4]=Zp(k[4],e);break;case"ellipse":k[8]=Zp(k[8],e);break;case"roundRect":k[5]=Zp(k[5],e);break;case"addPath":k[0].transform(e);break;case"poly":k[2]=Zp(k[2],e);break;default:ca("unknown transform action",w.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let n=this.instructions.length-1,i=this.instructions[n];if(!i)return e.x=0,e.y=0,e;for(;i.action==="closePath";){if(n--,n<0)return e.x=0,e.y=0,e;i=this.instructions[n]}switch(i.action){case"moveTo":case"lineTo":e.x=i.data[0],e.y=i.data[1];break;case"quadraticCurveTo":e.x=i.data[2],e.y=i.data[3];break;case"bezierCurveTo":e.x=i.data[4],e.y=i.data[5];break;case"arc":case"arcToSvg":e.x=i.data[5],e.y=i.data[6];break;case"addPath":i.data[0].getLastPoint(e);break}return e}}function Zp(t,e){return t?t.prepend(e):e.clone()}function pi(t,e,n){const i=t.getAttribute(e);return i?Number(i):n}function w6(t,e){const n=t.querySelectorAll("defs");for(let i=0;i<n.length;i++){const r=n[i];for(let s=0;s<r.children.length;s++){const l=r.children[s];switch(l.nodeName.toLowerCase()){case"lineargradient":e.defs[l.id]=T6(l);break;case"radialgradient":e.defs[l.id]=C6();break}}}}function T6(t){const e=pi(t,"x1",0),n=pi(t,"y1",0),i=pi(t,"x2",1),r=pi(t,"y2",0),s=t.getAttribute("gradientUnits")||"objectBoundingBox",l=new ic(e,n,i,r,s==="objectBoundingBox"?"local":"global");for(let c=0;c<t.children.length;c++){const d=t.children[c],p=pi(d,"offset",0),m=Gi.shared.setValue(d.getAttribute("stop-color")).toNumber();l.addColorStop(p,m)}return l}function C6(t){return ca("[SVG Parser] Radial gradients are not yet supported"),new ic(0,0,1,0)}function rw(t){const e=t.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}const aw={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};function GA(t,e){const n=t.getAttribute("style"),i={},r={},s={strokeStyle:i,fillStyle:r,useFill:!1,useStroke:!1};for(const l in aw){const c=t.getAttribute(l);c&&sw(e,s,l,c.trim())}if(n){const l=n.split(";");for(let c=0;c<l.length;c++){const d=l[c].trim(),[p,m]=d.split(":");aw[p]&&sw(e,s,p,m.trim())}}return{strokeStyle:s.useStroke?i:null,fillStyle:s.useFill?r:null,useFill:s.useFill,useStroke:s.useStroke}}function sw(t,e,n,i){switch(n){case"stroke":if(i!=="none"){if(i.startsWith("url(")){const r=rw(i);e.strokeStyle.fill=t.defs[r]}else e.strokeStyle.color=Gi.shared.setValue(i).toNumber();e.useStroke=!0}break;case"stroke-width":e.strokeStyle.width=Number(i);break;case"fill":if(i!=="none"){if(i.startsWith("url(")){const r=rw(i);e.fillStyle.fill=t.defs[r]}else e.fillStyle.color=Gi.shared.setValue(i).toNumber();e.useFill=!0}break;case"fill-opacity":e.fillStyle.alpha=Number(i);break;case"stroke-opacity":e.strokeStyle.alpha=Number(i);break;case"opacity":e.fillStyle.alpha=Number(i),e.strokeStyle.alpha=Number(i);break}}function A6(t){if(t.length<=2)return!0;const e=t.map(c=>c.area).sort((c,d)=>d-c),[n,i]=e,r=e[e.length-1],s=n/i,l=i/r;return!(s>3&&l<2)}function M6(t){return t.split(/(?=[Mm])/).filter(i=>i.trim().length>0)}function N6(t){const e=t.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!e||e.length<4)return 0;const n=e.map(Number),i=[],r=[];for(let m=0;m<n.length;m+=2)m+1<n.length&&(i.push(n[m]),r.push(n[m+1]));if(i.length===0||r.length===0)return 0;const s=Math.min(...i),l=Math.max(...i),c=Math.min(...r),d=Math.max(...r);return(l-s)*(d-c)}function lw(t,e){const n=new tc(t,!1);for(const i of n.instructions)e.instructions.push(i)}function R6(t,e){if(typeof t=="string"){const l=document.createElement("div");l.innerHTML=t.trim(),t=l.querySelector("svg")}const n={context:e,defs:{},path:new tc};w6(t,n);const i=t.children,{fillStyle:r,strokeStyle:s}=GA(t,n);for(let l=0;l<i.length;l++){const c=i[l];c.nodeName.toLowerCase()!=="defs"&&FA(c,n,r,s)}return e}function FA(t,e,n,i){const r=t.children,{fillStyle:s,strokeStyle:l}=GA(t,e);s&&n?n={...n,...s}:s&&(n=s),l&&i?i={...i,...l}:l&&(i=l);const c=!n&&!i;c&&(n={color:0});let d,p,m,g,x,v,E,A,C,w,k,N,D,H,z,F,ee;switch(t.nodeName.toLowerCase()){case"path":{H=t.getAttribute("d");const P=t.getAttribute("fill-rule"),I=M6(H),V=P==="evenodd",X=I.length>1;if(V&&X){const q=I.map(B=>({path:B,area:N6(B)}));if(q.sort((B,Y)=>Y.area-B.area),I.length>3||!A6(q))for(let B=0;B<q.length;B++){const Y=q[B],Z=B===0;e.context.beginPath();const $=new tc(void 0,!0);lw(Y.path,$),e.context.path($),Z?(n&&e.context.fill(n),i&&e.context.stroke(i)):e.context.cut()}else for(let B=0;B<q.length;B++){const Y=q[B],Z=B%2===1;e.context.beginPath();const $=new tc(void 0,!0);lw(Y.path,$),e.context.path($),Z?e.context.cut():(n&&e.context.fill(n),i&&e.context.stroke(i))}}else{const q=P?P==="evenodd":!0;z=new tc(H,q),e.context.path(z),n&&e.context.fill(n),i&&e.context.stroke(i)}break}case"circle":E=pi(t,"cx",0),A=pi(t,"cy",0),C=pi(t,"r",0),e.context.ellipse(E,A,C,C),n&&e.context.fill(n),i&&e.context.stroke(i);break;case"rect":d=pi(t,"x",0),p=pi(t,"y",0),F=pi(t,"width",0),ee=pi(t,"height",0),w=pi(t,"rx",0),k=pi(t,"ry",0),w||k?e.context.roundRect(d,p,F,ee,w||k):e.context.rect(d,p,F,ee),n&&e.context.fill(n),i&&e.context.stroke(i);break;case"ellipse":E=pi(t,"cx",0),A=pi(t,"cy",0),w=pi(t,"rx",0),k=pi(t,"ry",0),e.context.beginPath(),e.context.ellipse(E,A,w,k),n&&e.context.fill(n),i&&e.context.stroke(i);break;case"line":m=pi(t,"x1",0),g=pi(t,"y1",0),x=pi(t,"x2",0),v=pi(t,"y2",0),e.context.beginPath(),e.context.moveTo(m,g),e.context.lineTo(x,v),i&&e.context.stroke(i);break;case"polygon":D=t.getAttribute("points"),N=D.match(/-?\d+/g).map(P=>parseInt(P,10)),e.context.poly(N,!0),n&&e.context.fill(n),i&&e.context.stroke(i);break;case"polyline":D=t.getAttribute("points"),N=D.match(/-?\d+/g).map(P=>parseInt(P,10)),e.context.poly(N,!1),i&&e.context.stroke(i);break;case"g":case"svg":break;default:{ca(`[SVG parser] <${t.nodeName}> elements unsupported`);break}}c&&(n=null);for(let P=0;P<r.length;P++)FA(r[P],e,n,i)}const ow={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class Z0{constructor(e,n){this.uid=gi("fillPattern"),this._tick=0,this.transform=new jt,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),n&&(e.source.style.addressModeU=ow[n].addressModeU,e.source.style.addressModeV=ow[n].addressModeV)}setTransform(e){const n=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/n.frame.width,1/n.frame.height),this._tick++}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture=e,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}function k6(t){return Gi.isColorLike(t)}function cw(t){return t instanceof Z0}function uw(t){return t instanceof ic}function O6(t){return t instanceof Tn}function D6(t,e,n){const i=Gi.shared.setValue(e??0);return t.color=i.toNumber(),t.alpha=i.alpha===1?n.alpha:i.alpha,t.texture=Tn.WHITE,{...n,...t}}function z6(t,e,n){return t.texture=e,{...n,...t}}function fw(t,e,n){return t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,{...n,...t}}function dw(t,e,n){return e.buildGradient(),t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,t.textureSpace=e.textureSpace,{...n,...t}}function B6(t,e){const n={...e,...t},i=Gi.shared.setValue(n.color);return n.alpha*=i.alpha,n.color=i.toNumber(),n}function ff(t,e){if(t==null)return null;const n={},i=t;return k6(t)?D6(n,t,e):O6(t)?z6(n,t,e):cw(t)?fw(n,t,e):uw(t)?dw(n,t,e):i.fill&&cw(i.fill)?fw(i,i.fill,e):i.fill&&uw(i.fill)?dw(i,i.fill,e):B6(i,e)}function _0(t,e){const{width:n,alignment:i,miterLimit:r,cap:s,join:l,pixelLine:c,...d}=e,p=ff(t,d);return p?{width:n,alignment:i,miterLimit:r,cap:s,join:l,pixelLine:c,...p}:null}function L6(t,e){let n=1;const i=t.shapePath.shapePrimitives;for(let r=0;r<i.length;r++){const s=i[r].shape;if(s.type!=="polygon")continue;const l=s.points,c=l.length;if(c<6)continue;const d=s.closePath;for(let p=0;p<c;p+=2){if(!d&&(p===0||p===c-2))continue;const m=(p-2+c)%c,g=(p+2)%c,x=l[m],v=l[m+1],E=l[p],A=l[p+1],C=l[g],w=l[g+1],k=x-E,N=v-A,D=C-E,H=w-A,z=k*k+N*N,F=D*D+H*H;if(z<1e-12||F<1e-12)continue;let I=(k*D+N*H)/Math.sqrt(z*F);I<-1?I=-1:I>1&&(I=1);const V=Math.sqrt((1-I)*.5);if(V<1e-6)continue;const X=Math.min(1/V,e);X>n&&(n=X)}}return n}const U6=new Dr,hw=new jt,$_=class ro extends ho{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=gi("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new tc,this._transform=new jt,this._fillStyle={...ro.defaultFillStyle},this._strokeStyle={...ro.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new Ds,this._boundsDirty=!0}clone(){const e=new ro;return e.batchMode=this.batchMode,e.instructions=this.instructions.slice(),e._activePath=this._activePath.clone(),e._transform=this._transform.clone(),e._fillStyle={...this._fillStyle},e._strokeStyle={...this._strokeStyle},e._stateStack=this._stateStack.slice(),e._bounds=this._bounds.clone(),e._boundsDirty=!0,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=ff(e,ro.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=_0(e,ro.defaultStrokeStyle)}setFillStyle(e){return this._fillStyle=ff(e,ro.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=ff(e,ro.defaultStrokeStyle),this}texture(e,n,i,r,s,l){return this.instructions.push({action:"texture",data:{image:e,dx:i||0,dy:r||0,dw:s||e.frame.width,dh:l||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:n||n===0?Gi.shared.setValue(n).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new tc,this}fill(e,n){let i;const r=this.instructions[this.instructions.length-1];return this._tick===0&&(r==null?void 0:r.action)==="stroke"?i=r.data.path:i=this._activePath.clone(),i?(e!=null&&(n!==void 0&&typeof e=="number"&&(Qt(mi,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:n}),this._fillStyle=ff(e,ro.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:i}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:e,y:n}=this._activePath.getLastPoint(Dr.shared);this._activePath.clear(),this._activePath.moveTo(e,n)}stroke(e){let n;const i=this.instructions[this.instructions.length-1];return this._tick===0&&(i==null?void 0:i.action)==="fill"?n=i.data.path:n=this._activePath.clone(),n?(e!=null&&(this._strokeStyle=_0(e,ro.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){const n=this.instructions[this.instructions.length-1-e],i=this._activePath.clone();if(n&&(n.action==="stroke"||n.action==="fill"))if(n.data.hole)n.data.hole.addPath(i);else{n.data.hole=i;break}}return this._initNextPathLocation(),this}arc(e,n,i,r,s,l){this._tick++;const c=this._transform;return this._activePath.arc(c.a*e+c.c*n+c.tx,c.b*e+c.d*n+c.ty,i,r,s,l),this}arcTo(e,n,i,r,s){this._tick++;const l=this._transform;return this._activePath.arcTo(l.a*e+l.c*n+l.tx,l.b*e+l.d*n+l.ty,l.a*i+l.c*r+l.tx,l.b*i+l.d*r+l.ty,s),this}arcToSvg(e,n,i,r,s,l,c){this._tick++;const d=this._transform;return this._activePath.arcToSvg(e,n,i,r,s,d.a*l+d.c*c+d.tx,d.b*l+d.d*c+d.ty),this}bezierCurveTo(e,n,i,r,s,l,c){this._tick++;const d=this._transform;return this._activePath.bezierCurveTo(d.a*e+d.c*n+d.tx,d.b*e+d.d*n+d.ty,d.a*i+d.c*r+d.tx,d.b*i+d.d*r+d.ty,d.a*s+d.c*l+d.tx,d.b*s+d.d*l+d.ty,c),this}closePath(){var e;return this._tick++,(e=this._activePath)==null||e.closePath(),this}ellipse(e,n,i,r){return this._tick++,this._activePath.ellipse(e,n,i,r,this._transform.clone()),this}circle(e,n,i){return this._tick++,this._activePath.circle(e,n,i,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,n){this._tick++;const i=this._transform;return this._activePath.lineTo(i.a*e+i.c*n+i.tx,i.b*e+i.d*n+i.ty),this}moveTo(e,n){this._tick++;const i=this._transform,r=this._activePath.instructions,s=i.a*e+i.c*n+i.tx,l=i.b*e+i.d*n+i.ty;return r.length===1&&r[0].action==="moveTo"?(r[0].data[0]=s,r[0].data[1]=l,this):(this._activePath.moveTo(s,l),this)}quadraticCurveTo(e,n,i,r,s){this._tick++;const l=this._transform;return this._activePath.quadraticCurveTo(l.a*e+l.c*n+l.tx,l.b*e+l.d*n+l.ty,l.a*i+l.c*r+l.tx,l.b*i+l.d*r+l.ty,s),this}rect(e,n,i,r){return this._tick++,this._activePath.rect(e,n,i,r,this._transform.clone()),this}roundRect(e,n,i,r,s){return this._tick++,this._activePath.roundRect(e,n,i,r,s,this._transform.clone()),this}poly(e,n){return this._tick++,this._activePath.poly(e,n,this._transform.clone()),this}regularPoly(e,n,i,r,s=0,l){return this._tick++,this._activePath.regularPoly(e,n,i,r,s,l),this}roundPoly(e,n,i,r,s,l){return this._tick++,this._activePath.roundPoly(e,n,i,r,s,l),this}roundShape(e,n,i,r){return this._tick++,this._activePath.roundShape(e,n,i,r),this}filletRect(e,n,i,r,s){return this._tick++,this._activePath.filletRect(e,n,i,r,s),this}chamferRect(e,n,i,r,s,l){return this._tick++,this._activePath.chamferRect(e,n,i,r,s,l),this}star(e,n,i,r,s=0,l=0){return this._tick++,this._activePath.star(e,n,i,r,s,l,this._transform.clone()),this}svg(e){return this._tick++,R6(e,this),this}restore(){const e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,n=e){return this._transform.scale(e,n),this}setTransform(e,n,i,r,s,l){return e instanceof jt?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,n,i,r,s,l),this)}transform(e,n,i,r,s,l){return e instanceof jt?(this._transform.append(e),this):(hw.set(e,n,i,r,s,l),this._transform.append(hw),this)}translate(e,n=e){return this._transform.translate(e,n),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;const e=this._bounds;e.clear();for(let n=0;n<this.instructions.length;n++){const i=this.instructions[n],r=i.action;if(r==="fill"){const s=i.data;e.addBounds(s.path.bounds)}else if(r==="texture"){const s=i.data;e.addFrame(s.dx,s.dy,s.dx+s.dw,s.dy+s.dh,s.transform)}if(r==="stroke"){const s=i.data,l=s.style.alignment;let c=s.style.width*(1-l);s.style.join==="miter"&&(c*=L6(s.path,s.style.miterLimit));const d=s.path.bounds;e.addFrame(d.minX-c,d.minY-c,d.maxX+c,d.maxY+c)}}return e.isValid||e.set(0,0,0,0),e}containsPoint(e){var r;if(!this.bounds.containsPoint(e.x,e.y))return!1;const n=this.instructions;let i=!1;for(let s=0;s<n.length;s++){const l=n[s],c=l.data,d=c.path;if(!l.action||!d)continue;const p=c.style,m=d.shapePath.shapePrimitives;for(let g=0;g<m.length;g++){const x=m[g].shape;if(!p||!x)continue;const v=m[g].transform,E=v?v.applyInverse(e,U6):e;if(l.action==="fill")i=x.contains(E.x,E.y);else{const C=p;i=x.strokeContains(E.x,E.y,C.width,C.alignment)}const A=c.hole;if(A){const C=(r=A.shapePath)==null?void 0:r.shapePrimitives;if(C)for(let w=0;w<C.length;w++)C[w].shape.contains(E.x,E.y)&&(i=!1)}if(i)return!0}}return i}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null)}destroy(e=!1){if(this.destroyed)return;if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners(),typeof e=="boolean"?e:e==null?void 0:e.texture){const i=typeof e=="boolean"?e:e==null?void 0:e.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(i)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(i))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};$_.defaultFillStyle={color:16777215,alpha:1,texture:Tn.WHITE,matrix:null,fill:null,textureSpace:"local"};$_.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:Tn.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let fl=$_;class I6{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class H6{constructor(){this.instructions=new I_}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const Q_=class Wv{constructor(e){this._renderer=e,this._managedContexts=new Ym({renderer:e,type:"resource",name:"graphicsContext"})}init(e){Wv.defaultOptions.bezierSmoothness=(e==null?void 0:e.bezierSmoothness)??Wv.defaultOptions.bezierSmoothness}getContextRenderData(e){return this.getGpuContext(e).graphicsData||this._initContextRenderData(e)}updateGpuContext(e){const n=e._gpuData,i=!!n[this._renderer.uid],r=n[this._renderer.uid]||this._initContext(e);return(e.dirty||!i)&&(i&&r.reset(),r.isBatchable=!1,e.dirty=!1),r}getGpuContext(e){return e._gpuData[this._renderer.uid]||this._initContext(e)}_initContextRenderData(e){const n=new H6,i=this.getGpuContext(e);return i.graphicsData=n,n.init(),n}_initContext(e){const n=new I6;return n.context=e,e._gpuData[this._renderer.uid]=n,this._managedContexts.add(e),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};Q_.extension={type:[Nt.CanvasSystem],name:"graphicsContext"};Q_.defaultOptions={bezierSmoothness:.5};let j6=Q_;class qA{constructor(e,n){this.state=G_.for2d(),this.renderer=e,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new Ym({renderer:e,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(e){return!1}addRenderable(e,n){this._managedGraphics.add(e),this.renderer.renderPipes.batch.break(n),n.add(e)}updateRenderable(e){}execute(e){e.isRenderable&&this._adaptor.execute(this,e)}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null}}qA.extension={type:[Nt.CanvasPipes],name:"graphics"};function P6(t,e,n){const i=(t>>24&255)/255;e[n++]=(t&255)/255*i,e[n++]=(t>>8&255)/255*i,e[n++]=(t>>16&255)/255*i,e[n++]=i}class G6{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(e=>{Na.return(e)}),this.batches.length=0}}class YA{constructor(e,n){this.state=G_.for2d(),this.renderer=e,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new Ym({renderer:e,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(e){const n=e.context,i=!!e._gpuData,s=this.renderer.graphicsContext.updateGpuContext(n);return!!(s.isBatchable||i!==s.isBatchable)}addRenderable(e,n){const r=this.renderer.graphicsContext.updateGpuContext(e.context);e.didViewUpdate&&this._rebuild(e),r.isBatchable?this._addToBatcher(e,n):(this.renderer.renderPipes.batch.break(n),n.add(e))}updateRenderable(e){const i=this._getGpuDataForRenderable(e).batches;for(let r=0;r<i.length;r++){const s=i[r];s._batcher.updateElement(s)}}execute(e){if(!e.isRenderable)return;const n=this.renderer,i=e.context;if(!n.graphicsContext.getGpuContext(i).batches.length)return;const s=i.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;const l=s.resources.localUniforms.uniforms;l.uTransformMatrix=e.groupTransform,l.uRound=n._roundPixels|e._roundPixels,P6(e.groupColorAlpha,l.uColor,0),this._adaptor.execute(this,e)}_rebuild(e){const n=this._getGpuDataForRenderable(e),r=this.renderer.graphicsContext.updateGpuContext(e.context);n.destroy(),r.isBatchable&&this._updateBatchesForRenderable(e,n)}_addToBatcher(e,n){const i=this.renderer.renderPipes.batch,r=this._getGpuDataForRenderable(e).batches;for(let s=0;s<r.length;s++){const l=r[s];i.addToBatch(l,n)}}_getGpuDataForRenderable(e){return e._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(e)}_initGpuDataForRenderable(e){const n=new G6;return e._gpuData[this.renderer.uid]=n,this._managedGraphics.add(e),n}_updateBatchesForRenderable(e,n){const i=e.context,s=this.renderer.graphicsContext.getGpuContext(i),l=this.renderer._roundPixels|e._roundPixels;n.batches=s.batches.map(c=>{const d=Na.get(X_);return c.copyTo(d),d.renderable=e,d.roundPixels=l,d})}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}YA.extension={type:[Nt.WebGLPipes,Nt.WebGPUPipes],name:"graphics"};si.add(qA);si.add(YA);si.add(j6);si.add(Z_);class Aa extends H_{constructor(e){e instanceof fl&&(e={context:e});const{context:n,roundPixels:i,...r}=e||{};super({label:"Graphics",...r}),this.renderPipeId="graphics",n?this.context=n:(this.context=this._ownedContext=new fl,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=i??!1}set context(e){e!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=e,this._context.on("update",this.onViewUpdate,this),this._context.on("unload",this.unload,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(e){return this._context.containsPoint(e)}destroy(e){this._ownedContext&&!e?this._ownedContext.destroy(e):(e===!0||(e==null?void 0:e.context)===!0)&&this._context.destroy(e),this._ownedContext=null,this._context=null,super.destroy(e)}_onTouch(e){this._gcLastUsed=e,this._context._gcLastUsed=e}_callContextMethod(e,n){return this.context[e](...n),this}setFillStyle(...e){return this._callContextMethod("setFillStyle",e)}setStrokeStyle(...e){return this._callContextMethod("setStrokeStyle",e)}fill(...e){return this._callContextMethod("fill",e)}stroke(...e){return this._callContextMethod("stroke",e)}texture(...e){return this._callContextMethod("texture",e)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...e){return this._callContextMethod("arc",e)}arcTo(...e){return this._callContextMethod("arcTo",e)}arcToSvg(...e){return this._callContextMethod("arcToSvg",e)}bezierCurveTo(...e){return this._callContextMethod("bezierCurveTo",e)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...e){return this._callContextMethod("ellipse",e)}circle(...e){return this._callContextMethod("circle",e)}path(...e){return this._callContextMethod("path",e)}lineTo(...e){return this._callContextMethod("lineTo",e)}moveTo(...e){return this._callContextMethod("moveTo",e)}quadraticCurveTo(...e){return this._callContextMethod("quadraticCurveTo",e)}rect(...e){return this._callContextMethod("rect",e)}roundRect(...e){return this._callContextMethod("roundRect",e)}poly(...e){return this._callContextMethod("poly",e)}regularPoly(...e){return this._callContextMethod("regularPoly",e)}roundPoly(...e){return this._callContextMethod("roundPoly",e)}roundShape(...e){return this._callContextMethod("roundShape",e)}filletRect(...e){return this._callContextMethod("filletRect",e)}chamferRect(...e){return this._callContextMethod("chamferRect",e)}star(...e){return this._callContextMethod("star",e)}svg(...e){return this._callContextMethod("svg",e)}restore(...e){return this._callContextMethod("restore",e)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...e){return this._callContextMethod("rotate",e)}scaleTransform(...e){return this._callContextMethod("scale",e)}setTransform(...e){return this._callContextMethod("setTransform",e)}transform(...e){return this._callContextMethod("transform",e)}translateTransform(...e){return this._callContextMethod("translate",e)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(e){this._context.fillStyle=e}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(e){this._context.strokeStyle=e}clone(e=!1){return e?new Aa(this._context.clone()):(this._ownedContext=null,new Aa(this._context))}lineStyle(e,n,i){Qt(mi,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const r={};return e&&(r.width=e),n&&(r.color=n),i&&(r.alpha=i),this.context.strokeStyle=r,this}beginFill(e,n){Qt(mi,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const i={};return e!==void 0&&(i.color=e),n!==void 0&&(i.alpha=n),this.context.fillStyle=i,this}endFill(){Qt(mi,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const e=this.context.strokeStyle;return(e.width!==fl.defaultStrokeStyle.width||e.color!==fl.defaultStrokeStyle.color||e.alpha!==fl.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...e){return Qt(mi,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",e)}drawEllipse(...e){return Qt(mi,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",e)}drawPolygon(...e){return Qt(mi,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",e)}drawRect(...e){return Qt(mi,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",e)}drawRoundedRect(...e){return Qt(mi,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",e)}drawStar(...e){return Qt(mi,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",e)}}class F6 extends H_{constructor(e,n){const{text:i,resolution:r,style:s,anchor:l,width:c,height:d,roundPixels:p,...m}=e;super({...m}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=n,this.text=i??"",this.style=s,this.resolution=r??null,this.allowChildren=!1,this._anchor=new yr({_onUpdate:()=>{this.onViewUpdate()}}),l&&(this.anchor=l),this.roundPixels=p??!1,c!==void 0&&(this.width=c),d!==void 0&&(this.height=d)}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}set text(e){e=e.toString(),this._text!==e&&(this._text=e,this.onViewUpdate())}get text(){return this._text}set resolution(e){this._autoResolution=e===null,this._resolution=e,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(e){var n;e||(e={}),(n=this._style)==null||n.off("update",this.onViewUpdate,this),e instanceof this._styleClass?this._style=e:this._style=new this._styleClass(e),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(e){this._setWidth(e,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(e){this._setHeight(e,this.bounds.height)}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this.bounds.width,e.height=Math.abs(this.scale.y)*this.bounds.height,e}setSize(e,n){typeof e=="object"?(n=e.height??e.width,e=e.width):n??(n=e),e!==void 0&&this._setWidth(e,this.bounds.width),n!==void 0&&this._setHeight(n,this.bounds.height)}containsPoint(e){const n=this.bounds.width,i=this.bounds.height,r=-n*this.anchor.x;let s=0;return e.x>=r&&e.x<=r+n&&(s=-i*this.anchor.y,e.y>=s&&e.y<=s+i)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()}destroy(e=!1){super.destroy(e),this.owner=null,this._bounds=null,this._anchor=null,(typeof e=="boolean"?e:e!=null&&e.style)&&this._style.destroy(e),this._style=null,this._text=null}get styleKey(){return`${this._text}:${this._style.styleKey}:${this._resolution}`}}function q6(t,e){let n=t[0]??{};return(typeof n=="string"||t[1])&&(Qt(mi,`use new ${e}({ text: "hi!", style }) instead`),n={text:n,style:t[1]}),n}class Y6{constructor(e){this._canvasPool=Object.create(null),this.canvasOptions=e||{},this.enableFullScreen=!1}_createCanvasAndContext(e,n){const i=Ja.get().createCanvas();i.width=e,i.height=n;const r=i.getContext("2d");return{canvas:i,context:r}}getOptimalCanvasAndContext(e,n,i=1){e=Math.ceil(e*i-1e-6),n=Math.ceil(n*i-1e-6),e=eh(e),n=eh(n);const r=(e<<17)+(n<<1);this._canvasPool[r]||(this._canvasPool[r]=[]);let s=this._canvasPool[r].pop();return s||(s=this._createCanvasAndContext(e,n)),s}returnCanvasAndContext(e){const n=e.canvas,{width:i,height:r}=n,s=(i<<17)+(r<<1);e.context.resetTransform(),e.context.clearRect(0,0,i,r),this._canvasPool[s].push(e)}clear(){this._canvasPool={}}}const Zv=new Y6;Fm.register(Zv);let ef=null,Qo=null;function V6(t,e){ef||(ef=Ja.get().createCanvas(256,128),Qo=ef.getContext("2d",{willReadFrequently:!0}),Qo.globalCompositeOperation="copy",Qo.globalAlpha=1),(ef.width<t||ef.height<e)&&(ef.width=eh(t),ef.height=eh(e))}function pw(t,e,n){for(let i=0,r=4*n*e;i<e;++i,r+=4)if(t[r+3]!==0)return!1;return!0}function mw(t,e,n,i,r){const s=4*e;for(let l=i,c=i*s+4*n;l<=r;++l,c+=s)if(t[c+3]!==0)return!1;return!0}function X6(...t){let e=t[0];e.canvas||(e={canvas:t[0],resolution:t[1]});const{canvas:n}=e,i=Math.min(e.resolution??1,1),r=e.width??n.width,s=e.height??n.height;let l=e.output;if(V6(r,s),!Qo)throw new TypeError("Failed to get canvas 2D context");Qo.drawImage(n,0,0,r,s,0,0,r*i,s*i);const d=Qo.getImageData(0,0,r,s).data;let p=0,m=0,g=r-1,x=s-1;for(;m<s&&pw(d,r,m);)++m;if(m===s)return Ei.EMPTY;for(;pw(d,r,x);)--x;for(;mw(d,r,p,m,x);)++p;for(;mw(d,r,g,m,x);)--g;return++g,++x,Qo.globalCompositeOperation="source-over",Qo.strokeRect(p,m,g-p,x-m),Qo.globalCompositeOperation="copy",l??(l=new Ei),l.set(p/i,m/i,(g-p)/i,(x-m)/i),l}/**
299
- * tiny-lru
300
- *
301
- * @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
302
- * @license BSD-3-Clause
303
- * @version 11.4.7
304
- */class K6{constructor(e=0,n=0,i=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=e,this.resetTtl=i,this.size=0,this.ttl=n}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(e){if(this.has(e)){const n=this.items[e];delete this.items[e],this.size--,n.prev!==null&&(n.prev.next=n.next),n.next!==null&&(n.next.prev=n.prev),this.first===n&&(this.first=n.next),this.last===n&&(this.last=n.prev)}return this}entries(e=this.keys()){const n=new Array(e.length);for(let i=0;i<e.length;i++){const r=e[i];n[i]=[r,this.get(r)]}return n}evict(e=!1){if(e||this.size>0){const n=this.first;delete this.items[n.key],--this.size===0?(this.first=null,this.last=null):(this.first=n.next,this.first.prev=null)}return this}expiresAt(e){let n;return this.has(e)&&(n=this.items[e].expiry),n}get(e){const n=this.items[e];if(n!==void 0){if(this.ttl>0&&n.expiry<=Date.now()){this.delete(e);return}return this.moveToEnd(n),n.value}}has(e){return e in this.items}moveToEnd(e){this.last!==e&&(e.prev!==null&&(e.prev.next=e.next),e.next!==null&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),e.prev=this.last,e.next=null,this.last!==null&&(this.last.next=e),this.last=e,this.first===null&&(this.first=e))}keys(){const e=new Array(this.size);let n=this.first,i=0;for(;n!==null;)e[i++]=n.key,n=n.next;return e}setWithEvicted(e,n,i=this.resetTtl){let r=null;if(this.has(e))this.set(e,n,!0,i);else{this.max>0&&this.size===this.max&&(r={...this.first},this.evict(!0));let s=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:n};++this.size===1?this.first=s:this.last.next=s,this.last=s}return r}set(e,n,i=!1,r=this.resetTtl){let s=this.items[e];return i||s!==void 0?(s.value=n,i===!1&&r&&(s.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(s)):(this.max>0&&this.size===this.max&&this.evict(!0),s=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:n},++this.size===1?this.first=s:this.last.next=s,this.last=s),this}values(e=this.keys()){const n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=this.get(e[i]);return n}}function W6(t=1e3,e=0,n=!1){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");if(typeof n!="boolean")throw new TypeError("Invalid resetTtl value");return new K6(t,e,n)}function VA(t){return!!t.tagStyles&&Object.keys(t.tagStyles).length>0}function XA(t){return t.includes("<")}function Z6(t,e){return t.clone().assign(e)}function $6(t,e){const n=[],i=e.tagStyles;if(!VA(e)||!XA(t))return n.push({text:t,style:e}),n;const r=[e],s=[];let l="",c=0;for(;c<t.length;){const d=t[c];if(d==="<"){const p=t.indexOf(">",c);if(p===-1){l+=d,c++;continue}const m=t.slice(c+1,p);if(m.startsWith("/")){const g=m.slice(1).trim();if(s.length>0&&s[s.length-1]===g){l.length>0&&(n.push({text:l,style:r[r.length-1]}),l=""),r.pop(),s.pop(),c=p+1;continue}else{l+=t.slice(c,p+1),c=p+1;continue}}else{const g=m.trim();if(i[g]){l.length>0&&(n.push({text:l,style:r[r.length-1]}),l="");const x=r[r.length-1],v=Z6(x,i[g]);r.push(v),s.push(g),c=p+1;continue}else{l+=t.slice(c,p+1),c=p+1;continue}}}else l+=d,c++}return l.length>0&&n.push({text:l,style:r[r.length-1]}),n}const Q6=[10,13],J6=new Set(Q6),eB=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],tB=new Set(eB),nB=[9,32];new Set(nB);const iB=[45,8208,8211,8212,173],rB=new Set(iB),aB=/(\r\n|\r|\n)/,sB=/(?:\r\n|\r|\n)/;function S0(t){return typeof t!="string"?!1:J6.has(t.charCodeAt(0))}function Os(t,e){return typeof t!="string"?!1:tB.has(t.charCodeAt(0))}function lB(t){return typeof t!="string"?!1:rB.has(t.charCodeAt(0))}function KA(t){return t==="normal"||t==="pre-line"}function WA(t){return t==="normal"}function $o(t){if(typeof t!="string")return"";let e=t.length-1;for(;e>=0&&Os(t[e]);)e--;return e<t.length-1?t.slice(0,e+1):t}function ZA(t){const e=[],n=[];if(typeof t!="string")return e;for(let i=0;i<t.length;i++){const r=t[i],s=t[i+1];if(Os(r)||S0(r)){n.length>0&&(e.push(n.join("")),n.length=0),r==="\r"&&s===`
305
- `?(e.push(`\r
306
- `),i++):e.push(r);continue}n.push(r),lB(r)&&s&&!Os(s)&&!S0(s)&&(e.push(n.join("")),n.length=0)}return n.length>0&&e.push(n.join("")),e}function $A(t,e,n,i){const r=n(t),s=[];for(let l=0;l<r.length;l++){let c=r[l],d=c,p=1;for(;r[l+p];){const m=r[l+p];if(!i(d,m,t,l,e))c+=m,d=m,p++;else break}l+=p-1,s.push(c)}return s}const oB=/\r\n|\r|\n/g;function cB(t,e,n,i,r,s,l,c){var Q,B;const d=$6(t,e);if(WA(e.whiteSpace))for(let Y=0;Y<d.length;Y++){const Z=d[Y];d[Y]={text:Z.text.replace(oB," "),style:Z.style}}const m=[];let g=[];for(const Y of d){const Z=Y.text.split(aB);for(let $=0;$<Z.length;$++){const j=Z[$];j===`\r
307
- `||j==="\r"||j===`
308
- `?(m.push(g),g=[]):j.length>0&&g.push({text:j,style:Y.style})}}(g.length>0||m.length===0)&&m.push(g);const x=n?uB(m,e,i,r,l,c):m,v=[],E=[],A=[],C=[],w=[];let k=0;const N=e._fontString,D=s(N);D.fontSize===0&&(D.fontSize=e.fontSize,D.ascent=e.fontSize);let H="",z=!!e.dropShadow,F=((Q=e._stroke)==null?void 0:Q.width)||0;for(const Y of x){let Z=0,$=D.ascent,j=D.descent,K="";for(const U of Y){const le=U.style._fontString,de=s(le);le!==H&&(i.font=le,H=le);const ge=r(U.text,U.style.letterSpacing,i);Z+=ge,$=Math.max($,de.ascent),j=Math.max(j,de.descent),K+=U.text;const se=((B=U.style._stroke)==null?void 0:B.width)||0;se>F&&(F=se),!z&&U.style.dropShadow&&(z=!0)}Y.length===0&&($=D.ascent,j=D.descent),v.push(Z),E.push($),A.push(j),w.push(K);const te=e.lineHeight||$+j;C.push(te+e.leading),k=Math.max(k,Z)}const ee=F,V=(n&&e.align!=="left"?Math.max(k,e.wordWrapWidth):k)+ee+(e.dropShadow?e.dropShadow.distance:0);let X=0;for(let Y=0;Y<C.length;Y++)X+=C[Y];X=Math.max(X,C[0]+ee);const ne=X+(e.dropShadow?e.dropShadow.distance:0),q=e.lineHeight||D.fontSize;return{width:V,height:ne,lines:w,lineWidths:v,lineHeight:q+e.leading,maxLineWidth:k,fontProperties:D,runsByLine:x,lineAscents:E,lineDescents:A,lineHeights:C,hasDropShadow:z}}function uB(t,e,n,i,r,s){var C;const{letterSpacing:l,whiteSpace:c,wordWrapWidth:d,breakWords:p}=e,m=KA(c),g=d+l,x={};let v="";const E=(w,k)=>{const N=`${w}|${k.styleKey}`;let D=x[N];if(D===void 0){const H=k._fontString;H!==v&&(n.font=H,v=H),D=i(w,k.letterSpacing,n)+k.letterSpacing,x[N]=D}return D},A=[];for(const w of t){const k=fB(w),N=A.length,D=X=>{let ne=0,q=X;do{const{token:Q,style:B}=k[q];ne+=E(Q,B),q++}while(q<k.length&&k[q].continuesFromPrevious);return ne},H=X=>{const ne=[];let q=X;do ne.push({token:k[q].token,style:k[q].style}),q++;while(q<k.length&&k[q].continuesFromPrevious);return ne};let z=[],F=0,ee=!m,P=null;const I=()=>{P&&P.text.length>0&&z.push(P),P=null},V=()=>{if(I(),z.length>0){const X=z[z.length-1];X.text=$o(X.text),X.text.length===0&&z.pop()}A.push(z),z=[],F=0,ee=!1};for(let X=0;X<k.length;X++){const{token:ne,style:q,continuesFromPrevious:Q}=k[X],B=E(ne,q);if(m){const $=Os(ne),j=(P==null?void 0:P.text[P.text.length-1])??((C=z[z.length-1])==null?void 0:C.text.slice(-1))??"",K=j?Os(j):!1;if($&&K)continue}const Y=!Q,Z=Y?D(X):B;if(Z>g&&Y)if(F>0&&V(),p){const $=H(X);for(let j=0;j<$.length;j++){const K=$[j].token,te=$[j].style,U=$A(K,p,s,r);for(const le of U){const de=E(le,te);de+F>g&&V(),!P||P.style!==te?(I(),P={text:le,style:te}):P.text+=le,F+=de}}X+=$.length-1}else{const $=H(X);I(),A.push($.map(j=>({text:j.token,style:j.style}))),ee=!1,X+=$.length-1}else if(Z+F>g&&Y){if(Os(ne)){ee=!1;continue}V(),P={text:ne,style:q},F=B}else if(Q&&!p)!P||P.style!==q?(I(),P={text:ne,style:q}):P.text+=ne,F+=B;else{const $=Os(ne);if(F===0&&$&&!ee)continue;!P||P.style!==q?(I(),P={text:ne,style:q}):P.text+=ne,F+=B}}if(I(),z.length>0){const X=z[z.length-1];X.text=$o(X.text),X.text.length===0&&z.pop()}(z.length>0||A.length===N)&&A.push(z)}return A}function fB(t){const e=[];let n=!1;for(const i of t){const r=ZA(i.text);let s=!0;for(const l of r){const c=Os(l)||S0(l),d=s&&n&&!c;e.push({token:l,style:i.style,continuesFromPrevious:d}),n=!c,s=!1}}return e}const dB={willReadFrequently:!0};function gw(t,e,n,i,r){let s=n[t];return typeof s!="number"&&(s=r(t,e,i)+e,n[t]=s),s}function hB(t,e,n,i,r,s,l){const c=n.getContext("2d",dB);c.font=e._fontString;let d=0,p="";const m=[],g=Object.create(null),{letterSpacing:x,whiteSpace:v}=e,E=KA(v),A=WA(v);let C=!E;const w=e.wordWrapWidth+x,k=ZA(t);for(let D=0;D<k.length;D++){let H=k[D];if(S0(H)){if(!A){m.push($o(p)),C=!E,p="",d=0;continue}H=" "}if(E){const F=Os(H),ee=Os(p[p.length-1]);if(F&&ee)continue}const z=gw(H,x,g,c,i);if(z>w)if(p!==""&&(m.push($o(p)),p="",d=0),r(H,e.breakWords)){const F=$A(H,e.breakWords,l,s);for(const ee of F){const P=gw(ee,x,g,c,i);P+d>w&&(m.push($o(p)),C=!1,p="",d=0),p+=ee,d+=P}}else p.length>0&&(m.push($o(p)),p="",d=0),m.push($o(H)),C=!1,p="",d=0;else z+d>w&&(C=!1,m.push($o(p)),p="",d=0),(p.length>0||!Os(H)||C)&&(p+=H,d+=z)}const N=$o(p);return N.length>0&&m.push(N),m.join(`
309
- `)}const yw={willReadFrequently:!0},ac=class pt{static get experimentalLetterSpacingSupported(){let e=pt._experimentalLetterSpacingSupported;if(e===void 0){const n=Ja.get().getCanvasRenderingContext2D().prototype;e=pt._experimentalLetterSpacingSupported="letterSpacing"in n||"textLetterSpacing"in n}return e}constructor(e,n,i,r,s,l,c,d,p,m){this.text=e,this.style=n,this.width=i,this.height=r,this.lines=s,this.lineWidths=l,this.lineHeight=c,this.maxLineWidth=d,this.fontProperties=p,m&&(this.runsByLine=m.runsByLine,this.lineAscents=m.lineAscents,this.lineDescents=m.lineDescents,this.lineHeights=m.lineHeights,this.hasDropShadow=m.hasDropShadow)}static measureText(e=" ",n,i=pt._canvas,r=n.wordWrap){var H;const s=`${e}-${n.styleKey}-wordWrap-${r}`;if(pt._measurementCache.has(s))return pt._measurementCache.get(s);if(VA(n)&&XA(e)){const z=cB(e,n,r,pt._context,pt._measureText,pt.measureFont,pt.canBreakChars,pt.wordWrapSplit),F=new pt(e,n,z.width,z.height,z.lines,z.lineWidths,z.lineHeight,z.maxLineWidth,z.fontProperties,{runsByLine:z.runsByLine,lineAscents:z.lineAscents,lineDescents:z.lineDescents,lineHeights:z.lineHeights,hasDropShadow:z.hasDropShadow});return pt._measurementCache.set(s,F),F}const c=n._fontString,d=pt.measureFont(c);d.fontSize===0&&(d.fontSize=n.fontSize,d.ascent=n.fontSize,d.descent=0);const p=pt._context;p.font=c;const g=(r?pt._wordWrap(e,n,i):e).split(sB),x=new Array(g.length);let v=0;for(let z=0;z<g.length;z++){const F=pt._measureText(g[z],n.letterSpacing,p);x[z]=F,v=Math.max(v,F)}const E=((H=n._stroke)==null?void 0:H.width)??0,A=n.lineHeight||d.fontSize,C=pt._getAlignWidth(v,n,r),w=pt._adjustWidthForStyle(C,n),k=Math.max(A,d.fontSize+E)+(g.length-1)*(A+n.leading),N=pt._adjustHeightForStyle(k,n),D=new pt(e,n,w,N,g,x,A+n.leading,v,d);return pt._measurementCache.set(s,D),D}static _adjustWidthForStyle(e,n){var s;const i=((s=n._stroke)==null?void 0:s.width)||0;let r=e+i;return n.dropShadow&&(r+=n.dropShadow.distance),r}static _adjustHeightForStyle(e,n){let i=e;return n.dropShadow&&(i+=n.dropShadow.distance),i}static _getAlignWidth(e,n,i){return i&&n.align!=="left"?Math.max(e,n.wordWrapWidth):e}static _measureText(e,n,i){let r=!1;pt.experimentalLetterSpacingSupported&&(pt.experimentalLetterSpacing?(i.letterSpacing=`${n}px`,i.textLetterSpacing=`${n}px`,r=!0):(i.letterSpacing="0px",i.textLetterSpacing="0px"));const s=i.measureText(e);let l=s.width;const c=-(s.actualBoundingBoxLeft??0);let p=(s.actualBoundingBoxRight??0)-c;if(l>0)if(r)l-=n,p-=n;else{const m=(pt.graphemeSegmenter(e).length-1)*n;l+=m,p+=m}return Math.max(l,p)}static _wordWrap(e,n,i=pt._canvas){return hB(e,n,i,pt._measureText,pt.canBreakWords,pt.canBreakChars,pt.wordWrapSplit)}static isBreakingSpace(e,n){return Os(e)}static canBreakWords(e,n){return n}static canBreakChars(e,n,i,r,s){return!0}static wordWrapSplit(e){return pt.graphemeSegmenter(e)}static measureFont(e){if(pt._fonts[e])return pt._fonts[e];const n=pt._context;n.font=e;const i=n.measureText(pt.METRICS_STRING+pt.BASELINE_SYMBOL),r=i.actualBoundingBoxAscent??0,s=i.actualBoundingBoxDescent??0,l={ascent:r,descent:s,fontSize:r+s};return pt._fonts[e]=l,l}static clearMetrics(e=""){e?delete pt._fonts[e]:pt._fonts={}}static get _canvas(){if(!pt.__canvas){let e;try{const n=new OffscreenCanvas(0,0),i=n.getContext("2d",yw);if(i!=null&&i.measureText)return pt.__canvas=n,n;e=Ja.get().createCanvas()}catch{e=Ja.get().createCanvas()}e.width=e.height=10,pt.__canvas=e}return pt.__canvas}static get _context(){return pt.__context||(pt.__context=pt._canvas.getContext("2d",yw)),pt.__context}};ac.METRICS_STRING="|ÉqÅ";ac.BASELINE_SYMBOL="M";ac.BASELINE_MULTIPLIER=1.4;ac.HEIGHT_MULTIPLIER=2;ac.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const t=new Intl.Segmenter;return e=>{const n=t.segment(e),i=[];let r=0;for(const s of n)i[r++]=s.segment;return i}}return t=>[...t]})();ac.experimentalLetterSpacing=!1;ac._fonts={};ac._measurementCache=W6(1e3);let eu=ac;const pB=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function $v(t){const e=typeof t.fontSize=="number"?`${t.fontSize}px`:t.fontSize;let n=t.fontFamily;Array.isArray(t.fontFamily)||(n=t.fontFamily.split(","));for(let i=n.length-1;i>=0;i--){let r=n[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!pB.includes(r)&&(r=`"${r}"`),n[i]=r}return`${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${e} ${n.join(",")}`}const bw=1e5;function By(t,e,n,i=0,r=0,s=0){if(t.texture===Tn.WHITE&&!t.fill)return Gi.shared.setValue(t.color).setAlpha(t.alpha??1).toHexa();if(t.fill){if(t.fill instanceof Z0){const l=t.fill,c=e.createPattern(l.texture.source.resource,"repeat"),d=l.transform.copyTo(jt.shared);return d.scale(l.texture.source.pixelWidth,l.texture.source.pixelHeight),c.setTransform(d),c}else if(t.fill instanceof ic){const l=t.fill,c=l.type==="linear",d=l.textureSpace==="local";let p=1,m=1;d&&n&&(p=n.width+i,m=n.height+i);let g,x=!1;if(c){const{start:v,end:E}=l;g=e.createLinearGradient(v.x*p+r,v.y*m+s,E.x*p+r,E.y*m+s),x=Math.abs(E.x-v.x)<Math.abs((E.y-v.y)*.1)}else{const{center:v,innerRadius:E,outerCenter:A,outerRadius:C}=l;g=e.createRadialGradient(v.x*p+r,v.y*m+s,E*p,A.x*p+r,A.y*m+s,C*p)}if(x&&d&&n){const v=n.lineHeight/m;for(let E=0;E<n.lines.length;E++){const A=(E*n.lineHeight+i/2)/m;l.colorStops.forEach(C=>{let w=A+C.offset*v;w=Math.max(0,Math.min(1,w)),g.addColorStop(Math.floor(w*bw)/bw,Gi.shared.setValue(C.color).toHex())})}}else l.colorStops.forEach(v=>{g.addColorStop(v.offset,Gi.shared.setValue(v.color).toHex())});return g}}else{const l=e.createPattern(t.texture.source.resource,"repeat"),c=t.matrix.copyTo(jt.shared);return c.scale(t.texture.source.pixelWidth,t.texture.source.pixelHeight),l.setTransform(c),l}return ca("FillStyle not recognised",t),"red"}const xw=new Ei;function kd(t){let e=0;for(let n=0;n<t.length;n++)t.charCodeAt(n)===32&&e++;return e}class mB{getCanvasAndContext(e){const{text:n,style:i,resolution:r=1}=e,s=i._getFinalPadding(),l=eu.measureText(n||" ",i),c=Math.ceil(Math.ceil(Math.max(1,l.width)+s*2)*r),d=Math.ceil(Math.ceil(Math.max(1,l.height)+s*2)*r),p=Zv.getOptimalCanvasAndContext(c,d);this._renderTextToCanvas(i,s,r,p,l);const m=i.trim?X6({canvas:p.canvas,width:c,height:d,resolution:1,output:xw}):xw.set(0,0,c,d);return{canvasAndContext:p,frame:m}}returnCanvasAndContext(e){Zv.returnCanvasAndContext(e)}_renderTextToCanvas(e,n,i,r,s){var z,F,ee;if(s.runsByLine&&s.runsByLine.length>0){this._renderTaggedTextToCanvas(s,e,n,i,r);return}const{canvas:l,context:c}=r,d=$v(e),p=s.lines,m=s.lineHeight,g=s.lineWidths,x=s.maxLineWidth,v=s.fontProperties,E=l.height;if(c.resetTransform(),c.scale(i,i),c.textBaseline=e.textBaseline,(z=e._stroke)!=null&&z.width){const P=e._stroke;c.lineWidth=P.width,c.miterLimit=P.miterLimit,c.lineJoin=P.join,c.lineCap=P.cap}c.font=d;let A,C;const w=e.dropShadow?2:1,k=e.wordWrap?e.wordWrapWidth:x,D=(((F=e._stroke)==null?void 0:F.width)??0)/2;let H=(m-v.fontSize)/2;m-v.fontSize<0&&(H=0);for(let P=0;P<w;++P){const I=e.dropShadow&&P===0,V=I?Math.ceil(Math.max(1,E)+n*2):0,X=V*i;if(I)this._setupDropShadow(c,e,i,X);else{const ne=e._gradientBounds,q=e._gradientOffset;if(ne){const Q={width:ne.width,height:ne.height,lineHeight:ne.height,lines:s.lines};this._setFillAndStrokeStyles(c,e,Q,n,D,(q==null?void 0:q.x)??0,(q==null?void 0:q.y)??0)}else q?this._setFillAndStrokeStyles(c,e,s,n,D,q.x,q.y):this._setFillAndStrokeStyles(c,e,s,n,D);c.shadowColor="rgba(0,0,0,0)"}for(let ne=0;ne<p.length;ne++){A=D,C=D+ne*m+v.ascent+H,A+=this._getAlignmentOffset(g[ne],k,e.align);let q=0;if(e.align==="justify"&&e.wordWrap&&ne<p.length-1){const Q=kd(p[ne]);Q>0&&(q=(k-g[ne])/Q)}(ee=e._stroke)!=null&&ee.width&&this._drawLetterSpacing(p[ne],e,r,A+n,C+n-V,!0,q),e._fill!==void 0&&this._drawLetterSpacing(p[ne],e,r,A+n,C+n-V,!1,q)}}}_renderTaggedTextToCanvas(e,n,i,r,s){var D,H,z;const{canvas:l,context:c}=s,{runsByLine:d,lineWidths:p,maxLineWidth:m,lineAscents:g,lineHeights:x,hasDropShadow:v}=e,E=l.height;c.resetTransform(),c.scale(r,r),c.textBaseline=n.textBaseline;const A=v?2:1,C=n.wordWrap?n.wordWrapWidth:m;let w=((D=n._stroke)==null?void 0:D.width)??0;for(const F of d)for(const ee of F){const P=((H=ee.style._stroke)==null?void 0:H.width)??0;P>w&&(w=P)}const k=w/2,N=[];for(let F=0;F<d.length;F++){const ee=d[F],P=[];for(const I of ee){const V=$v(I.style);c.font=V,P.push({width:eu._measureText(I.text,I.style.letterSpacing,c),font:V})}N.push(P)}for(let F=0;F<A;++F){const ee=v&&F===0,P=ee?Math.ceil(Math.max(1,E)+i*2):0,I=P*r;ee||(c.shadowColor="rgba(0,0,0,0)");let V=k;for(let X=0;X<d.length;X++){const ne=d[X],q=p[X],Q=g[X],B=x[X],Y=N[X];let Z=k;Z+=this._getAlignmentOffset(q,C,n.align);let $=0;if(n.align==="justify"&&n.wordWrap&&X<d.length-1){let te=0;for(const U of ne)te+=kd(U.text);te>0&&($=(C-q)/te)}const j=V+Q;let K=Z+i;for(let te=0;te<ne.length;te++){const U=ne[te],{width:le,font:de}=Y[te];if(c.font=de,c.textBaseline=U.style.textBaseline,(z=U.style._stroke)!=null&&z.width){const se=U.style._stroke;if(c.lineWidth=se.width,c.miterLimit=se.miterLimit,c.lineJoin=se.join,c.lineCap=se.cap,ee)if(U.style.dropShadow)this._setupDropShadow(c,U.style,r,I);else{const pe=kd(U.text);K+=le+pe*$;continue}else{const pe=eu.measureFont(de),Ae=U.style.lineHeight||pe.fontSize,Le={width:le,height:Ae,lineHeight:Ae,lines:[U.text]};c.strokeStyle=By(se,c,Le,i*2,K-i,V)}this._drawLetterSpacing(U.text,U.style,s,K,j+i-P,!0,$)}const ge=kd(U.text);K+=le+ge*$}K=Z+i;for(let te=0;te<ne.length;te++){const U=ne[te],{width:le,font:de}=Y[te];if(c.font=de,c.textBaseline=U.style.textBaseline,U.style._fill!==void 0){if(ee)if(U.style.dropShadow)this._setupDropShadow(c,U.style,r,I);else{const se=kd(U.text);K+=le+se*$;continue}else{const se=eu.measureFont(de),pe=U.style.lineHeight||se.fontSize,Ae={width:le,height:pe,lineHeight:pe,lines:[U.text]};c.fillStyle=By(U.style._fill,c,Ae,i*2,K-i,V)}this._drawLetterSpacing(U.text,U.style,s,K,j+i-P,!1,$)}const ge=kd(U.text);K+=le+ge*$}V+=B}}}_setFillAndStrokeStyles(e,n,i,r,s,l=0,c=0){var d;if(e.fillStyle=n._fill?By(n._fill,e,i,r*2,l,c):null,(d=n._stroke)!=null&&d.width){const p=s+r*2;e.strokeStyle=By(n._stroke,e,i,p,l,c)}}_setupDropShadow(e,n,i,r){e.fillStyle="black",e.strokeStyle="black";const s=n.dropShadow,l=s.color,c=s.alpha;e.shadowColor=Gi.shared.setValue(l).setAlpha(c).toRgbaString();const d=s.blur*i,p=s.distance*i;e.shadowBlur=d,e.shadowOffsetX=Math.cos(s.angle)*p,e.shadowOffsetY=Math.sin(s.angle)*p+r}_getAlignmentOffset(e,n,i){return i==="right"?n-e:i==="center"?(n-e)/2:0}_drawLetterSpacing(e,n,i,r,s,l=!1,c=0){const{context:d}=i,p=n.letterSpacing;let m=!1;if(eu.experimentalLetterSpacingSupported&&(eu.experimentalLetterSpacing?(d.letterSpacing=`${p}px`,d.textLetterSpacing=`${p}px`,m=!0):(d.letterSpacing="0px",d.textLetterSpacing="0px")),(p===0||m)&&c===0){l?d.strokeText(e,r,s):d.fillText(e,r,s);return}if(c!==0&&(p===0||m)){const A=e.split(" ");let C=r;const w=d.measureText(" ").width;for(let k=0;k<A.length;k++)l?d.strokeText(A[k],C,s):d.fillText(A[k],C,s),C+=d.measureText(A[k]).width+w+c;return}let g=r;const x=eu.graphemeSegmenter(e);let v=d.measureText(e).width,E=0;for(let A=0;A<x.length;++A){const C=x[A];l?d.strokeText(C,g,s):d.fillText(C,g,s);let w="";for(let k=A+1;k<x.length;++k)w+=x[k];E=d.measureText(w).width,g+=v-E+p,C===" "&&(g+=c),v=E}}}const qd=new mB,J_=class of extends ho{constructor(e={}){super(),this.uid=gi("textStyle"),this._tick=0,this._cachedFontString=null,gB(e),e instanceof of&&(e=e._toObject());const r={...of.defaultTextStyle,...e};for(const s in r){const l=s;this[l]=r[s]}this._tagStyles=e.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.update())}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...of.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...of.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.update())}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.update())}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.update())}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.update())}get filters(){return this._filters}set filters(e){this._filters!==e&&(this._filters=Object.freeze(e),this.update())}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.update())}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...fl.defaultFillStyle,...e},()=>{this._fill=ff({...this._originalFill},fl.defaultFillStyle)})),this._fill=ff(e===0?"black":e,fl.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...fl.defaultStrokeStyle,...e},()=>{this._stroke=_0({...this._originalStroke},fl.defaultStrokeStyle)})),this._stroke=_0(e,fl.defaultStrokeStyle),this.update())}get tagStyles(){return this._tagStyles}set tagStyles(e){this._tagStyles!==e&&(this._tagStyles=e??void 0,this.update())}update(){this._tick++,this._cachedFontString=null,this.emit("update",this)}reset(){const e=of.defaultTextStyle;for(const n in e)this[n]=e[n]}assign(e){for(const n in e){const i=n;this[i]=e[n]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return this._cachedFontString===null&&(this._cachedFontString=$v(this)),this._cachedFontString}_toObject(){return{align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill?{...this._fill}:void 0,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke?{...this._stroke}:void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{...this._tagStyles}:void 0}}clone(){return new of(this._toObject())}_getFinalPadding(){let e=0;if(this._filters)for(let n=0;n<this._filters.length;n++)e+=this._filters[n].padding;return Math.max(this._padding,e)}destroy(e=!1){var i,r,s,l;if(this.removeAllListeners(),typeof e=="boolean"?e:e==null?void 0:e.texture){const c=typeof e=="boolean"?e:e==null?void 0:e.textureSource;(i=this._fill)!=null&&i.texture&&this._fill.texture.destroy(c),(r=this._originalFill)!=null&&r.texture&&this._originalFill.texture.destroy(c),(s=this._stroke)!=null&&s.texture&&this._stroke.texture.destroy(c),(l=this._originalStroke)!=null&&l.texture&&this._originalStroke.texture.destroy(c)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(e,n){return new Proxy(e,{set:(i,r,s)=>(i[r]===s||(i[r]=s,n==null||n(r,s),this.update()),!0)})}_isFillStyle(e){return(e??null)!==null&&!(Gi.isColorLike(e)||e instanceof ic||e instanceof Z0)}};J_.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};J_.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let gf=J_;function gB(t){const e=t;if(typeof e.dropShadow=="boolean"&&e.dropShadow){const n=gf.defaultDropShadow;t.dropShadow={alpha:e.dropShadowAlpha??n.alpha,angle:e.dropShadowAngle??n.angle,blur:e.dropShadowBlur??n.blur,color:e.dropShadowColor??n.color,distance:e.dropShadowDistance??n.distance}}if(e.strokeThickness!==void 0){Qt(mi,"strokeThickness is now a part of stroke");const n=e.stroke;let i={};if(Gi.isColorLike(n))i.color=n;else if(n instanceof ic||n instanceof Z0)i.fill=n;else if(Object.hasOwnProperty.call(n,"color")||Object.hasOwnProperty.call(n,"fill"))i=n;else throw new Error("Invalid stroke value.");t.stroke={...i,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){if(Qt(mi,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(e.fill)||e.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");e.fill.length!==e.fillGradientStops.length&&ca("The number of fill colors must match the number of fill gradient stops.");const n=new ic({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),i=e.fillGradientStops.slice(),r=e.fill.map(s=>Gi.shared.setValue(s).toNumber());i.forEach((s,l)=>{n.addColorStop(s,r[l])}),t.fill={fill:n}}}function yB(t,e){const{texture:n,bounds:i}=t,r=e._style._getFinalPadding();UC(i,e._anchor,n);const s=e._anchor._x*r*2,l=e._anchor._y*r*2;i.minX-=r-s,i.minY-=r-l,i.maxX-=r-s,i.maxY-=r-l}class bB{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}destroy(){this.reset()}}class xB extends bB{}class QA{constructor(e){this._renderer=e,e.runners.resolutionChange.add(this),this._managedTexts=new Ym({renderer:e,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"})}resolutionChange(){for(const e in this._managedTexts.items){const n=this._managedTexts.items[e];n!=null&&n._autoResolution&&n.onViewUpdate()}}validateRenderable(e){const n=this._getGpuText(e),i=e.styleKey;return n.currentKey!==i?!0:e._didTextUpdate}addRenderable(e,n){const i=this._getGpuText(e);if(e._didTextUpdate){const r=e._autoResolution?this._renderer.resolution:e.resolution;(i.currentKey!==e.styleKey||e._resolution!==r)&&this._updateGpuText(e),e._didTextUpdate=!1,yB(i,e)}this._renderer.renderPipes.batch.addToBatch(i,n)}updateRenderable(e){const n=this._getGpuText(e);n._batcher.updateElement(n)}_updateGpuText(e){const n=this._getGpuText(e);n.texture&&this._renderer.canvasText.decreaseReferenceCount(n.currentKey),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,n.texture=this._renderer.canvasText.getManagedTexture(e),n.currentKey=e.styleKey}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){const n=new xB;return n.currentKey="--",n.renderable=e,n.transform=e.groupTransform,n.bounds={minX:0,maxX:1,minY:0,maxY:0},n.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=n,this._managedTexts.add(e),n}onTextUnload(e){const n=e._gpuData[this._renderer.uid];if(!n)return;const{canvasText:i}=this._renderer;i.getReferenceCount(n.currentKey)>0?i.decreaseReferenceCount(n.currentKey):n.texture&&i.returnTexture(n.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}}QA.extension={type:[Nt.WebGLPipes,Nt.WebGPUPipes,Nt.CanvasPipes],name:"text"};const vB=new Ds;function _B(t,e,n,i,r=!1){const s=vB;s.minX=0,s.minY=0,s.maxX=t.width/i|0,s.maxY=t.height/i|0;const l=V0.getOptimalTexture(s.width,s.height,i,!1,r);return l.source.uploadMethodId="image",l.source.resource=t,l.source.alphaMode="premultiply-alpha-on-upload",l.frame.width=e/i,l.frame.height=n/i,l.source.emit("update",l.source),l.updateUvs(),l}class JA{constructor(e,n){this._activeTextures={},this._renderer=e,this._retainCanvasContext=n}getTexture(e,n,i,r){typeof e=="string"&&(Qt("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:i,resolution:n}),e.style instanceof gf||(e.style=new gf(e.style)),e.textureStyle instanceof th||(e.textureStyle=new th(e.textureStyle)),typeof e.text!="string"&&(e.text=e.text.toString());const{text:s,style:l,textureStyle:c,autoGenerateMipmaps:d}=e,p=e.resolution??this._renderer.resolution,{frame:m,canvasAndContext:g}=qd.getCanvasAndContext({text:s,style:l,resolution:p}),x=_B(g.canvas,m.width,m.height,p,d);if(c&&(x.source.style=c),l.trim&&(m.pad(l.padding),x.frame.copyFrom(m),x.frame.scale(1/p),x.updateUvs()),l.filters){const v=this._applyFilters(x,l.filters);return this.returnTexture(x),qd.returnCanvasAndContext(g),v}return this._renderer.texture.initSource(x._source),this._retainCanvasContext||qd.returnCanvasAndContext(g),x}returnTexture(e){const n=e.source,i=n.resource;if(this._retainCanvasContext&&(i!=null&&i.getContext)){const r=i.getContext("2d");r&&qd.returnCanvasAndContext({canvas:i,context:r})}n.resource=null,n.uploadMethodId="unknown",n.alphaMode="no-premultiply-alpha",V0.returnTexture(e,!0)}renderTextToCanvas(){Qt("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(e){e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;const n=e.styleKey;if(this._activeTextures[n])return this._increaseReferenceCount(n),this._activeTextures[n].texture;const i=this.getTexture({text:e.text,style:e.style,resolution:e._resolution,textureStyle:e.textureStyle,autoGenerateMipmaps:e.autoGenerateMipmaps});return this._activeTextures[n]={texture:i,usageCount:1},i}decreaseReferenceCount(e){const n=this._activeTextures[e];n&&(n.usageCount--,n.usageCount===0&&(this.returnTexture(n.texture),this._activeTextures[e]=null))}getReferenceCount(e){var n;return((n=this._activeTextures[e])==null?void 0:n.usageCount)??0}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}_applyFilters(e,n){const i=this._renderer.renderTarget.renderTarget,r=this._renderer.filter.generateFilteredTexture({texture:e,filters:n});return this._renderer.renderTarget.bind(i,!1),r}destroy(){this._renderer=null;for(const e in this._activeTextures)this._activeTextures[e]&&this.returnTexture(this._activeTextures[e].texture);this._activeTextures=null}}class eM extends JA{constructor(e){super(e,!0)}}eM.extension={type:[Nt.CanvasSystem],name:"canvasText"};class tM extends JA{constructor(e){super(e,!1)}}tM.extension={type:[Nt.WebGLSystem,Nt.WebGPUSystem],name:"canvasText"};si.add(eM);si.add(tM);si.add(QA);class $0 extends F6{constructor(...e){const n=q6(e,"Text");super(n,gf),this.renderPipeId="text",n.textureStyle&&(this.textureStyle=n.textureStyle instanceof th?n.textureStyle:new th(n.textureStyle)),this.autoGenerateMipmaps=n.autoGenerateMipmaps??zs.defaultOptions.autoGenerateMipmaps}updateBounds(){const e=this._bounds,n=this._anchor;let i=0,r=0;if(this._style.trim){const{frame:s,canvasAndContext:l}=qd.getCanvasAndContext({text:this.text,style:this._style,resolution:1});qd.returnCanvasAndContext(l),i=s.width,r=s.height}else{const s=eu.measureText(this._text,this._style);i=s.width,r=s.height}e.minX=-n._x*i,e.maxX=e.minX+i,e.minY=-n._y*r,e.maxY=e.minY+r}}si.add(XD,KD);var Lx={exports:{}},Ko={};/**
310
- * @license React
311
- * react-reconciler-constants.production.js
312
- *
313
- * Copyright (c) Meta Platforms, Inc. and affiliates.
314
- *
315
- * This source code is licensed under the MIT license found in the
316
- * LICENSE file in the root directory of this source tree.
317
- */var vw;function SB(){return vw||(vw=1,Ko.ConcurrentRoot=1,Ko.ContinuousEventPriority=8,Ko.DefaultEventPriority=32,Ko.DiscreteEventPriority=2,Ko.IdleEventPriority=268435456,Ko.LegacyRoot=0,Ko.NoEventPriority=0),Ko}var _w;function EB(){return _w||(_w=1,Lx.exports=SB()),Lx.exports}var Yd=EB();const e1=G.createContext({}),wB=e1.Provider;e1.Consumer;function nM(t,e){const n=Object.getPrototypeOf(t),i=Object.getOwnPropertyDescriptor(n,e);return!(typeof i>"u"||i.writable||i.set)}const au={currentUpdatePriority:Yd.DefaultEventPriority,unmountQueue:new Set};function Sw(t,...e){}function iM(t,e={}){const n=t;return n.__pixireact=Object.assign({filters:[],parent:null,root:null,type:""},e),n}var TB="0.0.0-development",CB={version:TB};function AB(){}function rM(t,e,n){e instanceof Ef&&(e.__pixireact.parent=t,typeof n=="number"?t.__pixireact.filters.splice(n,0,e):t.__pixireact.filters.push(e),t.filters=t.__pixireact.filters)}function Ux(t,e){e&&(e instanceof br?t.addChild(e):e instanceof Ef&&rM(t,e))}function MB(){}function NB(){return!1}const Qv=Object.freeze({onclick:"onClick",onglobalmousemove:"onGlobalMouseMove",onglobalpointermove:"onGlobalPointerMove",onglobaltouchmove:"onGlobalTouchMove",onmousedown:"onMouseDown",onmouseenter:"onMouseEnter",onmouseleave:"onMouseLeave",onmousemove:"onMouseMove",onmouseout:"onMouseOut",onmouseover:"onMouseOver",onmouseup:"onMouseUp",onmouseupoutside:"onMouseUpOutside",onpointercancel:"onPointerCancel",onpointerdown:"onPointerDown",onpointerenter:"onPointerEnter",onpointerleave:"onPointerLeave",onpointermove:"onPointerMove",onpointerout:"onPointerOut",onpointerover:"onPointerOver",onpointertap:"onPointerTap",onpointerup:"onPointerUp",onpointerupoutside:"onPointerUpOutside",onrightclick:"onRightClick",onrightdown:"onRightDown",onrightup:"onRightUp",onrightupoutside:"onRightUpOutside",ontap:"onTap",ontouchcancel:"onTouchCancel",ontouchend:"onTouchEnd",ontouchendoutside:"onTouchEndOutside",ontouchmove:"onTouchMove",ontouchstart:"onTouchStart",onwheel:"onWheel"}),E0=Object.freeze({onClick:"onclick",onGlobalMouseMove:"onglobalmousemove",onGlobalPointerMove:"onglobalpointermove",onGlobalTouchMove:"onglobaltouchmove",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseUpOutside:"onmouseupoutside",onPointerCancel:"onpointercancel",onPointerDown:"onpointerdown",onPointerEnter:"onpointerenter",onPointerLeave:"onpointerleave",onPointerMove:"onpointermove",onPointerOut:"onpointerout",onPointerOver:"onpointerover",onPointerTap:"onpointertap",onPointerUp:"onpointerup",onPointerUpOutside:"onpointerupoutside",onRightClick:"onrightclick",onRightDown:"onrightdown",onRightUp:"onrightup",onRightUpOutside:"onrightupoutside",onTap:"ontap",onTouchCancel:"ontouchcancel",onTouchEnd:"ontouchend",onTouchEndOutside:"ontouchendoutside",onTouchMove:"ontouchmove",onTouchStart:"ontouchstart",onWheel:"onwheel"});function aM(t){return Array.isArray(t)}function sM(t,e,n={arrays:"reference",objects:"reference",strict:!0}){const{arrays:i,objects:r,strict:s}=n;if(typeof t!=typeof e||!!t!=!!e)return!1;if(DB(t)||kB(t))return t===e;const l=OB(t);if(l&&r==="reference")return t===e;const c=aM(t);if(c&&i==="reference")return t===e;if((c||l)&&t===e)return!0;let d;for(d in t)if(!(d in e))return!1;let p=t;if(s&&(p=e),l&&i==="shallow"&&r==="shallow"){for(d in p)if(!sM(t[d],e[d],{strict:s,objects:"reference"}))return!1}else for(d in p)if(t[d]!==e[d])return!1;if(lM(d)){if(c&&t.length===0&&e.length===0||l&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}function RB(t){return t===null}function kB(t){return typeof t=="number"}function OB(t){return!(t!==Object(t)||aM(t)||typeof t=="function")}function DB(t){return typeof t=="string"}function lM(t){return t===void 0}const zB=Object.freeze(["children","key","ref"]);function BB(t,e=[]){const n={};return Object.entries(t).reduce((i,[r,s])=>(e.includes(r)||(i[r]=s),i),n)}function Jv(t,e=[]){return BB(t,zB.concat(e))}const LB="__default";function oM(t,e={},n=!1){const i=Jv(t),r=Jv(e),s=Object.entries(i),l=[];if(n){const c=Object.keys(r);let d=0;for(;d<c.length;){const p=c[d];!(p in i)&&s.unshift([p,`${LB}remove`]),d+=1}}return s.forEach(([c,d])=>{if(sM(d,r[c]))return;if(c in E0){l.push([c,d,!0,[]]);return}let p=[];c.includes("-")&&(p=c.split("-")),l.push([c,d,!1,p]);for(const m in i){const g=i[m];m.startsWith(`${c}-`)&&l.push([m,g,!1,m.split("-")])}}),{changes:l}}function UB(t){const e=t;return!(!e||!e.changes)}const IB="__default",Ew=new Map,ww={};function Tw(t,e){if(t){const n=t[e];if(!lM(n)&&!RB(n))return n}return t}function cM(t,e){const{__pixireact:n={},...i}=t;let r;UB(e)?r=e:r=oM(e,i);const{changes:s}=r;let l=0;for(;l<s.length;){const c=s[l];let d=!1,p=c[0],m=c[1];const g=c[2],x=c[3];let v=t,E=v[p];if(p==="draw"&&typeof m=="function"&&(t instanceof Aa?m(t):(d=!0,Sw("warn",`The \`draw\` prop was used on a \`${n.type}\` component, but it's only valid on \`graphics\` components.`))),p in Qv){const A=p;d=!0,ww[p]||(ww[p]=!0,Sw("warn",`Event names must be pascal case; instead of \`${p}\`, you probably want \`${Qv[A]}\`.`))}if(!d){if(x.length&&(E=x.reduce(Tw,v),!(E&&E.set))){const[A,...C]=x.reverse();v=C.reverse().reduce(Tw,v),p=A}if(m===`${IB}remove`)if(v instanceof br){let A=Ew.get(v.constructor);A||(A=v.constructor,A=new A,Ew.set(v.constructor,A)),m=A[p]}else m=0;if(g&&n){const C=E0[p];m?v[C]=m:delete v[C]}else nM(v,p)||(v[p]=m)}l+=1}return t}function HB(t,e,n,i){const{children:r,...s}=i,{children:l,...c}=n,d=oM(s,c,!0);return d.changes.length?d:null}function jB(t,e,n,i){const r=HB(t,e,n,i);r&&cM(t,r)}const PB=Object.freeze([...Object.keys(Qv),"draw"]),e_={};function GB(t){const e=t.charAt(0),n=t.substring(1);return`${e.toUpperCase()}${n}`}function FB(t,e){return e.toLowerCase()}function qB(t){let e=t;return t.startsWith("pixi")&&(e=t.replace(/^pixi([A-Z])/,FB)),e}function YB(t,e,n){const i=qB(t),r=GB(i);if(!(r in e_))throw new Error(`${r} is not part of the PIXI namespace! Did you forget to extend?`);const s=e_[r],l=Jv(e,PB);Object.entries(e).forEach(([d,p])=>{if(d in E0){const m=E0[d];l[m]=p}});const c=iM(new s(l),{root:n,type:i});return cM(c,e),c}var Ix={exports:{}},Hx={exports:{}},jx={exports:{}},Px={};/**
318
- * @license React
319
- * scheduler.production.js
320
- *
321
- * Copyright (c) Meta Platforms, Inc. and affiliates.
322
- *
323
- * This source code is licensed under the MIT license found in the
324
- * LICENSE file in the root directory of this source tree.
325
- */var Cw;function VB(){return Cw||(Cw=1,(function(t){function e(B,Y){var Z=B.length;B.push(Y);e:for(;0<Z;){var $=Z-1>>>1,j=B[$];if(0<r(j,Y))B[$]=Y,B[Z]=j,Z=$;else break e}}function n(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var Y=B[0],Z=B.pop();if(Z!==Y){B[0]=Z;e:for(var $=0,j=B.length,K=j>>>1;$<K;){var te=2*($+1)-1,U=B[te],le=te+1,de=B[le];if(0>r(U,Z))le<j&&0>r(de,U)?(B[$]=de,B[le]=Z,$=le):(B[$]=U,B[te]=Z,$=te);else if(le<j&&0>r(de,Z))B[$]=de,B[le]=Z,$=le;else break e}}return Y}function r(B,Y){var Z=B.sortIndex-Y.sortIndex;return Z!==0?Z:B.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}var d=[],p=[],m=1,g=null,x=3,v=!1,E=!1,A=!1,C=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function N(B){for(var Y=n(p);Y!==null;){if(Y.callback===null)i(p);else if(Y.startTime<=B)i(p),Y.sortIndex=Y.expirationTime,e(d,Y);else break;Y=n(p)}}function D(B){if(A=!1,N(B),!E)if(n(d)!==null)E=!0,q();else{var Y=n(p);Y!==null&&Q(D,Y.startTime-B)}}var H=!1,z=-1,F=5,ee=-1;function P(){return!(t.unstable_now()-ee<F)}function I(){if(H){var B=t.unstable_now();ee=B;var Y=!0;try{e:{E=!1,A&&(A=!1,w(z),z=-1),v=!0;var Z=x;try{t:{for(N(B),g=n(d);g!==null&&!(g.expirationTime>B&&P());){var $=g.callback;if(typeof $=="function"){g.callback=null,x=g.priorityLevel;var j=$(g.expirationTime<=B);if(B=t.unstable_now(),typeof j=="function"){g.callback=j,N(B),Y=!0;break t}g===n(d)&&i(d),N(B)}else i(d);g=n(d)}if(g!==null)Y=!0;else{var K=n(p);K!==null&&Q(D,K.startTime-B),Y=!1}}break e}finally{g=null,x=Z,v=!1}Y=void 0}}finally{Y?V():H=!1}}}var V;if(typeof k=="function")V=function(){k(I)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,ne=X.port2;X.port1.onmessage=I,V=function(){ne.postMessage(null)}}else V=function(){C(I,0)};function q(){H||(H=!0,V())}function Q(B,Y){z=C(function(){B(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_continueExecution=function(){E||v||(E=!0,q())},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_getFirstCallbackNode=function(){return n(d)},t.unstable_next=function(B){switch(x){case 1:case 2:case 3:var Y=3;break;default:Y=x}var Z=x;x=Y;try{return B()}finally{x=Z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(B,Y){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Z=x;x=B;try{return Y()}finally{x=Z}},t.unstable_scheduleCallback=function(B,Y,Z){var $=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?$+Z:$):Z=$,B){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=Z+j,B={id:m++,callback:Y,priorityLevel:B,startTime:Z,expirationTime:j,sortIndex:-1},Z>$?(B.sortIndex=Z,e(p,B),n(d)===null&&B===n(p)&&(A?(w(z),z=-1):A=!0,Q(D,Z-$))):(B.sortIndex=j,e(d,B),E||v||(E=!0,q())),B},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(B){var Y=x;return function(){var Z=x;x=Y;try{return B.apply(this,arguments)}finally{x=Z}}}})(Px)),Px}var Aw;function XB(){return Aw||(Aw=1,jx.exports=VB()),jx.exports}/**
326
- * @license React
327
- * react-reconciler.production.js
328
- *
329
- * Copyright (c) Meta Platforms, Inc. and affiliates.
330
- *
331
- * This source code is licensed under the MIT license found in the
332
- * LICENSE file in the root directory of this source tree.
333
- */var Mw;function KB(){return Mw||(Mw=1,(function(t){t.exports=function(e){function n(u,f,b,S){return new Gh(u,f,b,S)}function i(){}function r(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)f+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(u){return u===null||typeof u!="object"?null:(u=Wh&&u[Wh]||u["@@iterator"],typeof u=="function"?u:null)}function l(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===ko?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case Cc:return"Fragment";case Ha:return"Portal";case Kh:return"Profiler";case Xh:return"StrictMode";case Wf:return"Suspense";case Gl:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case ms:return(u.displayName||"Context")+".Provider";case Pl:return(u._context.displayName||"Context")+".Consumer";case Ac:var f=u.render;return u=u.displayName,u||(u=f.displayName||f.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case Mu:return f=u.displayName||null,f!==null?f:l(u.type)||"Memo";case ja:f=u._payload,u=u._init;try{return l(u(f))}catch{}}return null}function c(u){if(Zf===void 0)try{throw Error()}catch(b){var f=b.stack.trim().match(/\n( *(at )?)/);Zf=f&&f[1]||"",Zh=-1<b.stack.indexOf(`
334
- at`)?" (<anonymous>)":-1<b.stack.indexOf("@")?"@unknown:0:0":""}return`
335
- `+Zf+u+Zh}function d(u,f){if(!u||Fl)return"";Fl=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var S={DetermineComponentFrameRoot:function(){try{if(f){var Be=function(){throw Error()};if(Object.defineProperty(Be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Be,[])}catch(ht){var je=ht}Reflect.construct(u,[],Be)}else{try{Be.call()}catch(ht){je=ht}u.call(Be.prototype)}}else{try{throw Error()}catch(ht){je=ht}(Be=u())&&typeof Be.catch=="function"&&Be.catch(function(){})}}catch(ht){if(ht&&je&&typeof ht.stack=="string")return[ht.stack,je.stack]}return[null,null]}};S.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var M=Object.getOwnPropertyDescriptor(S.DetermineComponentFrameRoot,"name");M&&M.configurable&&Object.defineProperty(S.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var O=S.DetermineComponentFrameRoot(),J=O[0],ie=O[1];if(J&&ie){var fe=J.split(`
336
- `),we=ie.split(`
337
- `);for(M=S=0;S<fe.length&&!fe[S].includes("DetermineComponentFrameRoot");)S++;for(;M<we.length&&!we[M].includes("DetermineComponentFrameRoot");)M++;if(S===fe.length||M===we.length)for(S=fe.length-1,M=we.length-1;1<=S&&0<=M&&fe[S]!==we[M];)M--;for(;1<=S&&0<=M;S--,M--)if(fe[S]!==we[M]){if(S!==1||M!==1)do if(S--,M--,0>M||fe[S]!==we[M]){var ke=`
338
- `+fe[S].replace(" at new "," at ");return u.displayName&&ke.includes("<anonymous>")&&(ke=ke.replace("<anonymous>",u.displayName)),ke}while(1<=S&&0<=M);break}}}finally{Fl=!1,Error.prepareStackTrace=b}return(b=u?u.displayName||u.name:"")?c(b):""}function p(u){switch(u.tag){case 26:case 27:case 5:return c(u.type);case 16:return c("Lazy");case 13:return c("Suspense");case 19:return c("SuspenseList");case 0:case 15:return u=d(u.type,!1),u;case 11:return u=d(u.type.render,!1),u;case 1:return u=d(u.type,!0),u;default:return""}}function m(u){try{var f="";do f+=p(u),u=u.return;while(u);return f}catch(b){return`
339
- Error generating stack: `+b.message+`
340
- `+b.stack}}function g(u){var f=u,b=u;if(u.alternate)for(;f.return;)f=f.return;else{u=f;do f=u,(f.flags&4098)!==0&&(b=f.return),u=f.return;while(u)}return f.tag===3?b:null}function x(u){if(g(u)!==u)throw Error(r(188))}function v(u){var f=u.alternate;if(!f){if(f=g(u),f===null)throw Error(r(188));return f!==u?null:u}for(var b=u,S=f;;){var M=b.return;if(M===null)break;var O=M.alternate;if(O===null){if(S=M.return,S!==null){b=S;continue}break}if(M.child===O.child){for(O=M.child;O;){if(O===b)return x(M),u;if(O===S)return x(M),f;O=O.sibling}throw Error(r(188))}if(b.return!==S.return)b=M,S=O;else{for(var J=!1,ie=M.child;ie;){if(ie===b){J=!0,b=M,S=O;break}if(ie===S){J=!0,S=M,b=O;break}ie=ie.sibling}if(!J){for(ie=O.child;ie;){if(ie===b){J=!0,b=O,S=M;break}if(ie===S){J=!0,S=O,b=M;break}ie=ie.sibling}if(!J)throw Error(r(189))}}if(b.alternate!==S)throw Error(r(190))}if(b.tag!==3)throw Error(r(188));return b.stateNode.current===b?u:f}function E(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u;for(u=u.child;u!==null;){if(f=E(u),f!==null)return f;u=u.sibling}return null}function A(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u;for(u=u.child;u!==null;){if(u.tag!==4&&(f=A(u),f!==null))return f;u=u.sibling}return null}function C(u){return{current:u}}function w(u){0>Qs||(u.current=Uu[Qs],Uu[Qs]=null,Qs--)}function k(u,f){Qs++,Uu[Qs]=u.current,u.current=f}function N(u){return u>>>=0,u===0?32:31-(Iu(u)/Xg|0)|0}function D(u){var f=u&42;if(f!==0)return f;switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128: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 u&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function H(u,f){var b=u.pendingLanes;if(b===0)return 0;var S=0,M=u.suspendedLanes,O=u.pingedLanes,J=u.warmLanes;u=u.finishedLanes!==0;var ie=b&134217727;return ie!==0?(b=ie&~M,b!==0?S=D(b):(O&=ie,O!==0?S=D(O):u||(J=ie&~J,J!==0&&(S=D(J))))):(ie=b&~M,ie!==0?S=D(ie):O!==0?S=D(O):u||(J=b&~J,J!==0&&(S=D(J)))),S===0?0:f!==0&&f!==S&&(f&M)===0&&(M=S&-S,J=f&-f,M>=J||M===32&&(J&4194176)!==0)?f:S}function z(u,f){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&f)===0}function F(u,f){switch(u){case 1:case 2:case 4:case 8:return f+250;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 f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ee(){var u=kc;return kc<<=1,(kc&4194176)===0&&(kc=128),u}function P(){var u=Hu;return Hu<<=1,(Hu&62914560)===0&&(Hu=4194304),u}function I(u){for(var f=[],b=0;31>b;b++)f.push(u);return f}function V(u,f){u.pendingLanes|=f,f!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function X(u,f,b,S,M,O){var J=u.pendingLanes;u.pendingLanes=b,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=b,u.entangledLanes&=b,u.errorRecoveryDisabledLanes&=b,u.shellSuspendCounter=0;var ie=u.entanglements,fe=u.expirationTimes,we=u.hiddenUpdates;for(b=J&~b;0<b;){var ke=31-wr(b),Be=1<<ke;ie[ke]=0,fe[ke]=-1;var je=we[ke];if(je!==null)for(we[ke]=null,ke=0;ke<je.length;ke++){var ht=je[ke];ht!==null&&(ht.lane&=-536870913)}b&=~Be}S!==0&&ne(u,S,0),O!==0&&M===0&&u.tag!==0&&(u.suspendedLanes|=O&~(J&~f))}function ne(u,f,b){u.pendingLanes|=f,u.suspendedLanes&=~f;var S=31-wr(f);u.entangledLanes|=f,u.entanglements[S]=u.entanglements[S]|1073741824|b&4194218}function q(u,f){var b=u.entangledLanes|=f;for(u=u.entanglements;b;){var S=31-wr(b),M=1<<S;M&f|u[S]&f&&(u[S]|=f),b&=~M}}function Q(u){return u&=-u,2<u?8<u?(u&134217727)!==0?32:268435456:8:2}function B(u){if(Tr&&typeof Tr.onCommitFiberRoot=="function")try{Tr.onCommitFiberRoot(Dc,u,void 0,(u.current.flags&128)===128)}catch{}}function Y(u){if(typeof $g=="function"&&Ap(u),Tr&&typeof Tr.setStrictMode=="function")try{Tr.setStrictMode(Dc,u)}catch{}}function Z(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}function $(u,f){if(typeof u=="object"&&u!==null){var b=hd.get(u);return b!==void 0?b:(f={value:u,source:f,stack:m(f)},hd.set(u,f),f)}return{value:u,source:f,stack:m(f)}}function j(u,f){Rn[Yn++]=Gu,Rn[Yn++]=Pu,Pu=u,Gu=f}function K(u,f,b){Kr[Wr++]=vs,Kr[Wr++]=ga,Kr[Wr++]=Pa,Pa=u;var S=vs;u=ga;var M=32-wr(S)-1;S&=~(1<<M),b+=1;var O=32-wr(f)+M;if(30<O){var J=M-M%5;O=(S&(1<<J)-1).toString(32),S>>=J,M-=J,vs=1<<32-wr(f)+M|b<<M|S,ga=O+u}else vs=1<<O|b<<M|S,ga=u}function te(u){u.return!==null&&(j(u,1),K(u,1,0))}function U(u){for(;u===Pu;)Pu=Rn[--Yn],Rn[Yn]=null,Gu=Rn[--Yn],Rn[Yn]=null;for(;u===Pa;)Pa=Kr[--Wr],Kr[Wr]=null,ga=Kr[--Wr],Kr[Wr]=null,vs=Kr[--Wr],Kr[Wr]=null}function le(u,f){k(Ga,f),k(Fu,u),k(Ri,null),u=Oo(f),w(Ri),k(Ri,u)}function de(){w(Ri),w(Fu),w(Ga)}function ge(u){u.memoizedState!==null&&k(zc,u);var f=Ri.current,b=Cg(f,u.type);f!==b&&(k(Fu,u),k(Ri,b))}function se(u){Fu.current===u&&(w(Ri),w(Fu)),zc.current===u&&(w(zc),ys?ot._currentValue=Er:ot._currentValue2=Er)}function pe(u){var f=Error(r(418,""));throw Ie($(f,u)),qu}function Ae(u,f){if(!dr)throw Error(r(175));_b(u.stateNode,u.type,u.memoizedProps,f,u)||pe(u)}function Le(u){for($i=u.return;$i;)switch($i.tag){case 3:case 27:ya=!0;return;case 5:case 13:ya=!1;return;default:$i=$i.return}}function Ge(u){if(!dr||u!==$i)return!1;if(!Ft)return Le(u),Ft=!0,!1;var f=!1;if(Ii?u.tag!==3&&u.tag!==27&&(u.tag!==5||Gg(u.type)&&!Vl(u.type,u.memoizedProps))&&(f=!0):u.tag!==3&&(u.tag!==5||Gg(u.type)&&!Vl(u.type,u.memoizedProps))&&(f=!0),f&&ji&&pe(u),Le(u),u.tag===13){if(!dr)throw Error(r(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));ji=jg(u)}else ji=$i?pp(u.stateNode):null;return!0}function Pe(){dr&&(ji=$i=null,Ft=!1)}function Ie(u){Zr===null?Zr=[u]:Zr.push(u)}function We(){for(var u=Kl,f=Bc=Kl=0;f<u;){var b=$r[f];$r[f++]=null;var S=$r[f];$r[f++]=null;var M=$r[f];$r[f++]=null;var O=$r[f];if($r[f++]=null,S!==null&&M!==null){var J=S.pending;J===null?M.next=M:(M.next=J.next,J.next=M),S.pending=M}O!==0&&zn(b,M,O)}}function ut(u,f,b,S){$r[Kl++]=u,$r[Kl++]=f,$r[Kl++]=b,$r[Kl++]=S,Bc|=S,u.lanes|=S,u=u.alternate,u!==null&&(u.lanes|=S)}function Ue(u,f,b,S){return ut(u,f,b,S),Bn(u)}function At(u,f){return ut(u,null,null,f),Bn(u)}function zn(u,f,b){u.lanes|=b;var S=u.alternate;S!==null&&(S.lanes|=b);for(var M=!1,O=u.return;O!==null;)O.childLanes|=b,S=O.alternate,S!==null&&(S.childLanes|=b),O.tag===22&&(u=O.stateNode,u===null||u._visibility&1||(M=!0)),u=O,O=O.return;M&&f!==null&&u.tag===3&&(O=u.stateNode,M=31-wr(b),O=O.hiddenUpdates,u=O[M],u===null?O[M]=[f]:u.push(f),f.lane=b|536870912)}function Bn(u){if(50<Fo)throw Fo=0,mr=null,Error(r(185));for(var f=u.return;f!==null;)u=f,f=u.return;return u.tag===3?u.stateNode:null}function bn(u){u!==Lo&&u.next===null&&(Lo===null?Lc=Lo=u:Lo=Lo.next=u),Vu=!0,Yu||(Yu=!0,_e(ka))}function wi(u,f){if(!Fa&&Vu){Fa=!0;do for(var b=!1,S=Lc;S!==null;){if(u!==0){var M=S.pendingLanes;if(M===0)var O=0;else{var J=S.suspendedLanes,ie=S.pingedLanes;O=(1<<31-wr(42|u)+1)-1,O&=M&~(J&~ie),O=O&201326677?O&201326677|1:O?O|2:0}O!==0&&(b=!0,ua(S,O))}else O=Et,O=H(S,S===Mt?O:0),(O&3)===0||z(S,O)||(b=!0,ua(S,O));S=S.next}while(b);Fa=!1}}function ka(){Vu=Yu=!1;var u=0;Wl!==0&&(Xl()&&(u=Wl),Wl=0);for(var f=Hi(),b=null,S=Lc;S!==null;){var M=S.next,O=Lr(S,f);O===0?(S.next=null,b===null?Lc=M:b.next=M,M===null&&(Lo=b)):(b=S,(u!==0||(O&3)!==0)&&(Vu=!0)),S=M}wi(u)}function Lr(u,f){for(var b=u.suspendedLanes,S=u.pingedLanes,M=u.expirationTimes,O=u.pendingLanes&-62914561;0<O;){var J=31-wr(O),ie=1<<J,fe=M[J];fe===-1?((ie&b)===0||(ie&S)!==0)&&(M[J]=F(ie,f)):fe<=f&&(u.expiredLanes|=ie),O&=~ie}if(f=Mt,b=Et,b=H(u,u===f?b:0),S=u.callbackNode,b===0||u===f&&mn===2||u.cancelPendingCommit!==null)return S!==null&&S!==null&&ju(S),u.callbackNode=null,u.callbackPriority=0;if((b&3)===0||z(u,b)){if(f=b&-b,f===u.callbackPriority)return f;switch(S!==null&&ju(S),Q(b)){case 2:case 8:b=Zg;break;case 32:b=fd;break;case 268435456:b=dd;break;default:b=fd}return S=hn.bind(null,u),b=Oc(b,S),u.callbackPriority=f,u.callbackNode=b,f}return S!==null&&S!==null&&ju(S),u.callbackPriority=2,u.callbackNode=null,2}function hn(u,f){var b=u.callbackNode;if(Mi()&&u.callbackNode!==b)return null;var S=Et;return S=H(u,u===Mt?S:0),S===0?null:(Eu(u,S,f),Lr(u,Hi()),u.callbackNode!=null&&u.callbackNode===b?hn.bind(null,u):null)}function ua(u,f){if(Mi())return null;Eu(u,f,!0)}function _e(u){ci?ed(function(){($e&6)!==0?Oc(Cp,u):u()}):Oc(Cp,u)}function Re(){return Wl===0&&(Wl=ee()),Wl}function Je(u,f){if(Xu===null){var b=Xu=[];pd=0,Cr=Re(),Zl={status:"pending",value:void 0,then:function(S){b.push(S)}}}return pd++,f.then(bt,bt),f}function bt(){if(--pd===0&&Xu!==null){Zl!==null&&(Zl.status="fulfilled");var u=Xu;Xu=null,Cr=0,Zl=null;for(var f=0;f<u.length;f++)(0,u[f])()}}function kt(u,f){var b=[],S={status:"pending",value:null,reason:null,then:function(M){b.push(M)}};return u.then(function(){S.status="fulfilled",S.value=f;for(var M=0;M<b.length;M++)(0,b[M])(f)},function(M){for(S.status="rejected",S.reason=M,M=0;M<b.length;M++)(0,b[M])(void 0)}),S}function yi(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rr(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function xn(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function Zt(u,f,b){var S=u.updateQueue;if(S===null)return null;if(S=S.shared,($e&2)!==0){var M=S.pending;return M===null?f.next=f:(f.next=M.next,M.next=f),S.pending=f,f=Bn(u),zn(u,null,b),f}return ut(u,S,f,b),Bn(u)}function Gn(u,f,b){if(f=f.updateQueue,f!==null&&(f=f.shared,(b&4194176)!==0)){var S=f.lanes;S&=u.pendingLanes,b|=S,f.lanes=b,q(u,b)}}function Pt(u,f){var b=u.updateQueue,S=u.alternate;if(S!==null&&(S=S.updateQueue,b===S)){var M=null,O=null;if(b=b.firstBaseUpdate,b!==null){do{var J={lane:b.lane,tag:b.tag,payload:b.payload,callback:null,next:null};O===null?M=O=J:O=O.next=J,b=b.next}while(b!==null);O===null?M=O=f:O=O.next=f}else M=O=f;b={baseState:S.baseState,firstBaseUpdate:M,lastBaseUpdate:O,shared:S.shared,callbacks:S.callbacks},u.updateQueue=b;return}u=b.lastBaseUpdate,u===null?b.firstBaseUpdate=f:u.next=f,b.lastBaseUpdate=f}function Fi(){if(Uc){var u=Zl;if(u!==null)throw u}}function Qn(u,f,b,S){Uc=!1;var M=u.updateQueue;Js=!1;var O=M.firstBaseUpdate,J=M.lastBaseUpdate,ie=M.shared.pending;if(ie!==null){M.shared.pending=null;var fe=ie,we=fe.next;fe.next=null,J===null?O=we:J.next=we,J=fe;var ke=u.alternate;ke!==null&&(ke=ke.updateQueue,ie=ke.lastBaseUpdate,ie!==J&&(ie===null?ke.firstBaseUpdate=we:ie.next=we,ke.lastBaseUpdate=fe))}if(O!==null){var Be=M.baseState;J=0,ke=we=fe=null,ie=O;do{var je=ie.lane&-536870913,ht=je!==ie.lane;if(ht?(Et&je)===je:(S&je)===je){je!==0&&je===Cr&&(Uc=!0),ke!==null&&(ke=ke.next={lane:0,tag:ie.tag,payload:ie.payload,callback:null,next:null});e:{var Rr=u,$u=ie;je=f;var qo=b;switch($u.tag){case 1:if(Rr=$u.payload,typeof Rr=="function"){Be=Rr.call(qo,Be,je);break e}Be=Rr;break e;case 3:Rr.flags=Rr.flags&-65537|128;case 0:if(Rr=$u.payload,je=typeof Rr=="function"?Rr.call(qo,Be,je):Rr,je==null)break e;Be=Ro({},Be,je);break e;case 2:Js=!0}}je=ie.callback,je!==null&&(u.flags|=64,ht&&(u.flags|=8192),ht=M.callbacks,ht===null?M.callbacks=[je]:ht.push(je))}else ht={lane:je,tag:ie.tag,payload:ie.payload,callback:ie.callback,next:null},ke===null?(we=ke=ht,fe=Be):ke=ke.next=ht,J|=je;if(ie=ie.next,ie===null){if(ie=M.shared.pending,ie===null)break;ht=ie,ie=ht.next,ht.next=null,M.lastBaseUpdate=ht,M.shared.pending=null}}while(!0);ke===null&&(fe=Be),M.baseState=fe,M.firstBaseUpdate=we,M.lastBaseUpdate=ke,O===null&&(M.shared.lanes=0),ta|=J,u.lanes=J,u.memoizedState=Be}}function go(u,f){if(typeof u!="function")throw Error(r(191,u));u.call(f)}function is(u,f){var b=u.callbacks;if(b!==null)for(u.callbacks=null,u=0;u<b.length;u++)go(b[u],f)}function Oa(u,f){if(Xr(u,f))return!0;if(typeof u!="object"||u===null||typeof f!="object"||f===null)return!1;var b=Object.keys(u),S=Object.keys(f);if(b.length!==S.length)return!1;for(S=0;S<b.length;S++){var M=b[S];if(!Ku.call(f,M)||!Xr(u[M],f[M]))return!1}return!0}function rs(u){return u=u.status,u==="fulfilled"||u==="rejected"}function bi(){}function ae(u,f,b){switch(b=u[b],b===void 0?u.push(f):b!==f&&(f.then(bi,bi),f=b),f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,u===fn?Error(r(483)):u;default:if(typeof f.status=="string")f.then(bi,bi);else{if(u=Mt,u!==null&&100<u.shellSuspendCounter)throw Error(r(482));u=f,u.status="pending",u.then(function(S){if(f.status==="pending"){var M=f;M.status="fulfilled",M.value=S}},function(S){if(f.status==="pending"){var M=f;M.status="rejected",M.reason=S}})}switch(f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,u===fn?Error(r(483)):u}throw Uo=f,fn}}function Ee(){if(Uo===null)throw Error(r(459));var u=Uo;return Uo=null,u}function ze(u){var f=ba;return ba+=1,_s===null&&(_s=[]),ae(_s,u,f)}function et(u,f){f=f.props.ref,u.ref=f!==void 0?f:null}function Jt(u,f){throw f.$$typeof===Vh?Error(r(525)):(u=Object.prototype.toString.call(f),Error(r(31,u==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":u)))}function en(u){var f=u._init;return f(u._payload)}function Fe(u){function f(ye,ce){if(u){var xe=ye.deletions;xe===null?(ye.deletions=[ce],ye.flags|=16):xe.push(ce)}}function b(ye,ce){if(!u)return null;for(;ce!==null;)f(ye,ce),ce=ce.sibling;return null}function S(ye){for(var ce=new Map;ye!==null;)ye.key!==null?ce.set(ye.key,ye):ce.set(ye.index,ye),ye=ye.sibling;return ce}function M(ye,ce){return ye=Wi(ye,ce),ye.index=0,ye.sibling=null,ye}function O(ye,ce,xe){return ye.index=xe,u?(xe=ye.alternate,xe!==null?(xe=xe.index,xe<ce?(ye.flags|=33554434,ce):xe):(ye.flags|=33554434,ce)):(ye.flags|=1048576,ce)}function J(ye){return u&&ye.alternate===null&&(ye.flags|=33554434),ye}function ie(ye,ce,xe,Ne){return ce===null||ce.tag!==6?(ce=jl(xe,ye.mode,Ne),ce.return=ye,ce):(ce=M(ce,xe),ce.return=ye,ce)}function fe(ye,ce,xe,Ne){var Ke=xe.type;return Ke===Cc?ke(ye,ce,xe.props.children,Ne,xe.key):ce!==null&&(ce.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===ja&&en(Ke)===ce.type)?(ce=M(ce,xe.props),et(ce,xe),ce.return=ye,ce):(ce=pa(xe.type,xe.key,xe.props,null,ye.mode,Ne),et(ce,xe),ce.return=ye,ce)}function we(ye,ce,xe,Ne){return ce===null||ce.tag!==4||ce.stateNode.containerInfo!==xe.containerInfo||ce.stateNode.implementation!==xe.implementation?(ce=Tc(xe,ye.mode,Ne),ce.return=ye,ce):(ce=M(ce,xe.children||[]),ce.return=ye,ce)}function ke(ye,ce,xe,Ne,Ke){return ce===null||ce.tag!==7?(ce=Xs(xe,ye.mode,Ne,Ke),ce.return=ye,ce):(ce=M(ce,xe),ce.return=ye,ce)}function Be(ye,ce,xe){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return ce=jl(""+ce,ye.mode,xe),ce.return=ye,ce;if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case Ks:return xe=pa(ce.type,ce.key,ce.props,null,ye.mode,xe),et(xe,ce),xe.return=ye,xe;case Ha:return ce=Tc(ce,ye.mode,xe),ce.return=ye,ce;case ja:var Ne=ce._init;return ce=Ne(ce._payload),Be(ye,ce,xe)}if(ql(ce)||s(ce))return ce=Xs(ce,ye.mode,xe,null),ce.return=ye,ce;if(typeof ce.then=="function")return Be(ye,ze(ce),xe);if(ce.$$typeof===ms)return Be(ye,bu(ye,ce),xe);Jt(ye,ce)}return null}function je(ye,ce,xe,Ne){var Ke=ce!==null?ce.key:null;if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return Ke!==null?null:ie(ye,ce,""+xe,Ne);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case Ks:return xe.key===Ke?fe(ye,ce,xe,Ne):null;case Ha:return xe.key===Ke?we(ye,ce,xe,Ne):null;case ja:return Ke=xe._init,xe=Ke(xe._payload),je(ye,ce,xe,Ne)}if(ql(xe)||s(xe))return Ke!==null?null:ke(ye,ce,xe,Ne,null);if(typeof xe.then=="function")return je(ye,ce,ze(xe),Ne);if(xe.$$typeof===ms)return je(ye,ce,bu(ye,xe),Ne);Jt(ye,xe)}return null}function ht(ye,ce,xe,Ne,Ke){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint")return ye=ye.get(xe)||null,ie(ce,ye,""+Ne,Ke);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case Ks:return ye=ye.get(Ne.key===null?xe:Ne.key)||null,fe(ce,ye,Ne,Ke);case Ha:return ye=ye.get(Ne.key===null?xe:Ne.key)||null,we(ce,ye,Ne,Ke);case ja:var _n=Ne._init;return Ne=_n(Ne._payload),ht(ye,ce,xe,Ne,Ke)}if(ql(Ne)||s(Ne))return ye=ye.get(xe)||null,ke(ce,ye,Ne,Ke,null);if(typeof Ne.then=="function")return ht(ye,ce,xe,ze(Ne),Ke);if(Ne.$$typeof===ms)return ht(ye,ce,xe,bu(ce,Ne),Ke);Jt(ce,Ne)}return null}function Rr(ye,ce,xe,Ne){for(var Ke=null,_n=null,ct=ce,Yt=ce=0,Si=null;ct!==null&&Yt<xe.length;Yt++){ct.index>Yt?(Si=ct,ct=null):Si=ct.sibling;var Vt=je(ye,ct,xe[Yt],Ne);if(Vt===null){ct===null&&(ct=Si);break}u&&ct&&Vt.alternate===null&&f(ye,ct),ce=O(Vt,ce,Yt),_n===null?Ke=Vt:_n.sibling=Vt,_n=Vt,ct=Si}if(Yt===xe.length)return b(ye,ct),Ft&&j(ye,Yt),Ke;if(ct===null){for(;Yt<xe.length;Yt++)ct=Be(ye,xe[Yt],Ne),ct!==null&&(ce=O(ct,ce,Yt),_n===null?Ke=ct:_n.sibling=ct,_n=ct);return Ft&&j(ye,Yt),Ke}for(ct=S(ct);Yt<xe.length;Yt++)Si=ht(ct,ye,Yt,xe[Yt],Ne),Si!==null&&(u&&Si.alternate!==null&&ct.delete(Si.key===null?Yt:Si.key),ce=O(Si,ce,Yt),_n===null?Ke=Si:_n.sibling=Si,_n=Si);return u&&ct.forEach(function(sl){return f(ye,sl)}),Ft&&j(ye,Yt),Ke}function $u(ye,ce,xe,Ne){if(xe==null)throw Error(r(151));for(var Ke=null,_n=null,ct=ce,Yt=ce=0,Si=null,Vt=xe.next();ct!==null&&!Vt.done;Yt++,Vt=xe.next()){ct.index>Yt?(Si=ct,ct=null):Si=ct.sibling;var sl=je(ye,ct,Vt.value,Ne);if(sl===null){ct===null&&(ct=Si);break}u&&ct&&sl.alternate===null&&f(ye,ct),ce=O(sl,ce,Yt),_n===null?Ke=sl:_n.sibling=sl,_n=sl,ct=Si}if(Vt.done)return b(ye,ct),Ft&&j(ye,Yt),Ke;if(ct===null){for(;!Vt.done;Yt++,Vt=xe.next())Vt=Be(ye,Vt.value,Ne),Vt!==null&&(ce=O(Vt,ce,Yt),_n===null?Ke=Vt:_n.sibling=Vt,_n=Vt);return Ft&&j(ye,Yt),Ke}for(ct=S(ct);!Vt.done;Yt++,Vt=xe.next())Vt=ht(ct,ye,Yt,Vt.value,Ne),Vt!==null&&(u&&Vt.alternate!==null&&ct.delete(Vt.key===null?Yt:Vt.key),ce=O(Vt,ce,Yt),_n===null?Ke=Vt:_n.sibling=Vt,_n=Vt);return u&&ct.forEach(function(Ed){return f(ye,Ed)}),Ft&&j(ye,Yt),Ke}function qo(ye,ce,xe,Ne){if(typeof xe=="object"&&xe!==null&&xe.type===Cc&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case Ks:e:{for(var Ke=xe.key;ce!==null;){if(ce.key===Ke){if(Ke=xe.type,Ke===Cc){if(ce.tag===7){b(ye,ce.sibling),Ne=M(ce,xe.props.children),Ne.return=ye,ye=Ne;break e}}else if(ce.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===ja&&en(Ke)===ce.type){b(ye,ce.sibling),Ne=M(ce,xe.props),et(Ne,xe),Ne.return=ye,ye=Ne;break e}b(ye,ce);break}else f(ye,ce);ce=ce.sibling}xe.type===Cc?(Ne=Xs(xe.props.children,ye.mode,Ne,xe.key),Ne.return=ye,ye=Ne):(Ne=pa(xe.type,xe.key,xe.props,null,ye.mode,Ne),et(Ne,xe),Ne.return=ye,ye=Ne)}return J(ye);case Ha:e:{for(Ke=xe.key;ce!==null;){if(ce.key===Ke)if(ce.tag===4&&ce.stateNode.containerInfo===xe.containerInfo&&ce.stateNode.implementation===xe.implementation){b(ye,ce.sibling),Ne=M(ce,xe.children||[]),Ne.return=ye,ye=Ne;break e}else{b(ye,ce);break}else f(ye,ce);ce=ce.sibling}Ne=Tc(xe,ye.mode,Ne),Ne.return=ye,ye=Ne}return J(ye);case ja:return Ke=xe._init,xe=Ke(xe._payload),qo(ye,ce,xe,Ne)}if(ql(xe))return Rr(ye,ce,xe,Ne);if(s(xe)){if(Ke=s(xe),typeof Ke!="function")throw Error(r(150));return xe=Ke.call(xe),$u(ye,ce,xe,Ne)}if(typeof xe.then=="function")return qo(ye,ce,ze(xe),Ne);if(xe.$$typeof===ms)return qo(ye,ce,bu(ye,xe),Ne);Jt(ye,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint"?(xe=""+xe,ce!==null&&ce.tag===6?(b(ye,ce.sibling),Ne=M(ce,xe),Ne.return=ye,ye=Ne):(b(ye,ce),Ne=jl(xe,ye.mode,Ne),Ne.return=ye,ye=Ne),J(ye)):b(ye,ce)}return function(ye,ce,xe,Ne){try{ba=0;var Ke=qo(ye,ce,xe,Ne);return _s=null,Ke}catch(ct){if(ct===fn)throw ct;var _n=n(29,ct,null,ye.mode);return _n.lanes=Ne,_n.return=ye,_n}finally{}}}function He(u,f){u=qa,k(Qr,u),k(Ss,f),qa=u|f.baseLanes}function tt(){k(Qr,qa),k(Ss,Ss.current)}function Cn(){qa=Qr.current,w(Ss),w(Qr)}function Gt(u){var f=u.alternate;k(ui,ui.current&1),k(Jr,u),xa===null&&(f===null||Ss.current!==null||f.memoizedState!==null)&&(xa=u)}function fa(u){if(u.tag===22){if(k(ui,ui.current),k(Jr,u),xa===null){var f=u.alternate;f!==null&&f.memoizedState!==null&&(xa=u)}}else ar()}function ar(){k(ui,ui.current),k(Jr,Jr.current)}function qi(u){w(Jr),xa===u&&(xa=null),w(ui)}function sr(u){for(var f=u;f!==null;){if(f.tag===13){var b=f.memoizedState;if(b!==null&&(b=b.dehydrated,b===null||ad(b)||Lu(b)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}function yt(){throw Error(r(321))}function li(u,f){if(f===null)return!1;for(var b=0;b<f.length&&b<u.length;b++)if(!Xr(u[b],f[b]))return!1;return!0}function Ur(u,f,b,S,M,O){return Es=O,_t=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,rt.H=u===null||u.memoizedState===null?fi:Qi,el=!1,O=b(S,M),el=!1,kn&&(O=_l(f,b,S,M)),Bs(u),O}function Bs(u){rt.H=qt;var f=$t!==null&&$t.next!==null;if(Es=0,ei=$t=_t=null,va=!1,Vn=0,Ic=null,f)throw Error(r(300));u===null||ti||(u=u.dependencies,u!==null&&Nl(u)&&(ti=!0))}function _l(u,f,b,S){_t=u;var M=0;do{if(kn&&(Ic=null),Vn=0,kn=!1,25<=M)throw Error(r(301));if(M+=1,ei=$t=null,u.updateQueue!=null){var O=u.updateQueue;O.lastEffect=null,O.events=null,O.stores=null,O.memoCache!=null&&(O.memoCache.index=0)}rt.H=Ql,O=f(b,S)}while(kn);return O}function Sl(){var u=rt.H,f=u.useState()[0];return f=typeof f.then=="function"?lr(f):f,u=u.useState()[0],($t!==null?$t.memoizedState:null)!==u&&(_t.flags|=1024),f}function El(){var u=Wu!==0;return Wu=0,u}function Da(u,f,b){f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~b}function Ls(u){if(va){for(u=u.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}va=!1}Es=0,ei=$t=_t=null,kn=!1,Vn=Wu=0,Ic=null}function tn(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ei===null?_t.memoizedState=ei=u:ei=ei.next=u,ei}function nn(){if($t===null){var u=_t.alternate;u=u!==null?u.memoizedState:null}else u=$t.next;var f=ei===null?_t.memoizedState:ei.next;if(f!==null)ei=f,$t=u;else{if(u===null)throw _t.alternate===null?Error(r(467)):Error(r(310));$t=u,u={memoizedState:$t.memoizedState,baseState:$t.baseState,baseQueue:$t.baseQueue,queue:$t.queue,next:null},ei===null?_t.memoizedState=ei=u:ei=ei.next=u}return ei}function lr(u){var f=Vn;return Vn+=1,Ic===null&&(Ic=[]),u=ae(Ic,u,f),f=_t,(ei===null?f.memoizedState:ei.next)===null&&(f=f.alternate,rt.H=f===null||f.memoizedState===null?fi:Qi),u}function Ir(u){if(u!==null&&typeof u=="object"){if(typeof u.then=="function")return lr(u);if(u.$$typeof===ms)return Bi(u)}throw Error(r(438,String(u)))}function Ln(u){var f=null,b=_t.updateQueue;if(b!==null&&(f=b.memoCache),f==null){var S=_t.alternate;S!==null&&(S=S.updateQueue,S!==null&&(S=S.memoCache,S!=null&&(f={data:S.data.map(function(M){return M.slice()}),index:0})))}if(f==null&&(f={data:[],index:0}),b===null&&(b=gd(),_t.updateQueue=b),b.memoCache=f,b=f.data[f.index],b===void 0)for(b=f.data[f.index]=Array(u),S=0;S<u;S++)b[S]=Tg;return f.index++,b}function xr(u,f){return typeof f=="function"?f(u):f}function da(u){var f=nn();return Hr(f,$t,u)}function Hr(u,f,b){var S=u.queue;if(S===null)throw Error(r(311));S.lastRenderedReducer=b;var M=u.baseQueue,O=S.pending;if(O!==null){if(M!==null){var J=M.next;M.next=O.next,O.next=J}f.baseQueue=M=O,S.pending=null}if(O=u.baseState,M===null)u.memoizedState=O;else{f=M.next;var ie=J=null,fe=null,we=f,ke=!1;do{var Be=we.lane&-536870913;if(Be!==we.lane?(Et&Be)===Be:(Es&Be)===Be){var je=we.revertLane;if(je===0)fe!==null&&(fe=fe.next={lane:0,revertLane:0,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null}),Be===Cr&&(ke=!0);else if((Es&je)===je){we=we.next,je===Cr&&(ke=!0);continue}else Be={lane:0,revertLane:we.revertLane,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null},fe===null?(ie=fe=Be,J=O):fe=fe.next=Be,_t.lanes|=je,ta|=je;Be=we.action,el&&b(O,Be),O=we.hasEagerState?we.eagerState:b(O,Be)}else je={lane:Be,revertLane:we.revertLane,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null},fe===null?(ie=fe=je,J=O):fe=fe.next=je,_t.lanes|=Be,ta|=Be;we=we.next}while(we!==null&&we!==f);if(fe===null?J=O:fe.next=ie,!Xr(O,u.memoizedState)&&(ti=!0,ke&&(b=Zl,b!==null)))throw b;u.memoizedState=O,u.baseState=J,u.baseQueue=fe,S.lastRenderedState=O}return M===null&&(S.lanes=0),[u.memoizedState,S.dispatch]}function Me(u){var f=nn(),b=f.queue;if(b===null)throw Error(r(311));b.lastRenderedReducer=u;var S=b.dispatch,M=b.pending,O=f.memoizedState;if(M!==null){b.pending=null;var J=M=M.next;do O=u(O,J.action),J=J.next;while(J!==M);Xr(O,f.memoizedState)||(ti=!0),f.memoizedState=O,f.baseQueue===null&&(f.baseState=O),b.lastRenderedState=O}return[O,S]}function Ve(u,f,b){var S=_t,M=nn(),O=Ft;if(O){if(b===void 0)throw Error(r(407));b=b()}else b=f();var J=!Xr(($t||M).memoizedState,b);if(J&&(M.memoizedState=b,ti=!0),M=M.queue,ls(Un.bind(null,S,M,u),[u]),M.getSnapshot!==f||J||ei!==null&&ei.memoizedState.tag&1){if(S.flags|=2048,Ba(9,Xt.bind(null,S,M,b,f),{destroy:void 0},null),Mt===null)throw Error(r(349));O||(Es&60)!==0||xt(S,f,b)}return b}function xt(u,f,b){u.flags|=16384,u={getSnapshot:f,value:b},f=_t.updateQueue,f===null?(f=gd(),_t.updateQueue=f,f.stores=[u]):(b=f.stores,b===null?f.stores=[u]:b.push(u))}function Xt(u,f,b,S){f.value=b,f.getSnapshot=S,xi(f)&&Yi(u)}function Un(u,f,b){return b(function(){xi(f)&&Yi(u)})}function xi(u){var f=u.getSnapshot;u=u.value;try{var b=f();return!Xr(u,b)}catch{return!0}}function Yi(u){var f=At(u,2);f!==null&&Ki(f,u,2)}function Ti(u){var f=tn();if(typeof u=="function"){var b=u;if(u=b(),el){Y(!0);try{b()}finally{Y(!1)}}}return f.memoizedState=f.baseState=u,f.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:u},f}function un(u,f,b,S){return u.baseState=b,Hr(u,$t,typeof S=="function"?S:xr)}function or(u,f,b,S,M){if(vo(u))throw Error(r(485));if(u=f.action,u!==null){var O={payload:M,action:u,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(J){O.listeners.push(J)}};rt.T!==null?b(!0):O.isTransition=!1,S(O),b=f.pending,b===null?(O.next=f.pending=O,yo(f,O)):(O.next=b.next,f.pending=b.next=O)}}function yo(u,f){var b=f.action,S=f.payload,M=u.state;if(f.isTransition){var O=rt.T,J={};rt.T=J;try{var ie=b(M,S),fe=rt.S;fe!==null&&fe(J,ie),ha(u,f,ie)}catch(we){za(u,f,we)}finally{rt.T=O}}else try{O=b(M,S),ha(u,f,O)}catch(we){za(u,f,we)}}function ha(u,f,b){b!==null&&typeof b=="object"&&typeof b.then=="function"?b.then(function(S){wl(u,f,S)},function(S){return za(u,f,S)}):wl(u,f,b)}function wl(u,f,b){f.status="fulfilled",f.value=b,oc(f),u.state=b,f=u.pending,f!==null&&(b=f.next,b===f?u.pending=null:(b=b.next,f.next=b,yo(u,b)))}function za(u,f,b){var S=u.pending;if(u.pending=null,S!==null){S=S.next;do f.status="rejected",f.reason=b,oc(f),f=f.next;while(f!==S)}u.action=null}function oc(u){u=u.listeners;for(var f=0;f<u.length;f++)(0,u[f])()}function Di(u,f){return f}function as(u,f){if(Ft){var b=Mt.formState;if(b!==null){e:{var S=_t;if(Ft){if(ji){var M=Og(ji,ya);if(M){ji=pp(M),S=Dg(M);break e}}pe(S)}S=!1}S&&(f=b[0])}}b=tn(),b.memoizedState=b.baseState=f,S={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:f},b.queue=S,b=Af.bind(null,_t,S),S.dispatch=b,S=Ti(!1);var O=Mf.bind(null,_t,!1,S.queue);return S=tn(),M={state:f,dispatch:null,action:u,pending:null},S.queue=M,b=or.bind(null,_t,M,O,b),M.dispatch=b,S.memoizedState=u,[f,b,!1]}function ss(u){var f=nn();return Us(f,$t,u)}function Us(u,f,b){f=Hr(u,f,Di)[0],u=da(xr)[0],f=typeof f=="object"&&f!==null&&typeof f.then=="function"?lr(f):f;var S=nn(),M=S.queue,O=M.dispatch;return b!==S.memoizedState&&(_t.flags|=2048,Ba(9,oi.bind(null,M,b),{destroy:void 0},null)),[f,O,u]}function oi(u,f){u.action=f}function cu(u){var f=nn(),b=$t;if(b!==null)return Us(f,b,u);nn(),f=f.memoizedState,b=nn();var S=b.queue.dispatch;return b.memoizedState=u,[f,S,!1]}function Ba(u,f,b,S){return u={tag:u,create:f,inst:b,deps:S,next:null},f=_t.updateQueue,f===null&&(f=gd(),_t.updateQueue=f),b=f.lastEffect,b===null?f.lastEffect=u.next=u:(S=b.next,b.next=u,u.next=S,f.lastEffect=u),u}function it(){return nn().memoizedState}function bo(u,f,b,S){var M=tn();_t.flags|=u,M.memoizedState=Ba(1|f,b,{destroy:void 0},S===void 0?null:S)}function Hn(u,f,b,S){var M=nn();S=S===void 0?null:S;var O=M.memoizedState.inst;$t!==null&&S!==null&&li(S,$t.memoizedState.deps)?M.memoizedState=Ba(f,b,O,S):(_t.flags|=u,M.memoizedState=Ba(1|f,b,O,S))}function rn(u,f){bo(8390656,8,u,f)}function ls(u,f){Hn(2048,8,u,f)}function os(u,f){return Hn(4,2,u,f)}function cc(u,f){return Hn(4,4,u,f)}function Is(u,f){if(typeof f=="function"){u=u();var b=f(u);return function(){typeof b=="function"?b():f(null)}}if(f!=null)return u=u(),f.current=u,function(){f.current=null}}function De(u,f,b){b=b!=null?b.concat([u]):null,Hn(4,4,Is.bind(null,f,u),b)}function qe(){}function mt(u,f){var b=nn();f=f===void 0?null:f;var S=b.memoizedState;return f!==null&&li(f,S[1])?S[0]:(b.memoizedState=[u,f],u)}function Rt(u,f){var b=nn();f=f===void 0?null:f;var S=b.memoizedState;if(f!==null&&li(f,S[1]))return S[0];if(S=u(),el){Y(!0);try{u()}finally{Y(!1)}}return b.memoizedState=[S,f],S}function An(u,f,b){return b===void 0||(Es&1073741824)!==0?u.memoizedState=f:(u.memoizedState=b,u=fs(),_t.lanes|=u,ta|=u,b)}function jr(u,f,b,S){return Xr(b,f)?b:Ss.current!==null?(u=An(u,b,S),Xr(u,f)||(ti=!0),u):(Es&42)===0?(ti=!0,u.memoizedState=b):(u=fs(),_t.lanes|=u,ta|=u,f)}function uc(u,f,b,S,M){var O=vi();Zi(O!==0&&8>O?O:8);var J=rt.T,ie={};rt.T=ie,Mf(u,!1,f,b);try{var fe=M(),we=rt.S;if(we!==null&&we(ie,fe),fe!==null&&typeof fe=="object"&&typeof fe.then=="function"){var ke=kt(fe,S);Cl(u,f,ke,fr(u))}else Cl(u,f,S,fr(u))}catch(Be){Cl(u,f,{then:function(){},status:"rejected",reason:Be},fr())}finally{Zi(O),rt.T=J}}function uu(u){var f=u.memoizedState;if(f!==null)return f;f={memoizedState:Er,baseState:Er,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:Er},next:null};var b={};return f.next={memoizedState:b,baseState:b,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:b},next:null},u.memoizedState=f,u=u.alternate,u!==null&&(u.memoizedState=f),f}function xo(){return Bi(ot)}function cs(){return nn().memoizedState}function Cf(){return nn().memoizedState}function fu(u){for(var f=u.return;f!==null;){switch(f.tag){case 24:case 3:var b=fr();u=xn(b);var S=Zt(f,u,b);S!==null&&(Ki(S,f,b),Gn(S,f,b)),f={cache:Df()},u.payload=f;return}f=f.return}}function Tl(u,f,b){var S=fr();b={lane:S,revertLane:0,action:b,hasEagerState:!1,eagerState:null,next:null},vo(u)?du(f,b):(b=Ue(u,f,b,S),b!==null&&(Ki(b,u,S),vh(b,f,S)))}function Af(u,f,b){var S=fr();Cl(u,f,b,S)}function Cl(u,f,b,S){var M={lane:S,revertLane:0,action:b,hasEagerState:!1,eagerState:null,next:null};if(vo(u))du(f,M);else{var O=u.alternate;if(u.lanes===0&&(O===null||O.lanes===0)&&(O=f.lastRenderedReducer,O!==null))try{var J=f.lastRenderedState,ie=O(J,b);if(M.hasEagerState=!0,M.eagerState=ie,Xr(ie,J))return ut(u,f,M,0),Mt===null&&We(),!1}catch{}finally{}if(b=Ue(u,f,M,S),b!==null)return Ki(b,u,S),vh(b,f,S),!0}return!1}function Mf(u,f,b,S){if(S={lane:2,revertLane:Re(),action:S,hasEagerState:!1,eagerState:null,next:null},vo(u)){if(f)throw Error(r(479))}else f=Ue(u,b,S,2),f!==null&&Ki(f,u,2)}function vo(u){var f=u.alternate;return u===_t||f!==null&&f===_t}function du(u,f){kn=va=!0;var b=u.pending;b===null?f.next=f:(f.next=b.next,b.next=f),u.pending=f}function vh(u,f,b){if((b&4194176)!==0){var S=f.lanes;S&=u.pendingLanes,b|=S,f.lanes=b,q(u,b)}}function Vi(u,f,b,S){f=u.memoizedState,b=b(S,f),b=b==null?f:Ro({},f,b),u.memoizedState=b,u.lanes===0&&(u.updateQueue.baseState=b)}function Al(u,f,b,S,M,O,J){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(S,O,J):f.prototype&&f.prototype.isPureReactComponent?!Oa(b,S)||!Oa(M,O):!0}function hu(u,f,b,S){u=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(b,S),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(b,S),f.state!==u&&yd.enqueueReplaceState(f,f.state,null)}function La(u,f){var b=f;if("ref"in f){b={};for(var S in f)S!=="ref"&&(b[S]=f[S])}if(u=u.defaultProps){b===f&&(b=Ro({},b));for(var M in u)b[M]===void 0&&(b[M]=u[M])}return b}function Nf(u,f){try{var b=u.onUncaughtError;b(f.value,{componentStack:f.stack})}catch(S){setTimeout(function(){throw S})}}function Rf(u,f,b){try{var S=u.onCaughtError;S(b.value,{componentStack:b.stack,errorBoundary:f.tag===1?f.stateNode:null})}catch(M){setTimeout(function(){throw M})}}function pu(u,f,b){return b=xn(b),b.tag=3,b.payload={element:null},b.callback=function(){Nf(u,f)},b}function fc(u){return u=xn(u),u.tag=3,u}function mu(u,f,b,S){var M=b.type.getDerivedStateFromError;if(typeof M=="function"){var O=S.value;u.payload=function(){return M(O)},u.callback=function(){Rf(f,b,S)}}var J=b.stateNode;J!==null&&typeof J.componentDidCatch=="function"&&(u.callback=function(){Rf(f,b,S),typeof M!="function"&&(ia===null?ia=new Set([this]):ia.add(this));var ie=S.stack;this.componentDidCatch(S.value,{componentStack:ie!==null?ie:""})})}function ng(u,f,b,S,M){if(b.flags|=32768,S!==null&&typeof S=="object"&&typeof S.then=="function"){if(f=b.alternate,f!==null&&_o(f,b,M,!0),b=Jr.current,b!==null){switch(b.tag){case 13:return xa===null?Sr():b.alternate===null&&It===0&&(It=3),b.flags&=-257,b.flags|=65536,b.lanes=M,S===md?b.flags|=16384:(f=b.updateQueue,f===null?b.updateQueue=new Set([S]):f.add(S),Xf(u,S,M)),!1;case 22:return b.flags|=65536,S===md?b.flags|=16384:(f=b.updateQueue,f===null?(f={transitions:null,markerInstances:null,retryQueue:new Set([S])},b.updateQueue=f):(b=f.retryQueue,b===null?f.retryQueue=new Set([S]):b.add(S)),Xf(u,S,M)),!1}throw Error(r(435,b.tag))}return Xf(u,S,M),Sr(),!1}if(Ft)return f=Jr.current,f!==null?((f.flags&65536)===0&&(f.flags|=256),f.flags|=65536,f.lanes=M,S!==qu&&(u=Error(r(422),{cause:S}),Ie($(u,b)))):(S!==qu&&(f=Error(r(423),{cause:S}),Ie($(f,b))),u=u.current.alternate,u.flags|=65536,M&=-M,u.lanes|=M,S=$(S,b),M=pu(u.stateNode,S,M),Pt(u,M),It!==4&&(It=2)),!1;var O=Error(r(520),{cause:S});if(O=$(O,b),jc===null?jc=[O]:jc.push(O),It!==4&&(It=2),f===null)return!0;S=$(S,b),b=f;do{switch(b.tag){case 3:return b.flags|=65536,u=M&-M,b.lanes|=u,u=pu(b.stateNode,S,u),Pt(b,u),!1;case 1:if(f=b.type,O=b.stateNode,(b.flags&128)===0&&(typeof f.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(ia===null||!ia.has(O))))return b.flags|=65536,M&=-M,b.lanes|=M,M=fc(M),mu(M,u,b,S),Pt(b,M),!1}b=b.return}while(b!==null);return!1}function zi(u,f,b,S){f.child=u===null?Np(f,null,b,S):$l(f,u.child,b,S)}function ig(u,f,b,S,M){b=b.render;var O=f.ref;if("ref"in S){var J={};for(var ie in S)ie!=="ref"&&(J[ie]=S[ie])}else J=S;return So(f),S=Ur(u,f,b,J,O,M),ie=El(),u!==null&&!ti?(Da(u,f,M),Hs(u,f,M)):(Ft&&ie&&te(f),f.flags|=1,zi(u,f,S,M),f.child)}function rg(u,f,b,S,M){if(u===null){var O=b.type;return typeof O=="function"&&!Ys(O)&&O.defaultProps===void 0&&b.compare===null?(f.tag=15,f.type=O,kf(u,f,O,S,M)):(u=pa(b.type,null,S,f,f.mode,M),u.ref=f.ref,u.return=f,f.child=u)}if(O=u.child,!Ah(u,M)){var J=O.memoizedProps;if(b=b.compare,b=b!==null?b:Oa,b(J,S)&&u.ref===f.ref)return Hs(u,f,M)}return f.flags|=1,u=Wi(O,S),u.ref=f.ref,u.return=f,f.child=u}function kf(u,f,b,S,M){if(u!==null){var O=u.memoizedProps;if(Oa(O,S)&&u.ref===f.ref)if(ti=!1,f.pendingProps=S=O,Ah(u,M))(u.flags&131072)!==0&&(ti=!0);else return f.lanes=u.lanes,Hs(u,f,M)}return _h(u,f,b,S,M)}function ag(u,f,b){var S=f.pendingProps,M=S.children,O=(f.stateNode._pendingVisibility&2)!==0,J=u!==null?u.memoizedState:null;if(gu(u,f),S.mode==="hidden"||O){if((f.flags&128)!==0){if(S=J!==null?J.baseLanes|b:b,u!==null){for(M=f.child=u.child,O=0;M!==null;)O=O|M.lanes|M.childLanes,M=M.sibling;f.childLanes=O&~S}else f.childLanes=0,f.child=null;return sg(u,f,S,b)}if((b&536870912)!==0)f.memoizedState={baseLanes:0,cachePool:null},u!==null&&zf(f,J!==null?J.cachePool:null),J!==null?He(f,J):tt(),fa(f);else return f.lanes=f.childLanes=536870912,sg(u,f,J!==null?J.baseLanes|b:b,b)}else J!==null?(zf(f,J.cachePool),He(f,J),ar(),f.memoizedState=null):(u!==null&&zf(f,null),tt(),ar());return zi(u,f,M,b),f.child}function sg(u,f,b,S){var M=Rl();return M=M===null?null:{parent:ys?an._currentValue:an._currentValue2,pool:M},f.memoizedState={baseLanes:b,cachePool:M},u!==null&&zf(f,null),tt(),fa(f),u!==null&&_o(u,f,S,!0),null}function gu(u,f){var b=f.ref;if(b===null)u!==null&&u.ref!==null&&(f.flags|=2097664);else{if(typeof b!="function"&&typeof b!="object")throw Error(r(284));(u===null||u.ref!==b)&&(f.flags|=2097664)}}function _h(u,f,b,S,M){return So(f),b=Ur(u,f,b,S,void 0,M),S=El(),u!==null&&!ti?(Da(u,f,M),Hs(u,f,M)):(Ft&&S&&te(f),f.flags|=1,zi(u,f,b,M),f.child)}function lg(u,f,b,S,M,O){return So(f),f.updateQueue=null,b=_l(f,S,b,M),Bs(u),S=El(),u!==null&&!ti?(Da(u,f,O),Hs(u,f,O)):(Ft&&S&&te(f),f.flags|=1,zi(u,f,b,O),f.child)}function Sh(u,f,b,S,M){if(So(f),f.stateNode===null){var O=Bo,J=b.contextType;typeof J=="object"&&J!==null&&(O=Bi(J)),O=new b(S,O),f.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=yd,f.stateNode=O,O._reactInternals=f,O=f.stateNode,O.props=S,O.state=f.memoizedState,O.refs={},yi(f),J=b.contextType,O.context=typeof J=="object"&&J!==null?Bi(J):Bo,O.state=f.memoizedState,J=b.getDerivedStateFromProps,typeof J=="function"&&(Vi(f,b,J,S),O.state=f.memoizedState),typeof b.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(J=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),J!==O.state&&yd.enqueueReplaceState(O,O.state,null),Qn(f,S,O,M),Fi(),O.state=f.memoizedState),typeof O.componentDidMount=="function"&&(f.flags|=4194308),S=!0}else if(u===null){O=f.stateNode;var ie=f.memoizedProps,fe=La(b,ie);O.props=fe;var we=O.context,ke=b.contextType;J=Bo,typeof ke=="object"&&ke!==null&&(J=Bi(ke));var Be=b.getDerivedStateFromProps;ke=typeof Be=="function"||typeof O.getSnapshotBeforeUpdate=="function",ie=f.pendingProps!==ie,ke||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(ie||we!==J)&&hu(f,O,S,J),Js=!1;var je=f.memoizedState;O.state=je,Qn(f,S,O,M),Fi(),we=f.memoizedState,ie||je!==we||Js?(typeof Be=="function"&&(Vi(f,b,Be,S),we=f.memoizedState),(fe=Js||Al(f,b,fe,S,je,we,J))?(ke||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(f.flags|=4194308)):(typeof O.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=S,f.memoizedState=we),O.props=S,O.state=we,O.context=J,S=fe):(typeof O.componentDidMount=="function"&&(f.flags|=4194308),S=!1)}else{O=f.stateNode,rr(u,f),J=f.memoizedProps,ke=La(b,J),O.props=ke,Be=f.pendingProps,je=O.context,we=b.contextType,fe=Bo,typeof we=="object"&&we!==null&&(fe=Bi(we)),ie=b.getDerivedStateFromProps,(we=typeof ie=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(J!==Be||je!==fe)&&hu(f,O,S,fe),Js=!1,je=f.memoizedState,O.state=je,Qn(f,S,O,M),Fi();var ht=f.memoizedState;J!==Be||je!==ht||Js||u!==null&&u.dependencies!==null&&Nl(u.dependencies)?(typeof ie=="function"&&(Vi(f,b,ie,S),ht=f.memoizedState),(ke=Js||Al(f,b,ke,S,je,ht,fe)||u!==null&&u.dependencies!==null&&Nl(u.dependencies))?(we||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(S,ht,fe),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(S,ht,fe)),typeof O.componentDidUpdate=="function"&&(f.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof O.componentDidUpdate!="function"||J===u.memoizedProps&&je===u.memoizedState||(f.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||J===u.memoizedProps&&je===u.memoizedState||(f.flags|=1024),f.memoizedProps=S,f.memoizedState=ht),O.props=S,O.state=ht,O.context=fe,S=ke):(typeof O.componentDidUpdate!="function"||J===u.memoizedProps&&je===u.memoizedState||(f.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||J===u.memoizedProps&&je===u.memoizedState||(f.flags|=1024),S=!1)}return O=S,gu(u,f),S=(f.flags&128)!==0,O||S?(O=f.stateNode,b=S&&typeof b.getDerivedStateFromError!="function"?null:O.render(),f.flags|=1,u!==null&&S?(f.child=$l(f,u.child,null,M),f.child=$l(f,null,b,M)):zi(u,f,b,M),f.memoizedState=O.state,u=f.child):u=Hs(u,f,M),u}function og(u,f,b,S){return Pe(),f.flags|=256,zi(u,f,b,S),f.child}function Eh(u){return{baseLanes:u,cachePool:hg()}}function wh(u,f,b){return u=u!==null?u.childLanes&~b:0,f&&(u|=Nr),u}function cg(u,f,b){var S=f.pendingProps,M=!1,O=(f.flags&128)!==0,J;if((J=O)||(J=u!==null&&u.memoizedState===null?!1:(ui.current&2)!==0),J&&(M=!0,f.flags&=-129),J=(f.flags&32)!==0,f.flags&=-33,u===null){if(Ft){if(M?Gt(f):ar(),Ft){var ie=ji,fe;(fe=ie)&&(ie=Ig(ie,ya),ie!==null?(f.memoizedState={dehydrated:ie,treeContext:Pa!==null?{id:vs,overflow:ga}:null,retryLane:536870912},fe=n(18,null,null,0),fe.stateNode=ie,fe.return=f,f.child=fe,$i=f,ji=null,fe=!0):fe=!1),fe||pe(f)}if(ie=f.memoizedState,ie!==null&&(ie=ie.dehydrated,ie!==null))return Lu(ie)?f.lanes=16:f.lanes=536870912,null;qi(f)}return ie=S.children,S=S.fallback,M?(ar(),M=f.mode,ie=Th({mode:"hidden",children:ie},M),S=Xs(S,M,b,null),ie.return=f,S.return=f,ie.sibling=S,f.child=ie,M=f.child,M.memoizedState=Eh(b),M.childLanes=wh(u,J,b),f.memoizedState=Ji,S):(Gt(f),yu(f,ie))}if(fe=u.memoizedState,fe!==null&&(ie=fe.dehydrated,ie!==null)){if(O)f.flags&256?(Gt(f),f.flags&=-257,f=Ch(u,f,b)):f.memoizedState!==null?(ar(),f.child=u.child,f.flags|=128,f=null):(ar(),M=S.fallback,ie=f.mode,S=Th({mode:"visible",children:S.children},ie),M=Xs(M,ie,b,null),M.flags|=2,S.return=f,M.return=f,S.sibling=M,f.child=S,$l(f,u.child,null,b),S=f.child,S.memoizedState=Eh(b),S.childLanes=wh(u,J,b),f.memoizedState=Ji,f=M);else if(Gt(f),Lu(ie))J=kg(ie).digest,S=Error(r(419)),S.stack="",S.digest=J,Ie({value:S,source:null,stack:null}),f=Ch(u,f,b);else if(ti||_o(u,f,b,!1),J=(b&u.childLanes)!==0,ti||J){if(J=Mt,J!==null){if(S=b&-b,(S&42)!==0)S=1;else switch(S){case 2:S=1;break;case 8:S=4;break;case 32:S=16;break;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:S=64;break;case 268435456:S=134217728;break;default:S=0}if(S=(S&(J.suspendedLanes|b))!==0?0:S,S!==0&&S!==fe.retryLane)throw fe.retryLane=S,At(u,S),Ki(J,u,S),Jg}ad(ie)||Sr(),f=Ch(u,f,b)}else ad(ie)?(f.flags|=128,f.child=u.child,f=Mo.bind(null,u),vb(ie,f),f=null):(u=fe.treeContext,dr&&(ji=Bg(ie),$i=f,Ft=!0,Zr=null,ya=!1,u!==null&&(Kr[Wr++]=vs,Kr[Wr++]=ga,Kr[Wr++]=Pa,vs=u.id,ga=u.overflow,Pa=f)),f=yu(f,S.children),f.flags|=4096);return f}return M?(ar(),M=S.fallback,ie=f.mode,fe=u.child,O=fe.sibling,S=Wi(fe,{mode:"hidden",children:S.children}),S.subtreeFlags=fe.subtreeFlags&31457280,O!==null?M=Wi(O,M):(M=Xs(M,ie,b,null),M.flags|=2),M.return=f,S.return=f,S.sibling=M,f.child=S,S=M,M=f.child,ie=u.child.memoizedState,ie===null?ie=Eh(b):(fe=ie.cachePool,fe!==null?(O=ys?an._currentValue:an._currentValue2,fe=fe.parent!==O?{parent:O,pool:O}:fe):fe=hg(),ie={baseLanes:ie.baseLanes|b,cachePool:fe}),M.memoizedState=ie,M.childLanes=wh(u,J,b),f.memoizedState=Ji,S):(Gt(f),b=u.child,u=b.sibling,b=Wi(b,{mode:"visible",children:S.children}),b.return=f,b.sibling=null,u!==null&&(J=f.deletions,J===null?(f.deletions=[u],f.flags|=16):J.push(u)),f.child=b,f.memoizedState=null,b)}function yu(u,f){return f=Th({mode:"visible",children:f},u.mode),f.return=u,u.child=f}function Th(u,f){return Kf(u,f,0,null)}function Ch(u,f,b){return $l(f,u.child,null,b),u=yu(f,f.pendingProps.children),u.flags|=2,f.memoizedState=null,u}function ug(u,f,b){u.lanes|=f;var S=u.alternate;S!==null&&(S.lanes|=f),Mh(u.return,f,b)}function Of(u,f,b,S,M){var O=u.memoizedState;O===null?u.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:S,tail:b,tailMode:M}:(O.isBackwards=f,O.rendering=null,O.renderingStartTime=0,O.last=S,O.tail=b,O.tailMode=M)}function fg(u,f,b){var S=f.pendingProps,M=S.revealOrder,O=S.tail;if(zi(u,f,S.children,b),S=ui.current,(S&2)!==0)S=S&1|2,f.flags|=128;else{if(u!==null&&(u.flags&128)!==0)e:for(u=f.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&ug(u,b,f);else if(u.tag===19)ug(u,b,f);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===f)break e;for(;u.sibling===null;){if(u.return===null||u.return===f)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}S&=1}switch(k(ui,S),M){case"forwards":for(b=f.child,M=null;b!==null;)u=b.alternate,u!==null&&sr(u)===null&&(M=b),b=b.sibling;b=M,b===null?(M=f.child,f.child=null):(M=b.sibling,b.sibling=null),Of(f,!1,M,b,O);break;case"backwards":for(b=null,M=f.child,f.child=null;M!==null;){if(u=M.alternate,u!==null&&sr(u)===null){f.child=M;break}u=M.sibling,M.sibling=b,b=M,M=u}Of(f,!0,b,null,O);break;case"together":Of(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Hs(u,f,b){if(u!==null&&(f.dependencies=u.dependencies),ta|=f.lanes,(b&f.childLanes)===0)if(u!==null){if(_o(u,f,b,!1),(b&f.childLanes)===0)return null}else return null;if(u!==null&&f.child!==u.child)throw Error(r(153));if(f.child!==null){for(u=f.child,b=Wi(u,u.pendingProps),f.child=b,b.return=f;u.sibling!==null;)u=u.sibling,b=b.sibling=Wi(u,u.pendingProps),b.return=f;b.sibling=null}return f.child}function Ah(u,f){return(u.lanes&f)!==0?!0:(u=u.dependencies,!!(u!==null&&Nl(u)))}function yb(u,f,b){switch(f.tag){case 3:le(f,f.stateNode.containerInfo),Ml(f,an,u.memoizedState.cache),Pe();break;case 27:case 5:ge(f);break;case 4:le(f,f.stateNode.containerInfo);break;case 10:Ml(f,f.type,f.memoizedProps.value);break;case 13:var S=f.memoizedState;if(S!==null)return S.dehydrated!==null?(Gt(f),f.flags|=128,null):(b&f.child.childLanes)!==0?cg(u,f,b):(Gt(f),u=Hs(u,f,b),u!==null?u.sibling:null);Gt(f);break;case 19:var M=(u.flags&128)!==0;if(S=(b&f.childLanes)!==0,S||(_o(u,f,b,!1),S=(b&f.childLanes)!==0),M){if(S)return fg(u,f,b);f.flags|=128}if(M=f.memoizedState,M!==null&&(M.rendering=null,M.tail=null,M.lastEffect=null),k(ui,ui.current),S)break;return null;case 22:case 23:return f.lanes=0,ag(u,f,b);case 24:Ml(f,an,u.memoizedState.cache)}return Hs(u,f,b)}function dg(u,f,b){if(u!==null)if(u.memoizedProps!==f.pendingProps)ti=!0;else{if(!Ah(u,b)&&(f.flags&128)===0)return ti=!1,yb(u,f,b);ti=(u.flags&131072)!==0}else ti=!1,Ft&&(f.flags&1048576)!==0&&K(f,Gu,f.index);switch(f.lanes=0,f.tag){case 16:e:{u=f.pendingProps;var S=f.elementType,M=S._init;if(S=M(S._payload),f.type=S,typeof S=="function")Ys(S)?(u=La(S,u),f.tag=1,f=Sh(null,f,S,u,b)):(f.tag=0,f=_h(null,f,S,u,b));else{if(S!=null){if(M=S.$$typeof,M===Ac){f.tag=11,f=ig(null,f,S,u,b);break e}else if(M===Mu){f.tag=14,f=rg(null,f,S,u,b);break e}}throw f=l(S)||S,Error(r(306,f,""))}}return f;case 0:return _h(u,f,f.type,f.pendingProps,b);case 1:return S=f.type,M=La(S,f.pendingProps),Sh(u,f,S,M,b);case 3:e:{if(le(f,f.stateNode.containerInfo),u===null)throw Error(r(387));var O=f.pendingProps;M=f.memoizedState,S=M.element,rr(u,f),Qn(f,O,null,b);var J=f.memoizedState;if(O=J.cache,Ml(f,an,O),O!==M.cache&&Nh(f,[an],b,!0),Fi(),O=J.element,dr&&M.isDehydrated)if(M={element:O,isDehydrated:!1,cache:J.cache},f.updateQueue.baseState=M,f.memoizedState=M,f.flags&256){f=og(u,f,O,b);break e}else if(O!==S){S=$(Error(r(424)),f),Ie(S),f=og(u,f,O,b);break e}else for(dr&&(ji=zg(f.stateNode.containerInfo),$i=f,Ft=!0,Zr=null,ya=!0),b=Np(f,null,O,b),f.child=b;b;)b.flags=b.flags&-3|4096,b=b.sibling;else{if(Pe(),O===S){f=Hs(u,f,b);break e}zi(u,f,O,b)}f=f.child}return f;case 26:if(Vr)return gu(u,f),u===null?(b=ud(f.type,null,f.pendingProps,null))?f.memoizedState=b:Ft||(f.stateNode=Sb(f.type,f.pendingProps,Ga.current,f)):f.memoizedState=ud(f.type,u.memoizedProps,f.pendingProps,u.memoizedState),null;case 27:if(Ii)return ge(f),u===null&&Ii&&Ft&&(S=f.stateNode=Tp(f.type,f.pendingProps,Ga.current,Ri.current,!1),$i=f,ya=!0,ji=sd(S)),S=f.pendingProps.children,u!==null||Ft?zi(u,f,S,b):f.child=$l(f,null,S,b),gu(u,f),f.child;case 5:return u===null&&Ft&&(Fg(f.type,f.pendingProps,Ri.current),(M=S=ji)&&(S=Lg(S,f.type,f.pendingProps,ya),S!==null?(f.stateNode=S,$i=f,ji=sd(S),ya=!1,M=!0):M=!1),M||pe(f)),ge(f),M=f.type,O=f.pendingProps,J=u!==null?u.memoizedProps:null,S=O.children,Vl(M,O)?S=null:J!==null&&Vl(M,J)&&(f.flags|=32),f.memoizedState!==null&&(M=Ur(u,f,Sl,null,null,b),ys?ot._currentValue=M:ot._currentValue2=M),gu(u,f),zi(u,f,S,b),f.child;case 6:return u===null&&Ft&&(qg(f.pendingProps,Ri.current),(u=b=ji)&&(b=Ug(b,f.pendingProps,ya),b!==null?(f.stateNode=b,$i=f,ji=null,u=!0):u=!1),u||pe(f)),null;case 13:return cg(u,f,b);case 4:return le(f,f.stateNode.containerInfo),S=f.pendingProps,u===null?f.child=$l(f,null,S,b):zi(u,f,S,b),f.child;case 11:return ig(u,f,f.type,f.pendingProps,b);case 7:return zi(u,f,f.pendingProps,b),f.child;case 8:return zi(u,f,f.pendingProps.children,b),f.child;case 12:return zi(u,f,f.pendingProps.children,b),f.child;case 10:return S=f.pendingProps,Ml(f,f.type,S.value),zi(u,f,S.children,b),f.child;case 9:return M=f.type._context,S=f.pendingProps.children,So(f),M=Bi(M),S=S(M),f.flags|=1,zi(u,f,S,b),f.child;case 14:return rg(u,f,f.type,f.pendingProps,b);case 15:return kf(u,f,f.type,f.pendingProps,b);case 19:return fg(u,f,b);case 22:return ag(u,f,b);case 24:return So(f),S=Bi(an),u===null?(M=Rl(),M===null&&(M=Mt,O=Df(),M.pooledCache=O,O.refCount++,O!==null&&(M.pooledCacheLanes|=b),M=O),f.memoizedState={parent:S,cache:M},yi(f),Ml(f,an,M)):((u.lanes&b)!==0&&(rr(u,f),Qn(f,null,null,b),Fi()),M=u.memoizedState,O=f.memoizedState,M.parent!==S?(M={parent:S,cache:S},f.memoizedState=M,f.lanes===0&&(f.memoizedState=f.updateQueue.baseState=M),Ml(f,an,S)):(S=O.cache,Ml(f,an,S),S!==M.cache&&Nh(f,[an],b,!0))),zi(u,f,f.pendingProps.children,b),f.child;case 29:throw f.pendingProps}throw Error(r(156,f.tag))}function Ml(u,f,b){ys?(k(Ar,f._currentValue),f._currentValue=b):(k(Ar,f._currentValue2),f._currentValue2=b)}function js(u){var f=Ar.current;ys?u._currentValue=f:u._currentValue2=f,w(Ar)}function Mh(u,f,b){for(;u!==null;){var S=u.alternate;if((u.childLanes&f)!==f?(u.childLanes|=f,S!==null&&(S.childLanes|=f)):S!==null&&(S.childLanes&f)!==f&&(S.childLanes|=f),u===b)break;u=u.return}}function Nh(u,f,b,S){var M=u.child;for(M!==null&&(M.return=u);M!==null;){var O=M.dependencies;if(O!==null){var J=M.child;O=O.firstContext;e:for(;O!==null;){var ie=O;O=M;for(var fe=0;fe<f.length;fe++)if(ie.context===f[fe]){O.lanes|=b,ie=O.alternate,ie!==null&&(ie.lanes|=b),Mh(O.return,b,u),S||(J=null);break e}O=ie.next}}else if(M.tag===18){if(J=M.return,J===null)throw Error(r(341));J.lanes|=b,O=J.alternate,O!==null&&(O.lanes|=b),Mh(J,b,u),J=null}else J=M.child;if(J!==null)J.return=M;else for(J=M;J!==null;){if(J===u){J=null;break}if(M=J.sibling,M!==null){M.return=J.return,J=M;break}J=J.return}M=J}}function _o(u,f,b,S){u=null;for(var M=f,O=!1;M!==null;){if(!O){if((M.flags&524288)!==0)O=!0;else if((M.flags&262144)!==0)break}if(M.tag===10){var J=M.alternate;if(J===null)throw Error(r(387));if(J=J.memoizedProps,J!==null){var ie=M.type;Xr(M.pendingProps.value,J.value)||(u!==null?u.push(ie):u=[ie])}}else if(M===zc.current){if(J=M.alternate,J===null)throw Error(r(387));J.memoizedState.memoizedState!==M.memoizedState.memoizedState&&(u!==null?u.push(ot):u=[ot])}M=M.return}u!==null&&Nh(f,u,b,S),f.flags|=262144}function Nl(u){for(u=u.firstContext;u!==null;){var f=u.context;if(!Xr(ys?f._currentValue:f._currentValue2,u.memoizedValue))return!0;u=u.next}return!1}function So(u){Jl=u,Xn=null,u=u.dependencies,u!==null&&(u.firstContext=null)}function Bi(u){return Rh(Jl,u)}function bu(u,f){return Jl===null&&So(u),Rh(u,f)}function Rh(u,f){var b=ys?f._currentValue:f._currentValue2;if(f={context:f,memoizedValue:b,next:null},Xn===null){if(u===null)throw Error(r(308));Xn=f,u.dependencies={lanes:0,firstContext:f},u.flags|=524288}else Xn=Xn.next=f;return b}function Df(){return{controller:new ey,data:new Map,refCount:0}}function dc(u){u.refCount--,u.refCount===0&&tl(Io,function(){u.controller.abort()})}function Rl(){var u=nl.current;return u!==null?u:Mt.pooledCache}function zf(u,f){f===null?k(nl,nl.current):k(nl,f.pool)}function hg(){var u=Rl();return u===null?null:{parent:ys?an._currentValue:an._currentValue2,pool:u}}function Pr(u){u.flags|=4}function kh(u,f){if(u!==null&&u.child===f.child)return!1;if((f.flags&16)!==0)return!0;for(u=f.child;u!==null;){if((u.flags&13878)!==0||(u.subtreeFlags&13878)!==0)return!0;u=u.sibling}return!1}function Bf(u,f,b,S){if(Ui)for(b=f.child;b!==null;){if(b.tag===5||b.tag===6)gs(u,b.stateNode);else if(!(b.tag===4||Ii&&b.tag===27)&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===f)break;for(;b.sibling===null;){if(b.return===null||b.return===f)return;b=b.return}b.sibling.return=b.return,b=b.sibling}else if(qr)for(var M=f.child;M!==null;){if(M.tag===5){var O=M.stateNode;b&&S&&(O=dp(O,M.type,M.memoizedProps)),gs(u,O)}else if(M.tag===6)O=M.stateNode,b&&S&&(O=hp(O,M.memoizedProps)),gs(u,O);else if(M.tag!==4){if(M.tag===22&&M.memoizedState!==null)O=M.child,O!==null&&(O.return=M),Bf(u,M,!0,!0);else if(M.child!==null){M.child.return=M,M=M.child;continue}}if(M===f)break;for(;M.sibling===null;){if(M.return===null||M.return===f)return;M=M.return}M.sibling.return=M.return,M=M.sibling}}function hc(u,f,b,S){if(qr)for(var M=f.child;M!==null;){if(M.tag===5){var O=M.stateNode;b&&S&&(O=dp(O,M.type,M.memoizedProps)),up(u,O)}else if(M.tag===6)O=M.stateNode,b&&S&&(O=hp(O,M.memoizedProps)),up(u,O);else if(M.tag!==4){if(M.tag===22&&M.memoizedState!==null)O=M.child,O!==null&&(O.return=M),hc(u,M,!(M.memoizedProps!==null&&M.memoizedProps.mode==="manual"),!0);else if(M.child!==null){M.child.return=M,M=M.child;continue}}if(M===f)break;for(;M.sibling===null;){if(M.return===null||M.return===f)return;M=M.return}M.sibling.return=M.return,M=M.sibling}}function pc(u,f){if(qr&&kh(u,f)){u=f.stateNode;var b=u.containerInfo,S=rd();hc(S,f,!1,!1),u.pendingChildren=S,Pr(f),Rg(b,S)}}function Oh(u,f,b,S){if(Ui)u.memoizedProps!==S&&Pr(f);else if(qr){var M=u.stateNode,O=u.memoizedProps;if((u=kh(u,f))||O!==S){var J=Ri.current;O=cp(M,b,O,S,!u,null),O===M?f.stateNode=M:(Ws(O,b,S,J)&&Pr(f),f.stateNode=O,u?Bf(O,f,!1,!1):Pr(f))}else f.stateNode=M}}function mc(u,f,b){if(Ag(f,b)){if(u.flags|=16777216,!Zs(f,b))if(wu())u.flags|=8192;else throw Uo=md,Mp}else u.flags&=-16777217}function Dh(u,f){if(Yg(f)){if(u.flags|=16777216,!Ep(f))if(wu())u.flags|=8192;else throw Uo=md,Mp}else u.flags&=-16777217}function xu(u,f){f!==null&&(u.flags|=4),u.flags&16384&&(f=u.tag!==22?P():536870912,u.lanes|=f,rl|=f)}function Eo(u,f){if(!Ft)switch(u.tailMode){case"hidden":f=u.tail;for(var b=null;f!==null;)f.alternate!==null&&(b=f),f=f.sibling;b===null?u.tail=null:b.sibling=null;break;case"collapsed":b=u.tail;for(var S=null;b!==null;)b.alternate!==null&&(S=b),b=b.sibling;S===null?f||u.tail===null?u.tail=null:u.tail.sibling=null:S.sibling=null}}function Mn(u){var f=u.alternate!==null&&u.alternate.child===u.child,b=0,S=0;if(f)for(var M=u.child;M!==null;)b|=M.lanes|M.childLanes,S|=M.subtreeFlags&31457280,S|=M.flags&31457280,M.return=u,M=M.sibling;else for(M=u.child;M!==null;)b|=M.lanes|M.childLanes,S|=M.subtreeFlags,S|=M.flags,M.return=u,M=M.sibling;return u.subtreeFlags|=S,u.childLanes=b,f}function pg(u,f,b){var S=f.pendingProps;switch(U(f),f.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mn(f),null;case 1:return Mn(f),null;case 3:return b=f.stateNode,S=null,u!==null&&(S=u.memoizedState.cache),f.memoizedState.cache!==S&&(f.flags|=2048),js(an),de(),b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(u===null||u.child===null)&&(Ge(f)?Pr(f):u===null||u.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,Zr!==null&&(Gs(Zr),Zr=null))),pc(u,f),Mn(f),null;case 26:if(Vr){b=f.type;var M=f.memoizedState;return u===null?(Pr(f),M!==null?(Mn(f),Dh(f,M)):(Mn(f),mc(f,b,S))):M?M!==u.memoizedState?(Pr(f),Mn(f),Dh(f,M)):(Mn(f),f.flags&=-16777217):(Ui?u.memoizedProps!==S&&Pr(f):Oh(u,f,b,S),Mn(f),mc(f,b,S)),null}case 27:if(Ii){if(se(f),b=Ga.current,M=f.type,u!==null&&f.stateNode!=null)Ui?u.memoizedProps!==S&&Pr(f):Oh(u,f,M,S);else{if(!S){if(f.stateNode===null)throw Error(r(166));return Mn(f),null}u=Ri.current,Ge(f)?Ae(f,u):(u=Tp(M,S,b,u,!0),f.stateNode=u,Pr(f))}return Mn(f),null}case 5:if(se(f),b=f.type,u!==null&&f.stateNode!=null)Oh(u,f,b,S);else{if(!S){if(f.stateNode===null)throw Error(r(166));return Mn(f),null}u=Ri.current,Ge(f)?Ae(f,u):(M=Qh(b,S,Ga.current,u,f),Bf(M,f,!1,!1),f.stateNode=M,Ws(M,b,S,u)&&Pr(f))}return Mn(f),mc(f,f.type,f.pendingProps),null;case 6:if(u&&f.stateNode!=null)b=u.memoizedProps,Ui?b!==S&&Pr(f):qr&&(b!==S?(f.stateNode=Qf(S,Ga.current,Ri.current,f),Pr(f)):f.stateNode=u.stateNode);else{if(typeof S!="string"&&f.stateNode===null)throw Error(r(166));if(u=Ga.current,b=Ri.current,Ge(f)){if(!dr)throw Error(r(176));if(u=f.stateNode,b=f.memoizedProps,S=null,M=$i,M!==null)switch(M.tag){case 27:case 5:S=M.memoizedProps}Hg(u,b,f,S)||pe(f)}else f.stateNode=Qf(S,u,b,f)}return Mn(f),null;case 13:if(S=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(M=Ge(f),S!==null&&S.dehydrated!==null){if(u===null){if(!M)throw Error(r(318));if(!dr)throw Error(r(344));if(M=f.memoizedState,M=M!==null?M.dehydrated:null,!M)throw Error(r(317));Nc(M,f)}else Pe(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;Mn(f),M=!1}else Zr!==null&&(Gs(Zr),Zr=null),M=!0;if(!M)return f.flags&256?(qi(f),f):(qi(f),null)}if(qi(f),(f.flags&128)!==0)return f.lanes=b,f;if(b=S!==null,u=u!==null&&u.memoizedState!==null,b){S=f.child,M=null,S.alternate!==null&&S.alternate.memoizedState!==null&&S.alternate.memoizedState.cachePool!==null&&(M=S.alternate.memoizedState.cachePool.pool);var O=null;S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(O=S.memoizedState.cachePool.pool),O!==M&&(S.flags|=2048)}return b!==u&&b&&(f.child.flags|=8192),xu(f,f.updateQueue),Mn(f),null;case 4:return de(),pc(u,f),u===null&&tp(f.stateNode.containerInfo),Mn(f),null;case 10:return js(f.type),Mn(f),null;case 19:if(w(ui),M=f.memoizedState,M===null)return Mn(f),null;if(S=(f.flags&128)!==0,O=M.rendering,O===null)if(S)Eo(M,!1);else{if(It!==0||u!==null&&(u.flags&128)!==0)for(u=f.child;u!==null;){if(O=sr(u),O!==null){for(f.flags|=128,Eo(M,!1),u=O.updateQueue,f.updateQueue=u,xu(f,u),f.subtreeFlags=0,u=b,b=f.child;b!==null;)Vs(b,u),b=b.sibling;return k(ui,ui.current&1|2),f.child}u=u.sibling}M.tail!==null&&Hi()>Pn&&(f.flags|=128,S=!0,Eo(M,!1),f.lanes=4194304)}else{if(!S)if(u=sr(O),u!==null){if(f.flags|=128,S=!0,u=u.updateQueue,f.updateQueue=u,xu(f,u),Eo(M,!0),M.tail===null&&M.tailMode==="hidden"&&!O.alternate&&!Ft)return Mn(f),null}else 2*Hi()-M.renderingStartTime>Pn&&b!==536870912&&(f.flags|=128,S=!0,Eo(M,!1),f.lanes=4194304);M.isBackwards?(O.sibling=f.child,f.child=O):(u=M.last,u!==null?u.sibling=O:f.child=O,M.last=O)}return M.tail!==null?(f=M.tail,M.rendering=f,M.tail=f.sibling,M.renderingStartTime=Hi(),f.sibling=null,u=ui.current,k(ui,S?u&1|2:u&1),f):(Mn(f),null);case 22:case 23:return qi(f),Cn(),S=f.memoizedState!==null,u!==null?u.memoizedState!==null!==S&&(f.flags|=8192):S&&(f.flags|=8192),S?(b&536870912)!==0&&(f.flags&128)===0&&(Mn(f),f.subtreeFlags&6&&(f.flags|=8192)):Mn(f),b=f.updateQueue,b!==null&&xu(f,b.retryQueue),b=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(b=u.memoizedState.cachePool.pool),S=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(S=f.memoizedState.cachePool.pool),S!==b&&(f.flags|=2048),u!==null&&w(nl),null;case 24:return b=null,u!==null&&(b=u.memoizedState.cache),f.memoizedState.cache!==b&&(f.flags|=2048),js(an),Mn(f),null;case 25:return null}throw Error(r(156,f.tag))}function mg(u,f){switch(U(f),f.tag){case 1:return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return js(an),de(),u=f.flags,(u&65536)!==0&&(u&128)===0?(f.flags=u&-65537|128,f):null;case 26:case 27:case 5:return se(f),null;case 13:if(qi(f),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(r(340));Pe()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return w(ui),null;case 4:return de(),null;case 10:return js(f.type),null;case 22:case 23:return qi(f),Cn(),u!==null&&w(nl),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 24:return js(an),null;case 25:return null;default:return null}}function zh(u,f){switch(U(f),f.tag){case 3:js(an),de();break;case 26:case 27:case 5:se(f);break;case 4:de();break;case 13:qi(f);break;case 19:w(ui);break;case 10:js(f.type);break;case 22:case 23:qi(f),Cn(),u!==null&&w(nl);break;case 24:js(an)}}function vu(u,f){try{var b=f.updateQueue,S=b!==null?b.lastEffect:null;if(S!==null){var M=S.next;b=M;do{if((b.tag&u)===u){S=void 0;var O=b.create,J=b.inst;S=O(),J.destroy=S}b=b.next}while(b!==M)}}catch(ie){Ot(f,f.return,ie)}}function kl(u,f,b){try{var S=f.updateQueue,M=S!==null?S.lastEffect:null;if(M!==null){var O=M.next;S=O;do{if((S.tag&u)===u){var J=S.inst,ie=J.destroy;if(ie!==void 0){J.destroy=void 0,M=f;var fe=b;try{ie()}catch(we){Ot(M,fe,we)}}}S=S.next}while(S!==O)}}catch(we){Ot(f,f.return,we)}}function gg(u){var f=u.updateQueue;if(f!==null){var b=u.stateNode;try{is(f,b)}catch(S){Ot(u,u.return,S)}}}function yg(u,f,b){b.props=La(u.type,u.memoizedProps),b.state=u.memoizedState;try{b.componentWillUnmount()}catch(S){Ot(u,f,S)}}function wo(u,f){try{var b=u.ref;if(b!==null){var S=u.stateNode;switch(u.tag){case 26:case 27:case 5:var M=Mc(S);break;default:M=S}typeof b=="function"?u.refCleanup=b(M):b.current=M}}catch(O){Ot(u,f,O)}}function Nn(u,f){var b=u.ref,S=u.refCleanup;if(b!==null)if(typeof S=="function")try{S()}catch(M){Ot(u,f,M)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof b=="function")try{b(null)}catch(M){Ot(u,f,M)}else b.current=null}function gc(u){var f=u.type,b=u.memoizedProps,S=u.stateNode;try{xb(S,f,b,u)}catch(M){Ot(u,u.return,M)}}function Bh(u,f,b){try{ap(u.stateNode,u.type,b,f,u)}catch(S){Ot(u,u.return,S)}}function Lh(u){return u.tag===5||u.tag===3||(Vr?u.tag===26:!1)||(Ii?u.tag===27:!1)||u.tag===4}function Lf(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Lh(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&(!Ii||u.tag!==27)&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function Uf(u,f,b){var S=u.tag;if(S===5||S===6)u=u.stateNode,f?lp(b,u,f):Mg(b,u);else if(!(S===4||Ii&&S===27)&&(u=u.child,u!==null))for(Uf(u,f,b),u=u.sibling;u!==null;)Uf(u,f,b),u=u.sibling}function yc(u,f,b){var S=u.tag;if(S===5||S===6)u=u.stateNode,f?sp(b,u,f):rp(b,u);else if(!(S===4||Ii&&S===27)&&(u=u.child,u!==null))for(yc(u,f,b),u=u.sibling;u!==null;)yc(u,f,b),u=u.sibling}function bg(u,f,b){u=u.containerInfo;try{fp(u,b)}catch(S){Ot(f,f.return,S)}}function bc(u,f){for(Yl(u.containerInfo),Kn=f;Kn!==null;)if(u=Kn,f=u.child,(u.subtreeFlags&1028)!==0&&f!==null)f.return=u,Kn=f;else for(;Kn!==null;){u=Kn;var b=u.alternate;switch(f=u.flags,u.tag){case 0:break;case 11:case 15:break;case 1:if((f&1024)!==0&&b!==null){f=void 0;var S=u,M=b.memoizedProps;b=b.memoizedState;var O=S.stateNode;try{var J=La(S.type,M,S.elementType===S.type);f=O.getSnapshotBeforeUpdate(J,b),O.__reactInternalSnapshotBeforeUpdate=f}catch(ie){Ot(S,S.return,ie)}}break;case 3:(f&1024)!==0&&Ui&&id(u.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((f&1024)!==0)throw Error(r(163))}if(f=u.sibling,f!==null){f.return=u.return,Kn=f;break}Kn=u.return}return J=Ho,Ho=!1,J}function If(u,f,b){var S=b.flags;switch(b.tag){case 0:case 11:case 15:us(u,b),S&4&&vu(5,b);break;case 1:if(us(u,b),S&4)if(u=b.stateNode,f===null)try{u.componentDidMount()}catch(ie){Ot(b,b.return,ie)}else{var M=La(b.type,f.memoizedProps);f=f.memoizedState;try{u.componentDidUpdate(M,f,u.__reactInternalSnapshotBeforeUpdate)}catch(ie){Ot(b,b.return,ie)}}S&64&&gg(b),S&512&&wo(b,b.return);break;case 3:if(us(u,b),S&64&&(S=b.updateQueue,S!==null)){if(u=null,b.child!==null)switch(b.child.tag){case 27:case 5:u=Mc(b.child.stateNode);break;case 1:u=b.child.stateNode}try{is(S,u)}catch(ie){Ot(b,b.return,ie)}}break;case 26:if(Vr){us(u,b),S&512&&wo(b,b.return);break}case 27:case 5:us(u,b),f===null&&S&4&&gc(b),S&512&&wo(b,b.return);break;case 12:us(u,b);break;case 13:us(u,b),S&4&&Ol(u,b);break;case 22:if(M=b.memoizedState!==null||_i,!M){f=f!==null&&f.memoizedState!==null||jn;var O=_i,J=jn;_i=M,(jn=f)&&!J?zl(u,b,(b.subtreeFlags&8772)!==0):us(u,b),_i=O,jn=J}S&512&&(b.memoizedProps.mode==="manual"?wo(b,b.return):Nn(b,b.return));break;default:us(u,b)}}function xc(u){var f=u.alternate;f!==null&&(u.alternate=null,xc(f)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(f=u.stateNode,f!==null&&np(f)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function Gr(u,f,b){for(b=b.child;b!==null;)Hf(u,f,b),b=b.sibling}function Hf(u,f,b){if(Tr&&typeof Tr.onCommitFiberUnmount=="function")try{Tr.onCommitFiberUnmount(Dc,b)}catch{}switch(b.tag){case 26:if(Vr){jn||Nn(b,f),Gr(u,f,b),b.memoizedState?bp(b.memoizedState):b.stateNode&&_p(b.stateNode);break}case 27:if(Ii){jn||Nn(b,f);var S=ni,M=Mr;ni=b.stateNode,Gr(u,f,b),Vg(b.stateNode),ni=S,Mr=M;break}case 5:jn||Nn(b,f);case 6:if(Ui){if(S=ni,M=Mr,ni=null,Gr(u,f,b),ni=S,Mr=M,ni!==null)if(Mr)try{Jn(ni,b.stateNode)}catch(O){Ot(b,f,O)}else try{hr(ni,b.stateNode)}catch(O){Ot(b,f,O)}}else Gr(u,f,b);break;case 18:Ui&&ni!==null&&(Mr?mp(ni,b.stateNode):Pg(ni,b.stateNode));break;case 4:Ui?(S=ni,M=Mr,ni=b.stateNode.containerInfo,Mr=!0,Gr(u,f,b),ni=S,Mr=M):(qr&&bg(b.stateNode,b,rd()),Gr(u,f,b));break;case 0:case 11:case 14:case 15:jn||kl(2,b,f),jn||kl(4,b,f),Gr(u,f,b);break;case 1:jn||(Nn(b,f),S=b.stateNode,typeof S.componentWillUnmount=="function"&&yg(b,f,S)),Gr(u,f,b);break;case 21:Gr(u,f,b);break;case 22:jn||Nn(b,f),jn=(S=jn)||b.memoizedState!==null,Gr(u,f,b),jn=S;break;default:Gr(u,f,b)}}function Ol(u,f){if(dr&&f.memoizedState===null&&(u=f.alternate,u!==null&&(u=u.memoizedState,u!==null&&(u=u.dehydrated,u!==null))))try{od(u)}catch(b){Ot(f,f.return,b)}}function vc(u){switch(u.tag){case 13:case 19:var f=u.stateNode;return f===null&&(f=u.stateNode=new Hc),f;case 22:return u=u.stateNode,f=u._retryCache,f===null&&(f=u._retryCache=new Hc),f;default:throw Error(r(435,u.tag))}}function _u(u,f){var b=vc(u);f.forEach(function(S){var M=Ph.bind(null,u,S);b.has(S)||(b.add(S),S.then(M,M))})}function cr(u,f){var b=f.deletions;if(b!==null)for(var S=0;S<b.length;S++){var M=b[S],O=u,J=f;if(Ui){var ie=J;e:for(;ie!==null;){switch(ie.tag){case 27:case 5:ni=ie.stateNode,Mr=!1;break e;case 3:ni=ie.stateNode.containerInfo,Mr=!0;break e;case 4:ni=ie.stateNode.containerInfo,Mr=!0;break e}ie=ie.return}if(ni===null)throw Error(r(160));Hf(O,J,M),ni=null,Mr=!1}else Hf(O,J,M);O=M.alternate,O!==null&&(O.return=null),M.return=null}if(f.subtreeFlags&13878)for(f=f.child;f!==null;)Dl(f,u),f=f.sibling}function Dl(u,f){var b=u.alternate,S=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:cr(f,u),vr(u),S&4&&(kl(3,u,u.return),vu(3,u),kl(5,u,u.return));break;case 1:cr(f,u),vr(u),S&512&&(jn||b===null||Nn(b,b.return)),S&64&&_i&&(u=u.updateQueue,u!==null&&(S=u.callbacks,S!==null&&(b=u.shared.hiddenCallbacks,u.shared.hiddenCallbacks=b===null?S:b.concat(S))));break;case 26:if(Vr){var M=pr;cr(f,u),vr(u),S&512&&(jn||b===null||Nn(b,b.return)),S&4&&(S=b!==null?b.memoizedState:null,f=u.memoizedState,b===null?f===null?u.stateNode===null?u.stateNode=xp(M,u.type,u.memoizedProps,u):vp(M,u.type,u.stateNode):u.stateNode=yp(M,f,u.memoizedProps):S!==f?(S===null?b.stateNode!==null&&_p(b.stateNode):bp(S),f===null?vp(M,u.type,u.stateNode):yp(M,f,u.memoizedProps)):f===null&&u.stateNode!==null&&Bh(u,u.memoizedProps,b.memoizedProps));break}case 27:if(Ii&&S&4&&u.alternate===null){M=u.stateNode;var O=u.memoizedProps;try{Eb(M),wb(u.type,O,M,u)}catch(ke){Ot(u,u.return,ke)}}case 5:if(cr(f,u),vr(u),S&512&&(jn||b===null||Nn(b,b.return)),Ui){if(u.flags&32){f=u.stateNode;try{zu(f)}catch(ke){Ot(u,u.return,ke)}}S&4&&u.stateNode!=null&&(f=u.memoizedProps,Bh(u,f,b!==null?b.memoizedProps:f)),S&1024&&(eo=!0)}break;case 6:if(cr(f,u),vr(u),S&4&&Ui){if(u.stateNode===null)throw Error(r(162));S=u.memoizedProps,b=b!==null?b.memoizedProps:S,f=u.stateNode;try{Ng(f,b,S)}catch(ke){Ot(u,u.return,ke)}}break;case 3:if(Vr?(Sp(),M=pr,pr=cd(f.containerInfo),cr(f,u),pr=M):cr(f,u),vr(u),S&4){if(Ui&&dr&&b!==null&&b.memoizedState.isDehydrated)try{ld(f.containerInfo)}catch(ke){Ot(u,u.return,ke)}if(qr){S=f.containerInfo,b=f.pendingChildren;try{fp(S,b)}catch(ke){Ot(u,u.return,ke)}}}eo&&(eo=!1,Uh(u));break;case 4:Vr?(b=pr,pr=cd(u.stateNode.containerInfo),cr(f,u),vr(u),pr=b):(cr(f,u),vr(u)),S&4&&qr&&bg(u.stateNode,u,u.stateNode.pendingChildren);break;case 12:cr(f,u),vr(u);break;case 13:cr(f,u),vr(u),u.child.flags&8192&&u.memoizedState!==null!=(b!==null&&b.memoizedState!==null)&&(ws=Hi()),S&4&&(S=u.updateQueue,S!==null&&(u.updateQueue=null,_u(u,S)));break;case 22:S&512&&(jn||b===null||Nn(b,b.return)),M=u.memoizedState!==null;var J=b!==null&&b.memoizedState!==null,ie=_i,fe=jn;if(_i=ie||M,jn=fe||J,cr(f,u),jn=fe,_i=ie,vr(u),f=u.stateNode,f._current=u,f._visibility&=-3,f._visibility|=f._pendingVisibility&2,S&8192&&(f._visibility=M?f._visibility&-2:f._visibility|1,M&&(f=_i||jn,b===null||J||f||_c(u)),Ui&&(u.memoizedProps===null||u.memoizedProps.mode!=="manual"))){e:if(b=null,Ui)for(f=u;;){if(f.tag===5||Vr&&f.tag===26||Ii&&f.tag===27){if(b===null){J=b=f;try{O=J.stateNode,M?Bu(O):op(J.stateNode,J.memoizedProps)}catch(ke){Ot(J,J.return,ke)}}}else if(f.tag===6){if(b===null){J=f;try{var we=J.stateNode;M?nd(we):$s(we,J.memoizedProps)}catch(ke){Ot(J,J.return,ke)}}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===u)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break e;for(;f.sibling===null;){if(f.return===null||f.return===u)break e;b===f&&(b=null),f=f.return}b===f&&(b=null),f.sibling.return=f.return,f=f.sibling}}S&4&&(S=u.updateQueue,S!==null&&(b=S.retryQueue,b!==null&&(S.retryQueue=null,_u(u,b))));break;case 19:cr(f,u),vr(u),S&4&&(S=u.updateQueue,S!==null&&(u.updateQueue=null,_u(u,S)));break;case 21:break;default:cr(f,u),vr(u)}}function vr(u){var f=u.flags;if(f&2){try{if(Ui&&(!Ii||u.tag!==27)){e:{for(var b=u.return;b!==null;){if(Lh(b)){var S=b;break e}b=b.return}throw Error(r(160))}switch(S.tag){case 27:if(Ii){var M=S.stateNode,O=Lf(u);yc(u,O,M);break}case 5:var J=S.stateNode;S.flags&32&&(zu(J),S.flags&=-33);var ie=Lf(u);yc(u,ie,J);break;case 3:case 4:var fe=S.stateNode.containerInfo,we=Lf(u);Uf(u,we,fe);break;default:throw Error(r(161))}}}catch(ke){Ot(u,u.return,ke)}u.flags&=-3}f&4096&&(u.flags&=-4097)}function Uh(u){if(u.subtreeFlags&1024)for(u=u.child;u!==null;){var f=u;Uh(f),f.tag===5&&f.flags&1024&&pn(f.stateNode),u=u.sibling}}function us(u,f){if(f.subtreeFlags&8772)for(f=f.child;f!==null;)If(u,f.alternate,f),f=f.sibling}function _c(u){for(u=u.child;u!==null;){var f=u;switch(f.tag){case 0:case 11:case 14:case 15:kl(4,f,f.return),_c(f);break;case 1:Nn(f,f.return);var b=f.stateNode;typeof b.componentWillUnmount=="function"&&yg(f,f.return,b),_c(f);break;case 26:case 27:case 5:Nn(f,f.return),_c(f);break;case 22:Nn(f,f.return),f.memoizedState===null&&_c(f);break;default:_c(f)}u=u.sibling}}function zl(u,f,b){for(b=b&&(f.subtreeFlags&8772)!==0,f=f.child;f!==null;){var S=f.alternate,M=u,O=f,J=O.flags;switch(O.tag){case 0:case 11:case 15:zl(M,O,b),vu(4,O);break;case 1:if(zl(M,O,b),S=O,M=S.stateNode,typeof M.componentDidMount=="function")try{M.componentDidMount()}catch(we){Ot(S,S.return,we)}if(S=O,M=S.updateQueue,M!==null){var ie=S.stateNode;try{var fe=M.shared.hiddenCallbacks;if(fe!==null)for(M.shared.hiddenCallbacks=null,M=0;M<fe.length;M++)go(fe[M],ie)}catch(we){Ot(S,S.return,we)}}b&&J&64&&gg(O),wo(O,O.return);break;case 26:case 27:case 5:zl(M,O,b),b&&S===null&&J&4&&gc(O),wo(O,O.return);break;case 12:zl(M,O,b);break;case 13:zl(M,O,b),b&&J&4&&Ol(M,O);break;case 22:O.memoizedState===null&&zl(M,O,b),wo(O,O.return);break;default:zl(M,O,b)}f=f.sibling}}function Ih(u,f){var b=null;u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(b=u.memoizedState.cachePool.pool),u=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(u=f.memoizedState.cachePool.pool),u!==b&&(u!=null&&u.refCount++,b!=null&&dc(b))}function jf(u,f){u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&dc(u))}function Ps(u,f,b,S){if(f.subtreeFlags&10256)for(f=f.child;f!==null;)Pf(u,f,b,S),f=f.sibling}function Pf(u,f,b,S){var M=f.flags;switch(f.tag){case 0:case 11:case 15:Ps(u,f,b,S),M&2048&&vu(9,f);break;case 3:Ps(u,f,b,S),M&2048&&(u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&dc(u)));break;case 12:if(M&2048){Ps(u,f,b,S),u=f.stateNode;try{var O=f.memoizedProps,J=O.id,ie=O.onPostCommit;typeof ie=="function"&&ie(J,f.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(fe){Ot(f,f.return,fe)}}else Ps(u,f,b,S);break;case 23:break;case 22:O=f.stateNode,f.memoizedState!==null?O._visibility&4?Ps(u,f,b,S):Bl(u,f):O._visibility&4?Ps(u,f,b,S):(O._visibility|=4,Xi(u,f,b,S,(f.subtreeFlags&10256)!==0)),M&2048&&Ih(f.alternate,f);break;case 24:Ps(u,f,b,S),M&2048&&jf(f.alternate,f);break;default:Ps(u,f,b,S)}}function Xi(u,f,b,S,M){for(M=M&&(f.subtreeFlags&10256)!==0,f=f.child;f!==null;){var O=u,J=f,ie=b,fe=S,we=J.flags;switch(J.tag){case 0:case 11:case 15:Xi(O,J,ie,fe,M),vu(8,J);break;case 23:break;case 22:var ke=J.stateNode;J.memoizedState!==null?ke._visibility&4?Xi(O,J,ie,fe,M):Bl(O,J):(ke._visibility|=4,Xi(O,J,ie,fe,M)),M&&we&2048&&Ih(J.alternate,J);break;case 24:Xi(O,J,ie,fe,M),M&&we&2048&&jf(J.alternate,J);break;default:Xi(O,J,ie,fe,M)}f=f.sibling}}function Bl(u,f){if(f.subtreeFlags&10256)for(f=f.child;f!==null;){var b=u,S=f,M=S.flags;switch(S.tag){case 22:Bl(b,S),M&2048&&Ih(S.alternate,S);break;case 24:Bl(b,S),M&2048&&jf(S.alternate,S);break;default:Bl(b,S)}f=f.sibling}}function Ci(u){if(u.subtreeFlags&jo)for(u=u.child;u!==null;)To(u),u=u.sibling}function To(u){switch(u.tag){case 26:Ci(u),u.flags&jo&&(u.memoizedState!==null?wp(pr,u.memoizedState,u.memoizedProps):Fn(u.type,u.memoizedProps));break;case 5:Ci(u),u.flags&jo&&Fn(u.type,u.memoizedProps);break;case 3:case 4:if(Vr){var f=pr;pr=cd(u.stateNode.containerInfo),Ci(u),pr=f}else Ci(u);break;case 22:u.memoizedState===null&&(f=u.alternate,f!==null&&f.memoizedState!==null?(f=jo,jo=16777216,Ci(u),jo=f):Ci(u));break;default:Ci(u)}}function Gf(u){var f=u.alternate;if(f!==null&&(u=f.child,u!==null)){f.child=null;do f=u.sibling,u.sibling=null,u=f;while(u!==null)}}function Ll(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var b=0;b<f.length;b++){var S=f[b];Kn=S,Ul(S,u)}Gf(u)}if(u.subtreeFlags&10256)for(u=u.child;u!==null;)Su(u),u=u.sibling}function Su(u){switch(u.tag){case 0:case 11:case 15:Ll(u),u.flags&2048&&kl(9,u,u.return);break;case 3:Ll(u);break;case 12:Ll(u);break;case 22:var f=u.stateNode;u.memoizedState!==null&&f._visibility&4&&(u.return===null||u.return.tag!==13)?(f._visibility&=-5,Sc(u)):Ll(u);break;default:Ll(u)}}function Sc(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var b=0;b<f.length;b++){var S=f[b];Kn=S,Ul(S,u)}Gf(u)}for(u=u.child;u!==null;){switch(f=u,f.tag){case 0:case 11:case 15:kl(8,f,f.return),Sc(f);break;case 22:b=f.stateNode,b._visibility&4&&(b._visibility&=-5,Sc(f));break;default:Sc(f)}u=u.sibling}}function Ul(u,f){for(;Kn!==null;){var b=Kn;switch(b.tag){case 0:case 11:case 15:kl(8,b,f);break;case 23:case 22:if(b.memoizedState!==null&&b.memoizedState.cachePool!==null){var S=b.memoizedState.cachePool.pool;S!=null&&S.refCount++}break;case 24:dc(b.memoizedState.cache)}if(S=b.child,S!==null)S.return=b,Kn=S;else e:for(b=u;Kn!==null;){S=Kn;var M=S.sibling,O=S.return;if(xc(S),S===b){Kn=null;break e}if(M!==null){M.return=O,Kn=M;break e}Kn=O}}}function Ff(u){var f=ep(u);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(r(364));return f}if(u=zo(u),u===null)throw Error(r(362));return u.stateNode.current}function Ec(u,f){var b=u.tag;switch(f.$$typeof){case Zu:if(u.type===f.value)return!0;break;case vd:e:{for(f=f.value,u=[u,0],b=0;b<u.length;){var S=u[b++],M=S.tag,O=u[b++],J=f[O];if(M!==5&&M!==26&&M!==27||!xs(S)){for(;J!=null&&Ec(S,J);)O++,J=f[O];if(O===f.length){f=!0;break e}else for(S=S.child;S!==null;)u.push(S,O),S=S.sibling}}f=!1}return f;case _d:if((b===5||b===26||b===27)&&bb(u.stateNode,f.value))return!0;break;case sn:if((b===5||b===6||b===26||b===27)&&(u=Du(u),u!==null&&0<=u.indexOf(f.value)))return!0;break;case Ut:if((b===5||b===26||b===27)&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function Il(u){switch(u.$$typeof){case Zu:return"<"+(l(u.value)||"Unknown")+">";case vd:return":has("+(Il(u)||"")+")";case _d:return'[role="'+u.value+'"]';case sn:return'"'+u.value+'"';case Ut:return'[data-testname="'+u.value+'"]';default:throw Error(r(365))}}function xg(u,f){var b=[];u=[u,0];for(var S=0;S<u.length;){var M=u[S++],O=M.tag,J=u[S++],ie=f[J];if(O!==5&&O!==26&&O!==27||!xs(M)){for(;ie!=null&&Ec(M,ie);)J++,ie=f[J];if(J===f.length)b.push(M);else for(M=M.child;M!==null;)u.push(M,J),M=M.sibling}}return b}function ur(u,f){if(!bs)throw Error(r(363));u=Ff(u),u=xg(u,f),f=[],u=Array.from(u);for(var b=0;b<u.length;){var S=u[b++],M=S.tag;if(M===5||M===26||M===27)xs(S)||f.push(S.stateNode);else for(S=S.child;S!==null;)u.push(S),S=S.sibling}return f}function fr(){if(($e&2)!==0&&Et!==0)return Et&-Et;if(rt.T!==null){var u=Cr;return u!==0?u:Re()}return ma()}function fs(){Nr===0&&(Nr=(Et&536870912)===0||Ft?ee():536870912);var u=Jr.current;return u!==null&&(u.flags|=32),Nr}function Ki(u,f,b){(u===Mt&&mn===2||u.cancelPendingCommit!==null)&&(Ia(u,0),Ua(u,Et,Nr,!1)),V(u,b),(($e&2)===0||u!==Mt)&&(u===Mt&&(($e&2)===0&&(Ya|=b),It===4&&Ua(u,Et,Nr,!1)),bn(u))}function Eu(u,f,b){if(($e&6)!==0)throw Error(r(327));var S=!b&&(f&60)===0&&(f&u.expiredLanes)===0||z(u,f),M=S?ps(u,f):ds(u,f,!0),O=S;do{if(M===0){ea&&!S&&Ua(u,f,0,!1);break}else if(M===6)Ua(u,f,0,!ln);else{if(b=u.current.alternate,O&&!vg(b)){M=ds(u,f,!1),O=!1;continue}if(M===2){if(O=f,u.errorRecoveryDisabledLanes&O)var J=0;else J=u.pendingLanes&-536870913,J=J!==0?J:J&536870912?536870912:0;if(J!==0){f=J;e:{var ie=u;M=jc;var fe=dr&&ie.current.memoizedState.isDehydrated;if(fe&&(Ia(ie,J).flags|=256),J=ds(ie,J,!1),J!==2){if(il&&!fe){ie.errorRecoveryDisabledLanes|=O,Ya|=O,M=4;break e}O=na,na=M,O!==null&&Gs(O)}M=J}if(O=!1,M!==2)continue}}if(M===1){Ia(u,0),Ua(u,f,0,!0);break}e:{switch(S=u,M){case 0:case 1:throw Error(r(345));case 4:if((f&4194176)===f){Ua(S,f,Nr,!ln);break e}break;case 2:na=null;break;case 3:case 5:break;default:throw Error(r(329))}if(S.finishedWork=b,S.finishedLanes=f,(f&62914560)===f&&(O=ws+300-Hi(),10<O)){if(Ua(S,f,Nr,!ln),H(S,0)!==0)break e;S.timeoutHandle=Jh(qf.bind(null,S,b,na,Va,Pc,f,Nr,Ya,rl,ln,2,-0,0),O);break e}qf(S,b,na,Va,Pc,f,Nr,Ya,rl,ln,0,-0,0)}}break}while(!0);bn(u)}function Gs(u){na===null?na=u:na.push.apply(na,u)}function qf(u,f,b,S,M,O,J,ie,fe,we,ke,Be,je){var ht=f.subtreeFlags;if((ht&8192||(ht&16785408)===16785408)&&(Yr(),To(f),f=Jf(),f!==null)){u.cancelPendingCommit=f(vn.bind(null,u,b,S,M,J,ie,fe,1,Be,je)),Ua(u,O,J,!we);return}vn(u,b,S,M,J,ie,fe,ke,Be,je)}function vg(u){for(var f=u;;){var b=f.tag;if((b===0||b===11||b===15)&&f.flags&16384&&(b=f.updateQueue,b!==null&&(b=b.stores,b!==null)))for(var S=0;S<b.length;S++){var M=b[S],O=M.getSnapshot;M=M.value;try{if(!Xr(O(),M))return!1}catch{return!1}}if(b=f.child,f.subtreeFlags&16384&&b!==null)b.return=f,f=b;else{if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function Ua(u,f,b,S){f&=~er,f&=~Ya,u.suspendedLanes|=f,u.pingedLanes&=~f,S&&(u.warmLanes|=f),S=u.expirationTimes;for(var M=f;0<M;){var O=31-wr(M),J=1<<O;S[O]=-1,M&=~J}b!==0&&ne(u,b,f)}function Hh(){return($e&6)===0?(wi(0),!1):!0}function _r(){if(gt!==null){if(mn===0)var u=gt.return;else u=gt,Xn=Jl=null,Ls(u),_s=null,ba=0,u=gt;for(;u!==null;)zh(u.alternate,u),u=u.return;gt=null}}function Ia(u,f){u.finishedWork=null,u.finishedLanes=0;var b=u.timeoutHandle;b!==Do&&(u.timeoutHandle=Do,Ou(b)),b=u.cancelPendingCommit,b!==null&&(u.cancelPendingCommit=null,b()),_r(),Mt=u,gt=b=Wi(u.current,null),Et=f,mn=0,ii=null,ln=!1,ea=z(u,f),il=!1,rl=Nr=er=Ya=ta=It=0,na=jc=null,Pc=!1,(f&8)!==0&&(f|=f&32);var S=u.entangledLanes;if(S!==0)for(u=u.entanglements,S&=f;0<S;){var M=31-wr(S),O=1<<M;f|=u[M],S&=~O}return qa=f,We(),b}function Co(u,f){_t=null,rt.H=qt,f===fn?(f=Ee(),mn=3):f===Mp?(f=Ee(),mn=4):mn=f===Jg?8:f!==null&&typeof f=="object"&&typeof f.then=="function"?6:1,ii=f,gt===null&&(It=1,Nf(u,$(f,u.current)))}function wu(){var u=Jr.current;return u===null?!0:(Et&4194176)===Et?xa===null:(Et&62914560)===Et||(Et&536870912)!==0?u===xa:!1}function wc(){var u=rt.H;return rt.H=qt,u===null?qt:u}function Fr(){var u=rt.A;return rt.A=xd,u}function Sr(){It=4,ln||(Et&4194176)!==Et&&Jr.current!==null||(ea=!0),(ta&134217727)===0&&(Ya&134217727)===0||Mt===null||Ua(Mt,Et,Nr,!1)}function ds(u,f,b){var S=$e;$e|=2;var M=wc(),O=Fr();(Mt!==u||Et!==f)&&(Va=null,Ia(u,f)),f=!1;var J=It;e:do try{if(mn!==0&&gt!==null){var ie=gt,fe=ii;switch(mn){case 8:_r(),J=6;break e;case 3:case 2:case 6:Jr.current===null&&(f=!0);var we=mn;if(mn=0,ii=null,Hl(u,ie,fe,we),b&&ea){J=0;break e}break;default:we=mn,mn=0,ii=null,Hl(u,ie,fe,we)}}hs(),J=It;break}catch(ke){Co(u,ke)}while(!0);return f&&u.shellSuspendCounter++,Xn=Jl=null,$e=S,rt.H=M,rt.A=O,gt===null&&(Mt=null,Et=0,We()),J}function hs(){for(;gt!==null;)jh(gt)}function ps(u,f){var b=$e;$e|=2;var S=wc(),M=Fr();Mt!==u||Et!==f?(Va=null,Pn=Hi()+500,Ia(u,f)):ea=z(u,f);e:do try{if(mn!==0&&gt!==null){f=gt;var O=ii;t:switch(mn){case 1:mn=0,ii=null,Hl(u,f,O,1);break;case 2:if(rs(O)){mn=0,ii=null,Yf(f);break}f=function(){mn===2&&Mt===u&&(mn=7),bn(u)},O.then(f,f);break e;case 3:mn=7;break e;case 4:mn=5;break e;case 7:rs(O)?(mn=0,ii=null,Yf(f)):(mn=0,ii=null,Hl(u,f,O,7));break;case 5:var J=null;switch(gt.tag){case 26:J=gt.memoizedState;case 5:case 27:var ie=gt,fe=ie.type,we=ie.pendingProps;if(J?Ep(J):Zs(fe,we)){mn=0,ii=null;var ke=ie.sibling;if(ke!==null)gt=ke;else{var Be=ie.return;Be!==null?(gt=Be,Tu(Be)):gt=null}break t}}mn=0,ii=null,Hl(u,f,O,5);break;case 6:mn=0,ii=null,Hl(u,f,O,6);break;case 8:_r(),It=6;break e;default:throw Error(r(462))}}Fs();break}catch(je){Co(u,je)}while(!0);return Xn=Jl=null,rt.H=S,rt.A=M,$e=b,gt!==null?0:(Mt=null,Et=0,We(),It)}function Fs(){for(;gt!==null&&!Kg();)jh(gt)}function jh(u){var f=dg(u.alternate,u,qa);u.memoizedProps=u.pendingProps,f===null?Tu(u):gt=f}function Yf(u){var f=u,b=f.alternate;switch(f.tag){case 15:case 0:f=lg(b,f,f.pendingProps,f.type,void 0,Et);break;case 11:f=lg(b,f,f.pendingProps,f.type.render,f.ref,Et);break;case 5:Ls(f);default:zh(b,f),f=gt=Vs(f,qa),f=dg(b,f,qa)}u.memoizedProps=u.pendingProps,f===null?Tu(u):gt=f}function Hl(u,f,b,S){Xn=Jl=null,Ls(f),_s=null,ba=0;var M=f.return;try{if(ng(u,M,f,b,Et)){It=1,Nf(u,$(b,u.current)),gt=null;return}}catch(O){if(M!==null)throw gt=M,O;It=1,Nf(u,$(b,u.current)),gt=null;return}f.flags&32768?(Ft||S===1?u=!0:ea||(Et&536870912)!==0?u=!1:(ln=u=!0,(S===2||S===3||S===6)&&(S=Jr.current,S!==null&&S.tag===13&&(S.flags|=16384))),Ai(f,u)):Tu(f)}function Tu(u){var f=u;do{if((f.flags&32768)!==0){Ai(f,ln);return}u=f.return;var b=pg(f.alternate,f,qa);if(b!==null){gt=b;return}if(f=f.sibling,f!==null){gt=f;return}gt=f=u}while(f!==null);It===0&&(It=5)}function Ai(u,f){do{var b=mg(u.alternate,u);if(b!==null){b.flags&=32767,gt=b;return}if(b=u.return,b!==null&&(b.flags|=32768,b.subtreeFlags=0,b.deletions=null),!f&&(u=u.sibling,u!==null)){gt=u;return}gt=u=b}while(u!==null);It=6,gt=null}function vn(u,f,b,S,M,O,J,ie,fe,we){var ke=rt.T,Be=vi();try{Zi(2),rt.T=null,zt(u,f,b,S,Be,M,O,J,ie,fe,we)}finally{rt.T=ke,Zi(Be)}}function zt(u,f,b,S,M,O,J,ie){do Mi();while(al!==null);if(($e&6)!==0)throw Error(r(327));var fe=u.finishedWork;if(S=u.finishedLanes,fe===null)return null;if(u.finishedWork=null,u.finishedLanes=0,fe===u.current)throw Error(r(177));u.callbackNode=null,u.callbackPriority=0,u.cancelPendingCommit=null;var we=fe.lanes|fe.childLanes;if(we|=Bc,X(u,S,we,O,J,ie),u===Mt&&(gt=Mt=null,Et=0),(fe.subtreeFlags&10256)===0&&(fe.flags&10256)===0||_a||(_a=!0,Sd=we,Go=b,Cu(fd,function(){return Mi(),null})),b=(fe.flags&15990)!==0,(fe.subtreeFlags&15990)!==0||b?(b=rt.T,rt.T=null,O=vi(),Zi(2),J=$e,$e|=4,bc(u,fe),Dl(fe,u),$h(u.containerInfo),u.current=fe,If(u,fe.alternate,fe),Wg(),$e=J,Zi(O),rt.T=b):u.current=fe,_a?(_a=!1,al=u,Po=S):qs(u,we),we=u.pendingLanes,we===0&&(ia=null),B(fe.stateNode),bn(u),f!==null)for(M=u.onRecoverableError,fe=0;fe<f.length;fe++)we=f[fe],M(we.value,{componentStack:we.stack});return(Po&3)!==0&&Mi(),we=u.pendingLanes,(S&4194218)!==0&&(we&42)!==0?u===mr?Fo++:(Fo=0,mr=u):Fo=0,wi(0),null}function qs(u,f){(u.pooledCacheLanes&=f)===0&&(f=u.pooledCache,f!=null&&(u.pooledCache=null,dc(f)))}function Mi(){if(al!==null){var u=al,f=Sd;Sd=0;var b=Q(Po),S=32>b?32:b;b=rt.T;var M=vi();try{if(Zi(S),rt.T=null,al===null)var O=!1;else{S=Go,Go=null;var J=al,ie=Po;if(al=null,Po=0,($e&6)!==0)throw Error(r(331));var fe=$e;if($e|=4,Su(J.current),Pf(J,J.current,ie,S),$e=fe,wi(0,!1),Tr&&typeof Tr.onPostCommitFiberRoot=="function")try{Tr.onPostCommitFiberRoot(Dc,J)}catch{}O=!0}return O}finally{Zi(M),rt.T=b,qs(u,f)}}return!1}function Vf(u,f,b){f=$(b,f),f=pu(u.stateNode,f,2),u=Zt(u,f,2),u!==null&&(V(u,2),bn(u))}function Ot(u,f,b){if(u.tag===3)Vf(u,u,b);else for(;f!==null;){if(f.tag===3){Vf(f,u,b);break}else if(f.tag===1){var S=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(ia===null||!ia.has(S))){u=$(b,u),b=fc(2),S=Zt(f,b,2),S!==null&&(mu(b,S,f,u),V(S,2),bn(S));break}}f=f.return}}function Xf(u,f,b){var S=u.pingCache;if(S===null){S=u.pingCache=new Dt;var M=new Set;S.set(f,M)}else M=S.get(f),M===void 0&&(M=new Set,S.set(f,M));M.has(b)||(il=!0,M.add(b),u=_g.bind(null,u,f,b),f.then(u,u))}function _g(u,f,b){var S=u.pingCache;S!==null&&S.delete(f),u.pingedLanes|=u.suspendedLanes&b,u.warmLanes&=~b,Mt===u&&(Et&b)===b&&(It===4||It===3&&(Et&62914560)===Et&&300>Hi()-ws?($e&2)===0&&Ia(u,0):er|=b,rl===Et&&(rl=0)),bn(u)}function Ao(u,f){f===0&&(f=P()),u=At(u,f),u!==null&&(V(u,f),bn(u))}function Mo(u){var f=u.memoizedState,b=0;f!==null&&(b=f.retryLane),Ao(u,b)}function Ph(u,f){var b=0;switch(u.tag){case 13:var S=u.stateNode,M=u.memoizedState;M!==null&&(b=M.retryLane);break;case 19:S=u.stateNode;break;case 22:S=u.stateNode._retryCache;break;default:throw Error(r(314))}S!==null&&S.delete(f),Ao(u,b)}function Cu(u,f){return Oc(u,f)}function Gh(u,f,b,S){this.tag=u,this.key=b,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ys(u){return u=u.prototype,!(!u||!u.isReactComponent)}function Wi(u,f){var b=u.alternate;return b===null?(b=n(u.tag,f,u.key,u.mode),b.elementType=u.elementType,b.type=u.type,b.stateNode=u.stateNode,b.alternate=u,u.alternate=b):(b.pendingProps=f,b.type=u.type,b.flags=0,b.subtreeFlags=0,b.deletions=null),b.flags=u.flags&31457280,b.childLanes=u.childLanes,b.lanes=u.lanes,b.child=u.child,b.memoizedProps=u.memoizedProps,b.memoizedState=u.memoizedState,b.updateQueue=u.updateQueue,f=u.dependencies,b.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},b.sibling=u.sibling,b.index=u.index,b.ref=u.ref,b.refCleanup=u.refCleanup,b}function Vs(u,f){u.flags&=31457282;var b=u.alternate;return b===null?(u.childLanes=0,u.lanes=f,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=b.childLanes,u.lanes=b.lanes,u.child=b.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=b.memoizedProps,u.memoizedState=b.memoizedState,u.updateQueue=b.updateQueue,u.type=b.type,f=b.dependencies,u.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),u}function pa(u,f,b,S,M,O){var J=0;if(S=u,typeof u=="function")Ys(u)&&(J=1);else if(typeof u=="string")J=Vr&&Ii?gp(u,b,Ri.current)?26:Rc(u)?27:5:Vr?gp(u,b,Ri.current)?26:5:Ii&&Rc(u)?27:5;else e:switch(u){case Cc:return Xs(b.children,M,O,f);case Xh:J=8,M|=24;break;case Kh:return u=n(12,b,f,M|2),u.elementType=Kh,u.lanes=O,u;case Wf:return u=n(13,b,f,M),u.elementType=Wf,u.lanes=O,u;case Gl:return u=n(19,b,f,M),u.elementType=Gl,u.lanes=O,u;case Nu:return Kf(b,M,O,f);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case wg:case ms:J=10;break e;case Pl:J=9;break e;case Ac:J=11;break e;case Mu:J=14;break e;case ja:J=16,S=null;break e}J=29,b=Error(r(130,u===null?"null":typeof u,"")),S=null}return f=n(J,b,f,M),f.elementType=u,f.type=S,f.lanes=O,f}function Xs(u,f,b,S){return u=n(7,u,S,f),u.lanes=b,u}function Kf(u,f,b,S){u=n(22,u,S,f),u.elementType=Nu,u.lanes=b;var M={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var O=M._current;if(O===null)throw Error(r(456));if((M._pendingVisibility&2)===0){var J=At(O,2);J!==null&&(M._pendingVisibility|=2,Ki(J,O,2))}},attach:function(){var O=M._current;if(O===null)throw Error(r(456));if((M._pendingVisibility&2)!==0){var J=At(O,2);J!==null&&(M._pendingVisibility&=-3,Ki(J,O,2))}}};return u.stateNode=M,u}function jl(u,f,b){return u=n(6,u,null,f),u.lanes=b,u}function Tc(u,f,b){return f=n(4,u.children!==null?u.children:[],u.key,f),f.lanes=b,f.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},f}function No(u,f,b,S,M,O,J,ie){this.tag=1,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Do,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=I(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=I(0),this.hiddenUpdates=I(null),this.identifierPrefix=S,this.onUncaughtError=M,this.onCaughtError=O,this.onRecoverableError=J,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function Ni(u,f,b,S,M,O,J,ie,fe,we,ke,Be){return u=new No(u,f,b,J,ie,fe,we,Be),f=1,O===!0&&(f|=24),O=n(3,null,null,f),u.current=O,O.stateNode=u,f=Df(),f.refCount++,u.pooledCache=f,f.refCount++,O.memoizedState={element:S,isDehydrated:b,cache:f},yi(O),u}function Au(u){return u?(u=Bo,u):Bo}function Fh(u){var f=u._reactInternals;if(f===void 0)throw typeof u.render=="function"?Error(r(188)):(u=Object.keys(u).join(","),Error(r(268,u)));return u=v(f),u=u!==null?E(u):null,u===null?null:Mc(u.stateNode)}function Sg(u,f,b,S,M,O){M=Au(M),S.context===null?S.context=M:S.pendingContext=M,S=xn(f),S.payload={element:b},O=O===void 0?null:O,O!==null&&(S.callback=O),b=Zt(u,S,f),b!==null&&(Ki(b,u,f),Gn(b,u,f))}function Eg(u,f){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var b=u.retryLane;u.retryLane=b!==0&&b<f?b:f}}function qh(u,f){Eg(u,f),(u=u.alternate)&&Eg(u,f)}var Ze={},Yh=ph(),Li=XB(),Ro=Object.assign,Vh=Symbol.for("react.element"),Ks=Symbol.for("react.transitional.element"),Ha=Symbol.for("react.portal"),Cc=Symbol.for("react.fragment"),Xh=Symbol.for("react.strict_mode"),Kh=Symbol.for("react.profiler"),wg=Symbol.for("react.provider"),Pl=Symbol.for("react.consumer"),ms=Symbol.for("react.context"),Ac=Symbol.for("react.forward_ref"),Wf=Symbol.for("react.suspense"),Gl=Symbol.for("react.suspense_list"),Mu=Symbol.for("react.memo"),ja=Symbol.for("react.lazy"),Nu=Symbol.for("react.offscreen"),Tg=Symbol.for("react.memo_cache_sentinel"),Wh=Symbol.iterator,ko=Symbol.for("react.client.reference"),rt=Yh.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Zf,Zh,Fl=!1,ql=Array.isArray,$f=e.rendererVersion,Ru=e.rendererPackageName,ku=e.extraDevToolsConfig,Mc=e.getPublicInstance,Oo=e.getRootHostContext,Cg=e.getChildHostContext,Yl=e.prepareForCommit,$h=e.resetAfterCommit,Qh=e.createInstance,gs=e.appendInitialChild,Ws=e.finalizeInitialChildren,Vl=e.shouldSetTextContent,Qf=e.createTextInstance,Jh=e.scheduleTimeout,Ou=e.cancelTimeout,Do=e.noTimeout,ys=e.isPrimaryRenderer;e.warnsIfNotActing;var Ui=e.supportsMutation,qr=e.supportsPersistence,dr=e.supportsHydration,ep=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var tp=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var Zi=e.setCurrentUpdatePriority,vi=e.getCurrentUpdatePriority,ma=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var Xl=e.shouldAttemptEagerTransition,np=e.detachDeletedInstance;e.requestPostPaintCallback;var Ag=e.maySuspendCommit,Zs=e.preloadInstance,Yr=e.startSuspendingCommit,Fn=e.suspendInstance,Jf=e.waitForCommitToBeReady,Er=e.NotPendingTransition,ot=e.HostTransitionContext,pn=e.resetFormInstance;e.bindToConsole;var ci=e.supportsMicrotasks,ed=e.scheduleMicrotask,bs=e.supportsTestSelectors,zo=e.findFiberRoot,td=e.getBoundingRect,Du=e.getTextContent,xs=e.isHiddenSubtree,bb=e.matchAccessibilityRole,qn=e.setFocusIfFocusable,ip=e.setupIntersectionObserver,rp=e.appendChild,Mg=e.appendChildToContainer,Ng=e.commitTextUpdate,xb=e.commitMount,ap=e.commitUpdate,sp=e.insertBefore,lp=e.insertInContainerBefore,hr=e.removeChild,Jn=e.removeChildFromContainer,zu=e.resetTextContent,Bu=e.hideInstance,nd=e.hideTextInstance,op=e.unhideInstance,$s=e.unhideTextInstance,id=e.clearContainer,cp=e.cloneInstance,rd=e.createContainerChildSet,up=e.appendChildToContainerChildSet,Rg=e.finalizeContainerChildren,fp=e.replaceContainerChildren,dp=e.cloneHiddenInstance,hp=e.cloneHiddenTextInstance,ad=e.isSuspenseInstancePending,Lu=e.isSuspenseInstanceFallback,kg=e.getSuspenseInstanceFallbackErrorDetails,vb=e.registerSuspenseInstanceRetry,Og=e.canHydrateFormStateMarker,Dg=e.isFormStateMarkerMatching,pp=e.getNextHydratableSibling,sd=e.getFirstHydratableChild,zg=e.getFirstHydratableChildWithinContainer,Bg=e.getFirstHydratableChildWithinSuspenseInstance,Lg=e.canHydrateInstance,Ug=e.canHydrateTextInstance,Ig=e.canHydrateSuspenseInstance,_b=e.hydrateInstance,Hg=e.hydrateTextInstance,Nc=e.hydrateSuspenseInstance,jg=e.getNextHydratableInstanceAfterSuspenseInstance,ld=e.commitHydratedContainer,od=e.commitHydratedSuspenseInstance,Pg=e.clearSuspenseBoundary,mp=e.clearSuspenseBoundaryFromContainer,Gg=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var Fg=e.validateHydratableInstance,qg=e.validateHydratableTextInstance,Vr=e.supportsResources,gp=e.isHostHoistableType,cd=e.getHoistableRoot,ud=e.getResource,yp=e.acquireResource,bp=e.releaseResource,xp=e.hydrateHoistable,vp=e.mountHoistable,_p=e.unmountHoistable,Sb=e.createHoistableInstance,Sp=e.prepareToCommitHoistables,Yg=e.mayResourceSuspendCommit,Ep=e.preloadResource,wp=e.suspendResource,Ii=e.supportsSingletons,Tp=e.resolveSingletonInstance,Eb=e.clearSingleton,wb=e.acquireSingletonInstance,Vg=e.releaseSingletonInstance,Rc=e.isHostSingletonType,Uu=[],Qs=-1,Bo={},wr=Math.clz32?Math.clz32:N,Iu=Math.log,Xg=Math.LN2,kc=128,Hu=4194304,Oc=Li.unstable_scheduleCallback,ju=Li.unstable_cancelCallback,Kg=Li.unstable_shouldYield,Wg=Li.unstable_requestPaint,Hi=Li.unstable_now,Cp=Li.unstable_ImmediatePriority,Zg=Li.unstable_UserBlockingPriority,fd=Li.unstable_NormalPriority,dd=Li.unstable_IdlePriority,$g=Li.log,Ap=Li.unstable_setDisableYieldValue,Dc=null,Tr=null,Xr=typeof Object.is=="function"?Object.is:Z,hd=new WeakMap,Rn=[],Yn=0,Pu=null,Gu=0,Kr=[],Wr=0,Pa=null,vs=1,ga="",Ri=C(null),Fu=C(null),Ga=C(null),zc=C(null),$i=null,ji=null,Ft=!1,Zr=null,ya=!1,qu=Error(r(519)),$r=[],Kl=0,Bc=0,Lc=null,Lo=null,Yu=!1,Vu=!1,Fa=!1,Wl=0,Xu=null,pd=0,Cr=0,Zl=null,Js=!1,Uc=!1,Ku=Object.prototype.hasOwnProperty,fn=Error(r(460)),Mp=Error(r(474)),md={then:function(){}},Uo=null,_s=null,ba=0,$l=Fe(!0),Np=Fe(!1),Ss=C(null),Qr=C(0),Jr=C(null),xa=null,ui=C(0),Es=0,_t=null,$t=null,ei=null,va=!1,kn=!1,el=!1,Wu=0,Vn=0,Ic=null,Qg=0,gd=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},qt={readContext:Bi,use:Ir,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt};qt.useCacheRefresh=yt,qt.useMemoCache=yt,qt.useHostTransitionStatus=yt,qt.useFormState=yt,qt.useActionState=yt,qt.useOptimistic=yt;var fi={readContext:Bi,use:Ir,useCallback:function(u,f){return tn().memoizedState=[u,f===void 0?null:f],u},useContext:Bi,useEffect:rn,useImperativeHandle:function(u,f,b){b=b!=null?b.concat([u]):null,bo(4194308,4,Is.bind(null,f,u),b)},useLayoutEffect:function(u,f){return bo(4194308,4,u,f)},useInsertionEffect:function(u,f){bo(4,2,u,f)},useMemo:function(u,f){var b=tn();f=f===void 0?null:f;var S=u();if(el){Y(!0);try{u()}finally{Y(!1)}}return b.memoizedState=[S,f],S},useReducer:function(u,f,b){var S=tn();if(b!==void 0){var M=b(f);if(el){Y(!0);try{b(f)}finally{Y(!1)}}}else M=f;return S.memoizedState=S.baseState=M,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:M},S.queue=u,u=u.dispatch=Tl.bind(null,_t,u),[S.memoizedState,u]},useRef:function(u){var f=tn();return u={current:u},f.memoizedState=u},useState:function(u){u=Ti(u);var f=u.queue,b=Af.bind(null,_t,f);return f.dispatch=b,[u.memoizedState,b]},useDebugValue:qe,useDeferredValue:function(u,f){var b=tn();return An(b,u,f)},useTransition:function(){var u=Ti(!1);return u=uc.bind(null,_t,u.queue,!0,!1),tn().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,f,b){var S=_t,M=tn();if(Ft){if(b===void 0)throw Error(r(407));b=b()}else{if(b=f(),Mt===null)throw Error(r(349));(Et&60)!==0||xt(S,f,b)}M.memoizedState=b;var O={value:b,getSnapshot:f};return M.queue=O,rn(Un.bind(null,S,O,u),[u]),S.flags|=2048,Ba(9,Xt.bind(null,S,O,b,f),{destroy:void 0},null),b},useId:function(){var u=tn(),f=Mt.identifierPrefix;if(Ft){var b=ga,S=vs;b=(S&~(1<<32-wr(S)-1)).toString(32)+b,f=":"+f+"R"+b,b=Wu++,0<b&&(f+="H"+b.toString(32)),f+=":"}else b=Qg++,f=":"+f+"r"+b.toString(32)+":";return u.memoizedState=f},useCacheRefresh:function(){return tn().memoizedState=fu.bind(null,_t)}};fi.useMemoCache=Ln,fi.useHostTransitionStatus=xo,fi.useFormState=as,fi.useActionState=as,fi.useOptimistic=function(u){var f=tn();f.memoizedState=f.baseState=u;var b={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return f.queue=b,f=Mf.bind(null,_t,!0,b),b.dispatch=f,[u,f]};var Qi={readContext:Bi,use:Ir,useCallback:mt,useContext:Bi,useEffect:ls,useImperativeHandle:De,useInsertionEffect:os,useLayoutEffect:cc,useMemo:Rt,useReducer:da,useRef:it,useState:function(){return da(xr)},useDebugValue:qe,useDeferredValue:function(u,f){var b=nn();return jr(b,$t.memoizedState,u,f)},useTransition:function(){var u=da(xr)[0],f=nn().memoizedState;return[typeof u=="boolean"?u:lr(u),f]},useSyncExternalStore:Ve,useId:cs};Qi.useCacheRefresh=Cf,Qi.useMemoCache=Ln,Qi.useHostTransitionStatus=xo,Qi.useFormState=ss,Qi.useActionState=ss,Qi.useOptimistic=function(u,f){var b=nn();return un(b,$t,u,f)};var Ql={readContext:Bi,use:Ir,useCallback:mt,useContext:Bi,useEffect:ls,useImperativeHandle:De,useInsertionEffect:os,useLayoutEffect:cc,useMemo:Rt,useReducer:Me,useRef:it,useState:function(){return Me(xr)},useDebugValue:qe,useDeferredValue:function(u,f){var b=nn();return $t===null?An(b,u,f):jr(b,$t.memoizedState,u,f)},useTransition:function(){var u=Me(xr)[0],f=nn().memoizedState;return[typeof u=="boolean"?u:lr(u),f]},useSyncExternalStore:Ve,useId:cs};Ql.useCacheRefresh=Cf,Ql.useMemoCache=Ln,Ql.useHostTransitionStatus=xo,Ql.useFormState=cu,Ql.useActionState=cu,Ql.useOptimistic=function(u,f){var b=nn();return $t!==null?un(b,$t,u,f):(b.baseState=u,[u,b.queue.dispatch])};var yd={isMounted:function(u){return(u=u._reactInternals)?g(u)===u:!1},enqueueSetState:function(u,f,b){u=u._reactInternals;var S=fr(),M=xn(S);M.payload=f,b!=null&&(M.callback=b),f=Zt(u,M,S),f!==null&&(Ki(f,u,S),Gn(f,u,S))},enqueueReplaceState:function(u,f,b){u=u._reactInternals;var S=fr(),M=xn(S);M.tag=1,M.payload=f,b!=null&&(M.callback=b),f=Zt(u,M,S),f!==null&&(Ki(f,u,S),Gn(f,u,S))},enqueueForceUpdate:function(u,f){u=u._reactInternals;var b=fr(),S=xn(b);S.tag=2,f!=null&&(S.callback=f),f=Zt(u,S,b),f!==null&&(Ki(f,u,b),Gn(f,u,b))}},Rp=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var f=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(f))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},Jg=Error(r(461)),ti=!1,Ji={dehydrated:null,treeContext:null,retryLane:0},Ar=C(null),Jl=null,Xn=null,ey=typeof AbortController<"u"?AbortController:function(){var u=[],f=this.signal={aborted:!1,addEventListener:function(b,S){u.push(S)}};this.abort=function(){f.aborted=!0,u.forEach(function(b){return b()})}},tl=Li.unstable_scheduleCallback,Io=Li.unstable_NormalPriority,an={$$typeof:ms,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},bd=rt.S;rt.S=function(u,f){typeof f=="object"&&f!==null&&typeof f.then=="function"&&Je(u,f),bd!==null&&bd(u,f)};var nl=C(null),_i=!1,jn=!1,eo=!1,Hc=typeof WeakSet=="function"?WeakSet:Set,Kn=null,Ho=!1,ni=null,Mr=!1,pr=null,jo=8192,xd={getCacheForType:function(u){var f=Bi(an),b=f.data.get(u);return b===void 0&&(b=u(),f.data.set(u,b)),b}},Zu=0,vd=1,_d=2,Ut=3,sn=4;if(typeof Symbol=="function"&&Symbol.for){var St=Symbol.for;Zu=St("selector.component"),vd=St("selector.has_pseudo_class"),_d=St("selector.role"),Ut=St("selector.test_id"),sn=St("selector.text")}var Dt=typeof WeakMap=="function"?WeakMap:Map,$e=0,Mt=null,gt=null,Et=0,mn=0,ii=null,ln=!1,ea=!1,il=!1,qa=0,It=0,ta=0,Ya=0,er=0,Nr=0,rl=0,jc=null,na=null,Pc=!1,ws=0,Pn=1/0,Va=null,ia=null,_a=!1,al=null,Po=0,Sd=0,Go=null,Fo=0,mr=null;return Ze.attemptContinuousHydration=function(u){if(u.tag===13){var f=At(u,67108864);f!==null&&Ki(f,u,67108864),qh(u,67108864)}},Ze.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var f=fr(),b=At(u,f);b!==null&&Ki(b,u,f),qh(u,f)}},Ze.attemptSynchronousHydration=function(u){switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var f=D(u.pendingLanes);if(f!==0){for(u.pendingLanes|=2,u.entangledLanes|=2;f;){var b=1<<31-wr(f);u.entanglements[1]|=b,f&=~b}bn(u),($e&6)===0&&(Pn=Hi()+500,wi(0))}}break;case 13:f=At(u,2),f!==null&&Ki(f,u,2),Hh(),qh(u,2)}},Ze.batchedUpdates=function(u,f){return u(f)},Ze.createComponentSelector=function(u){return{$$typeof:Zu,value:u}},Ze.createContainer=function(u,f,b,S,M,O,J,ie,fe,we){return Ni(u,f,!1,null,b,S,O,J,ie,fe,we,null)},Ze.createHasPseudoClassSelector=function(u){return{$$typeof:vd,value:u}},Ze.createHydrationContainer=function(u,f,b,S,M,O,J,ie,fe,we,ke,Be,je){return u=Ni(b,S,!0,u,M,O,ie,fe,we,ke,Be,je),u.context=Au(null),b=u.current,S=fr(),M=xn(S),M.callback=f??null,Zt(b,M,S),u.current.lanes=S,V(u,S),bn(u),u},Ze.createPortal=function(u,f,b){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ha,key:S==null?null:""+S,children:u,containerInfo:f,implementation:b}},Ze.createRoleSelector=function(u){return{$$typeof:_d,value:u}},Ze.createTestNameSelector=function(u){return{$$typeof:Ut,value:u}},Ze.createTextSelector=function(u){return{$$typeof:sn,value:u}},Ze.defaultOnCaughtError=function(u){console.error(u)},Ze.defaultOnRecoverableError=function(u){Rp(u)},Ze.defaultOnUncaughtError=function(u){Rp(u)},Ze.deferredUpdates=function(u){var f=rt.T,b=vi();try{return Zi(32),rt.T=null,u()}finally{Zi(b),rt.T=f}},Ze.discreteUpdates=function(u,f,b,S,M){var O=rt.T,J=vi();try{return Zi(2),rt.T=null,u(f,b,S,M)}finally{Zi(J),rt.T=O,$e===0&&(Pn=Hi()+500)}},Ze.findAllNodes=ur,Ze.findBoundingRects=function(u,f){if(!bs)throw Error(r(363));f=ur(u,f),u=[];for(var b=0;b<f.length;b++)u.push(td(f[b]));for(f=u.length-1;0<f;f--){b=u[f];for(var S=b.x,M=S+b.width,O=b.y,J=O+b.height,ie=f-1;0<=ie;ie--)if(f!==ie){var fe=u[ie],we=fe.x,ke=we+fe.width,Be=fe.y,je=Be+fe.height;if(S>=we&&O>=Be&&M<=ke&&J<=je){u.splice(f,1);break}else if(S!==we||b.width!==fe.width||je<O||Be>J){if(!(O!==Be||b.height!==fe.height||ke<S||we>M)){we>S&&(fe.width+=we-S,fe.x=S),ke<M&&(fe.width=M-we),u.splice(f,1);break}}else{Be>O&&(fe.height+=Be-O,fe.y=O),je<J&&(fe.height=J-Be),u.splice(f,1);break}}}return u},Ze.findHostInstance=Fh,Ze.findHostInstanceWithNoPortals=function(u){return u=v(u),u=u!==null?A(u):null,u===null?null:Mc(u.stateNode)},Ze.findHostInstanceWithWarning=function(u){return Fh(u)},Ze.flushPassiveEffects=Mi,Ze.flushSyncFromReconciler=function(u){var f=$e;$e|=1;var b=rt.T,S=vi();try{if(Zi(2),rt.T=null,u)return u()}finally{Zi(S),rt.T=b,$e=f,($e&6)===0&&wi(0)}},Ze.flushSyncWork=Hh,Ze.focusWithin=function(u,f){if(!bs)throw Error(r(363));for(u=Ff(u),f=xg(u,f),f=Array.from(f),u=0;u<f.length;){var b=f[u++],S=b.tag;if(!xs(b)){if((S===5||S===26||S===27)&&qn(b.stateNode))return!0;for(b=b.child;b!==null;)f.push(b),b=b.sibling}}return!1},Ze.getFindAllNodesFailureDescription=function(u,f){if(!bs)throw Error(r(363));var b=0,S=[];u=[Ff(u),0];for(var M=0;M<u.length;){var O=u[M++],J=O.tag,ie=u[M++],fe=f[ie];if((J!==5&&J!==26&&J!==27||!xs(O))&&(Ec(O,fe)&&(S.push(Il(fe)),ie++,ie>b&&(b=ie)),ie<f.length))for(O=O.child;O!==null;)u.push(O,ie),O=O.sibling}if(b<f.length){for(u=[];b<f.length;b++)u.push(Il(f[b]));return`findAllNodes was able to match part of the selector:
341
- `+(S.join(" > ")+`
342
-
343
- No matching component was found for:
344
- `)+u.join(" > ")}return null},Ze.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 27:case 5:return Mc(u.child.stateNode);default:return u.child.stateNode}},Ze.injectIntoDevTools=function(){var u={bundleType:0,version:$f,rendererPackageName:Ru,currentDispatcherRef:rt,findFiberByHostInstance:ep,reconcilerVersion:"19.0.0"};if(ku!==null&&(u.rendererConfig=ku),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)u=!0;else{try{Dc=f.inject(u),Tr=f}catch{}u=!!f.checkDCE}}return u},Ze.isAlreadyRendering=function(){return!1},Ze.observeVisibleRects=function(u,f,b,S){if(!bs)throw Error(r(363));u=ur(u,f);var M=ip(u,b,S).disconnect;return{disconnect:function(){M()}}},Ze.shouldError=function(){return null},Ze.shouldSuspend=function(){return!1},Ze.startHostTransition=function(u,f,b,S){if(u.tag!==5)throw Error(r(476));var M=uu(u).queue;uc(u,M,f,Er,b===null?i:function(){var O=uu(u).next.queue;return Cl(u,O,{},fr()),b(S)})},Ze.updateContainer=function(u,f,b,S){var M=f.current,O=fr();return Sg(M,O,u,f,b,S),O},Ze.updateContainerSync=function(u,f,b,S){return f.tag===0&&Mi(),Sg(f.current,2,u,f,b,S),2},Ze},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})(Hx)),Hx.exports}var Nw;function WB(){return Nw||(Nw=1,Ix.exports=KB()),Ix.exports}var ZB=WB();const $B=lu(ZB),QB=$B;function JB(t,e,n,i){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function eL(){}function tL(){return!1}const uM={};function nL(t){return t??uM}function iL(){return au.currentUpdatePriority}function rL(){return null}function aL(t){throw new Error("Not yet implemented.")}function sL(t){return t}function lL(){return uM}function oL(t){t instanceof br?t.visible=!1:t instanceof Ef&&(t.enabled=!1)}function cL(t){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function fM(t){if(t instanceof Ef){const e=t.__pixireact.parent;if(e){const n=e.__pixireact.filters.indexOf(t);e.__pixireact.filters.splice(n,1),e.filters=e.__pixireact.filters}t.__pixireact.parent=null}}function dM(t,e,...n){}function Rw(t,e,n){if(dM(),e instanceof br){const i=e,r=e,s=n;i.parent===t&&t.removeChild(r);const l=t.getChildIndex(s);t.addChildAt(r,l)}else if(e instanceof Ef){const s=e.__pixireact.filters.indexOf(n);fM(e),rM(t,e,s)}}function uL(){return!1}function fL(){return!0}function dL(){return null}function hL(){}function pL(){}function kw(t,e){e instanceof Ef&&fM(e),e.destroy()}function mL(t){}function gL(){}function yL(){}function bL(){return-1.1}function xL(){return null}function vL(){var n;if(au.currentUpdatePriority)return au.currentUpdatePriority;const t=typeof self<"u"&&self||typeof window<"u"&&window;if(!t)return Yd.DefaultEventPriority;switch((n=t.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Yd.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Yd.ContinuousEventPriority;default:return Yd.DefaultEventPriority}}function _L(t){au.currentUpdatePriority=t}function SL(){return!1}function EL(){return!1}function wL(){}function TL(){}function CL(){}function AL(t){t instanceof br?t.visible=!0:t instanceof Ef&&(t.enabled=!0)}function ML(t){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function NL(){return null}const RL={isPrimaryRenderer:!1,noTimeout:-1,NotPendingTransition:null,supportsHydration:!1,supportsMutation:!0,supportsPersistence:!1,warnsIfNotActing:!1,afterActiveInstanceBlur:AB,appendChild:Ux,appendChildToContainer:Ux,appendInitialChild:Ux,beforeActiveInstanceBlur:MB,cancelTimeout:clearTimeout,clearContainer:NB,commitUpdate:jB,createInstance:YB,createTextInstance:JB,hideTextInstance:cL,unhideTextInstance:ML,detachDeletedInstance:eL,finalizeInitialChildren:tL,getChildHostContext:nL,getCurrentUpdatePriority:iL,getInstanceFromNode:rL,getInstanceFromScope:aL,getPublicInstance:sL,getRootHostContext:lL,hideInstance:oL,insertBefore:Rw,insertInContainerBefore:Rw,maySuspendCommit:uL,preloadInstance:fL,prepareForCommit:dL,preparePortalMount:hL,prepareScopeUpdate:pL,removeChild:kw,removeChildFromContainer:kw,requestPostPaintCallback:mL,resetAfterCommit:gL,resetFormInstance:yL,resolveEventTimeStamp:bL,resolveEventType:xL,resolveUpdatePriority:vL,scheduleTimeout:setTimeout,shouldAttemptEagerTransition:SL,setCurrentUpdatePriority:_L,shouldSetTextContent:EL,startSuspendingCommit:wL,suspendInstance:TL,trackSchedulerEvent:CL,unhideInstance:AL,waitForCommitToBeReady:NL,rendererPackageName:"@pixi/react",rendererVersion:CB.version},w0=QB(RL);w0.injectIntoDevTools();const ah=new Map;function kL(t,e={}){let n=ah.get(t),i=(n==null?void 0:n.applicationState)??{isInitialised:!1,isInitialising:!1};const r=(n==null?void 0:n.internalState)??{};n||(i.app=new F_,r.rootContainer=iM(i.app.stage));const s=(n==null?void 0:n.fiber)??w0.createContainer(r.rootContainer,Yd.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null);if(!n){let l;t instanceof HTMLCanvasElement&&(l=t),l||(l=document.createElement("canvas"),t.innerHTML="",t.appendChild(l)),r.canvas=l,n={applicationState:i,fiber:s,internalState:r,render:async(d,p)=>{var m;return!i.app.renderer&&!i.isInitialised&&!i.isInitialising&&(i.isInitialising=!0,await i.app.init({...p,canvas:l}),i.isInitialising=!1,i.isInitialised=!0,i={...i},(m=e.onInit)==null||m.call(e,i.app)),Object.entries(p).forEach(([g,x])=>{const v=g;nM(p,v)||(i.app[v]=x)}),w0.updateContainer(R.jsx(wB,{value:i,children:d}),s,null,()=>{}),i.app}},ah.set(l,n)}return n}function hM(t){au.unmountQueue.delete(t);const e=t.fiber;e&&w0.updateContainer(null,e,null,()=>{t.applicationState.app&&t.applicationState.app.destroy(),ah.delete(t.internalState.canvas)})}function OL(){for(const t of au.unmountQueue)hM(t)}function DL(t){const e=ah.get(t);e&&(e.applicationState.isInitialised?hM(e):au.unmountQueue.add(e))}function zL(t){const e=ah.get(t);e&&au.unmountQueue.delete(e)}var nC,iC;const Ly=typeof window<"u"&&((nC=window.document)!=null&&nC.createElement||((iC=window.navigator)==null?void 0:iC.product)==="ReactNative")?G.useLayoutEffect:G.useEffect,BL={...gf.defaultTextStyle},LL=G.forwardRef(function(e,n){const{children:i,className:r,defaultTextStyle:s,extensions:l,onInit:c,resizeTo:d,...p}=e,m=VD(),g=G.useRef(null),x=G.useRef(null),v=G.useRef(new Set);G.useImperativeHandle(n,()=>({getApplication(){return g.current},getCanvas(){return x.current}}));const E=G.useCallback(()=>{const C=g.current;C&&(d?"current"in d?d.current instanceof HTMLElement&&(C.resizeTo=d.current):C.resizeTo=d:C.resizeTo=void 0)},[d]),A=G.useCallback(C=>{OL(),g.current=C,E(),c==null||c(C)},[c]);return Ly(()=>{if(l){const C=[...l],w=v.current;for(const k of w.values()){const N=C.indexOf(k);N===-1&&(si.remove(k),w.delete(k)),C.splice(N,1)}for(const k of C)si.add(k),w.add(k)}},[l]),Ly(()=>{const C=x.current;if(C){let w=ah.get(C);w||(w=kL(C,{onInit:A})),w.render(R.jsx(m,{children:i}),p)}},[p,i,A,d]),Ly(()=>{E()},[d]),Ly(()=>{s?Object.assign(gf.defaultTextStyle,s):Object.assign(gf.defaultTextStyle,BL)},[s]),G.useEffect(()=>{const C=x.current;if(C)return zL(C),()=>{DL(C)}},[]),R.jsx("canvas",{ref:x,className:r})}),UL=G.forwardRef(function(e,n){return R.jsx(NC,{children:R.jsx(LL,{ref:n,...e})})});function Q0(t){Object.assign(e_,t)}function IL(){const t=G.useContext(e1);return dM(t.app instanceof F_,"No Context found with `%s`. Make sure to wrap component with `%s`","Application","AppProvider"),t}function HL({agentName:t,question:e,onRespond:n}){const[i,r]=G.useState(""),s=()=>{const c=i.trim();c&&(n(c),r(""))},l=c=>{c.key==="Enter"&&s()};return R.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(7, 8, 14, 0.8)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:50,animation:"fadeIn 0.2s var(--ease-out) both"},children:R.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--status-warning)",borderRadius:"var(--radius-lg)",boxShadow:"0 0 40px var(--status-warning-glow), var(--shadow-lg)",padding:"var(--sp-6)",maxWidth:440,width:"100%",margin:"0 var(--sp-4)",animation:"scaleIn 0.3s var(--ease-spring) both"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",marginBottom:"var(--sp-4)"},children:[R.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--radius-full)",background:"var(--status-warning-glow)",border:"1px solid var(--status-warning)",color:"var(--status-warning)",fontSize:"0.7rem",fontWeight:700},children:"◆"}),R.jsxs("h2",{style:{fontFamily:"var(--font-mono)",fontSize:"0.78rem",fontWeight:700,color:"var(--status-warning)",textTransform:"uppercase",letterSpacing:"0.08em"},children:["Checkpoint — ",t]})]}),R.jsx("p",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.6,marginBottom:"var(--sp-5)"},children:e}),R.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[R.jsx("input",{type:"text",className:"input",placeholder:"Type your response...",value:i,onChange:c=>r(c.target.value),onKeyPress:l,autoFocus:!0,style:{flex:1}}),R.jsx("button",{onClick:s,className:"btn",style:{background:"var(--status-warning)",color:"var(--text-inverse)",border:"1px solid var(--status-warning)",fontWeight:600,padding:"0 var(--sp-4)"},children:"Send"})]})]})})}const Ow=[16109737,15251594,13935988,13012574,10515018,9133628],Dw=[2890510,4861722,9136404,12886874,1710618,9118976],jL=l0,at=jL/2,ft=7,dn=14,di=12,hi=5,As=10,gn=4,Ms=9,Tt=8;function Od(t,e,n,i,r){t.circle(e,n-1,ft+1),t.fill(r),t.circle(e,n,ft),t.fill(i),t.circle(e-3,n-1,1.5),t.fill(1710618),t.circle(e+3,n-1,1.5),t.fill(1710618),t.circle(e-2.5,n-1.5,.6),t.fill(16777215),t.circle(e+3.5,n-1.5,.6),t.fill(16777215)}function Dd(t,e,n,i,r,s){t.roundRect(e-i/2,n,i,r,3),t.fill(s),t.moveTo(e-3,n),t.lineTo(e,n+4),t.lineTo(e+3,n),t.stroke({width:1,color:PL(s,.15)})}function zw(t,e,n,i,r){t.roundRect(e-i-1,n,i,r,2),t.fill(2899536),t.roundRect(e+1,n,i,r,2),t.fill(2899536)}function Bw(t,e,n,i){t.roundRect(e-i-2,n,i+2,3,1),t.fill(1710618),t.roundRect(e,n,i+2,3,1),t.fill(1710618)}function PL(t,e){const n=Math.max(0,(t>>16&255)*(1-e)),i=Math.max(0,(t>>8&255)*(1-e)),r=Math.max(0,(t&255)*(1-e));return Math.floor(n)<<16|Math.floor(i)<<8|Math.floor(r)}function GL(t){const e=new Map;for(let n=0;n<Rv.length;n++){const i=Rv[n],r=Ow[n%Ow.length],s=Dw[n%Dw.length],l=new Aa;Od(l,at,Tt,r,s),Dd(l,at,Tt+ft,dn,di,i),l.roundRect(at-dn/2-gn,Tt+ft+1,gn,Ms,2),l.fill(i),l.roundRect(at+dn/2,Tt+ft+1,gn,Ms,2),l.fill(i),l.circle(at-dn/2-gn/2,Tt+ft+Ms+1,2),l.fill(r),l.circle(at+dn/2+gn/2,Tt+ft+Ms+1,2),l.fill(r),zw(l,at,Tt+ft+di,hi,As),Bw(l,at,Tt+ft+di+As,hi),e.set(`agent-${n}-standing`,t.renderer.generateTexture(l));const c=new Aa,d=Tt+4;Od(c,at,d,r,s),Dd(c,at,d+ft,dn,di-2,i),c.roundRect(at-dn/2-gn+1,d+ft+2,gn,Ms-3,2),c.fill(i),c.roundRect(at+dn/2-1,d+ft+2,gn,Ms-3,2),c.fill(i);const p=6;c.roundRect(at-hi-1,d+ft+di-2,hi+1,p,2),c.fill(2899536),c.roundRect(at,d+ft+di-2,hi+1,p,2),c.fill(2899536),e.set(`agent-${n}-seated`,t.renderer.generateTexture(c));const m=new Aa,g=Tt+4;Od(m,at+2,g,r,s),Dd(m,at+1,g+ft,dn,di-2,i),m.roundRect(at+dn/2,g+ft+2,gn+4,4,2),m.fill(i),m.roundRect(at+dn/2-2,g+ft+2,gn+4,4,2),m.fill(i),m.circle(at+dn/2+gn+3,g+ft+4,2),m.fill(r),m.circle(at+dn/2+gn+1,g+ft+4,2),m.fill(r),c.roundRect(at-hi-1,g+ft+di-2,hi+1,p,2),c.fill(2899536),m.roundRect(at,g+ft+di-2,hi+1,p,2),m.fill(2899536),e.set(`agent-${n}-typing`,t.renderer.generateTexture(m));const x=new Aa;Od(x,at,Tt,r,s),Dd(x,at,Tt+ft,dn,di,i),x.roundRect(at-dn/2-gn,Tt+ft-1,gn,Ms+2,2),x.fill(i),x.roundRect(at+dn/2,Tt+ft+3,gn,Ms-2,2),x.fill(i),x.roundRect(at+1,Tt+ft+di,hi,As+2,2),x.fill(2899536),x.roundRect(at-hi-1,Tt+ft+di-2,hi,As,2),x.fill(2899536),x.roundRect(at,Tt+ft+di+As+1,hi+2,3,1),x.fill(1710618),x.roundRect(at-hi-2,Tt+ft+di+As-3,hi+1,3,1),x.fill(1710618),e.set(`agent-${n}-walk-right`,t.renderer.generateTexture(x));const v=new Aa;Od(v,at,Tt,r,s),Dd(v,at,Tt+ft,dn,di,i),v.roundRect(at+dn/2,Tt+ft-1,gn,Ms+2,2),v.fill(i),v.roundRect(at-dn/2-gn,Tt+ft+3,gn,Ms-2,2),v.fill(i),v.roundRect(at-hi-1,Tt+ft+di,hi,As+2,2),v.fill(2899536),v.roundRect(at+1,Tt+ft+di-2,hi,As,2),v.fill(2899536),v.roundRect(at-hi-2,Tt+ft+di+As+1,hi+2,3,1),v.fill(1710618),v.roundRect(at,Tt+ft+di+As-3,hi+1,3,1),v.fill(1710618),e.set(`agent-${n}-walk-left`,t.renderer.generateTexture(v));const E=new Aa;Od(E,at,Tt,r,s),Dd(E,at,Tt+ft,dn,di,i),E.roundRect(at-dn/2-gn,Tt+ft+1,gn,Ms,2),E.fill(i),E.circle(at-dn/2-gn/2,Tt+ft+Ms+1,2),E.fill(r),E.roundRect(at+dn/2,Tt+ft,gn,6,2),E.fill(i),E.circle(at+dn/2+gn/2+1,Tt+ft,2),E.fill(r),E.roundRect(at+dn/2+gn/2-1,Tt+ft-6,6,7,1),E.fill(14142664),E.moveTo(at+dn/2+gn/2,Tt+ft-7),E.quadraticCurveTo(at+dn/2+gn/2+2,Tt+ft-11,at+dn/2+gn/2,Tt+ft-14),E.stroke({width:1,color:16777215,alpha:.4}),E.moveTo(at+dn/2+gn/2+3,Tt+ft-7),E.quadraticCurveTo(at+dn/2+gn/2+5,Tt+ft-10,at+dn/2+gn/2+3,Tt+ft-13),E.stroke({width:1,color:16777215,alpha:.3}),zw(E,at,Tt+ft+di,hi,As),Bw(E,at,Tt+ft+di+As,hi),e.set(`agent-${n}-coffee`,t.renderer.generateTexture(E))}return e}function FL(t,e){const n=t%Rv.length;let i;switch(e){case"working":i="typing";break;case"typing":i="typing";break;case"standing":i="standing";break;case"coffee":i="coffee";break;case"walk-right":i="walk-right";break;case"walk-left":i="walk-left";break;case"delivering":i="walk-right";break;case"idle":i="standing";break;case"seated":i="seated";break;case"checkpoint":case"done":default:i="seated";break}return`agent-${n}-${i}`}function qL(t,e){const n=wC;t.roundRect(0,0,e.totalWidth,e.totalHeight,4),t.fill(Jd.wall),t.rect(0,0,e.totalWidth,3),t.fill({color:Jd.wallHighlight,alpha:.5}),Uw(t,e.corridorH.x,e.corridorH.y,e.corridorH.width,e.corridorH.height,"horizontal"),Uw(t,e.corridorV.x,e.corridorV.y,e.corridorV.width,e.corridorV.height,"vertical");for(const x of e.squadOrigins){const{origin:v,width:E,height:A,doorSide:C}=x;C==="right"?Qp(t,v.x+E,v.y+A/2-Vo/2,n,Vo):C==="left"?Qp(t,v.x-n,v.y+A/2-Vo/2,n,Vo):C==="top"?$p(t,v.x+E/2-Vo/2,v.y-n,Vo,n):$p(t,v.x+E/2-Vo/2,v.y+A,Vo,n)}const i=e.ceoOffice,r=Math.min(Vo,60);Qp(t,i.x+i.width,i.y+i.height/2-r/2,n,r),$p(t,i.x+i.width/2-r/2,i.y+i.height,r,n);const s=e.bathroomMale;$p(t,s.x+s.width/2-30,s.y+s.height,60,n);const l=e.bathroomFemale;$p(t,l.x+l.width/2-30,l.y+l.height,60,n);const c=e.kitchen;Qp(t,c.x+c.width,c.y+c.height/2-30,n,60);const d=e.restArea;Qp(t,d.x-n,d.y+d.height/2-30,n,60);const p=e.corridorV;if(p.height>100){const x=p.x+p.width/2;for(let v=p.y+60;v<p.y+p.height-40;v+=200)Lw(t,x,v)}const m=e.corridorH,g=m.y+m.height/2;for(let x=m.x+80;x<m.x+m.width-80;x+=220)Lw(t,x,g);t.roundRect(0,0,e.totalWidth,e.totalHeight,4),t.stroke({width:2,color:5533306,alpha:.6})}function $p(t,e,n,i,r){t.rect(e,n,i,r),t.fill(tu.floor),t.rect(e-2,n,2,r),t.fill(Jd.doorFrame),t.rect(e+i,n,2,r),t.fill(Jd.doorFrame)}function Qp(t,e,n,i,r){t.rect(e,n,i,r),t.fill(tu.floor),t.rect(e,n-2,i,2),t.fill(Jd.doorFrame),t.rect(e,n+r,i,2),t.fill(Jd.doorFrame)}function Lw(t,e,n){t.roundRect(e-8,n-12,16,12,2),t.fill(9133628),t.circle(e,n-16,8),t.fill(5025616),t.circle(e-4,n-20,5),t.fill(3706428),t.circle(e+4,n-18,6),t.fill(6732650)}function Uw(t,e,n,i,r,s){t.rect(e,n,i,r),t.fill(tu.floor);const l=40;for(let c=0;c<Math.ceil(r/l);c++){for(let d=0;d<Math.ceil(i/l);d++){const p=e+d*l,m=n+c*l;(c+d)%2===0&&(t.rect(p,m,l,l),t.fill({color:tu.tile,alpha:.5})),t.moveTo(p,n),t.lineTo(p,n+r),t.stroke({width:.5,color:tu.grout,alpha:.3})}t.moveTo(e,n+c*l),t.lineTo(e+i,n+c*l),t.stroke({width:.5,color:tu.grout,alpha:.3})}s==="horizontal"?(t.rect(e+10,n+r/2-2,i-20,4),t.fill({color:tu.stripe,alpha:.3})):(t.rect(e+i/2-2,n+10,4,r-20),t.fill({color:tu.stripe,alpha:.3}))}function Iw(t,e,n,i,r,s){t.rect(e,n,i,r),t.fill(ra.floor);const l=20;for(let C=0;C<Math.ceil(r/l);C++)for(let w=0;w<Math.ceil(i/l);w++)if((C+w)%2===0){const k=e+w*l,N=n+C*l;t.rect(k,N,l,l),t.fill({color:ra.tile,alpha:.4})}for(let C=0;C<=Math.ceil(r/l);C++)t.moveTo(e,n+C*l),t.lineTo(e+i,n+C*l),t.stroke({width:.5,color:ra.tileGrout,alpha:.3});for(let C=0;C<=Math.ceil(i/l);C++)t.moveTo(e+C*l,n),t.lineTo(e+C*l,n+r),t.stroke({width:.5,color:ra.tileGrout,alpha:.3});const c=Math.min(6,Math.max(2,Math.floor((i-20)/70))),d=(i-20)/c,p=80,m=n+r-p-10;for(let C=0;C<c;C++){const w=e+10+C*d;t.rect(w,m,3,p),t.fill(ra.stall),t.rect(w+d-3,m,3,p),t.fill(ra.stall),t.roundRect(w+6,m,d-12,p-4,2),t.fill({color:ra.stallDoor,alpha:.6}),t.circle(w+d-16,m+p/2,2),t.fill({color:7901340,alpha:.8});const k=w+d/2,N=m+p-24;t.roundRect(k-8,N,16,20,4),t.fill(ra.toilet),t.roundRect(k-6,N+2,12,14,3),t.fill(ra.toiletSeat),t.roundRect(k-6,N+2,12,14,3),t.stroke({width:.5,color:12434877,alpha:.5})}const g=Math.min(4,Math.max(2,Math.floor(i/100))),x=i/(g+1),v=n+30;t.rect(e+4,n+4,i-8,60),t.fill({color:ra.wall,alpha:.3});for(let C=0;C<g;C++){const w=e+x*(C+1);t.roundRect(w-12,n+8,24,20,3),t.fill(ra.mirrorFrame),t.roundRect(w-10,n+10,20,16,2),t.fill(ra.mirror),t.roundRect(w-6,n+12,6,10,1),t.fill({color:16777215,alpha:.15}),t.roundRect(w-14,v,28,16,3),t.fill(ra.sink),t.ellipse(w,v+8,8,5),t.fill(ra.sinkBowl),t.ellipse(w,v+8,8,5),t.stroke({width:.5,color:12434877,alpha:.4}),t.roundRect(w-2,v+1,4,6,1),t.fill(ra.pipe)}const E=e+i/2,A=n+r-20;t.roundRect(E-12,A-6,24,14,3),t.fill({color:3622735,alpha:.7}),s==="male"?(t.circle(E,A-2,3),t.fill({color:16777215,alpha:.8}),t.rect(E-3,A+1,6,4),t.fill({color:4367861,alpha:.8})):(t.circle(E,A-2,3),t.fill({color:16777215,alpha:.8}),t.moveTo(E-5,A+5),t.lineTo(E+5,A+5),t.lineTo(E,A+1),t.closePath(),t.fill({color:15684432,alpha:.8})),t.rect(e,n,i,r),t.stroke({width:1,color:0,alpha:.08})}function YL(t,e,n,i,r){t.rect(e,n,i,r),t.fill(tr.floor);const s=24;for(let p=0;p<Math.ceil(r/s);p++)for(let m=0;m<Math.ceil(i/s);m++)(p+m)%2===0&&(t.rect(e+m*s,n+p*s,s,s),t.fill({color:tr.tile,alpha:.4}));for(let p=0;p<=Math.ceil(r/s);p++)t.moveTo(e,n+p*s),t.lineTo(e+i,n+p*s),t.stroke({width:.5,color:tr.tileGrout,alpha:.3});for(let p=0;p<=Math.ceil(i/s);p++)t.moveTo(e+p*s,n),t.lineTo(e+p*s,n+r),t.stroke({width:.5,color:tr.tileGrout,alpha:.3});t.roundRect(e+6,n+10,24,r-20,3),t.fill(tr.counter),t.roundRect(e+7,n+11,22,r-22,2),t.fill(tr.counterTop),t.roundRect(e+6,n+10,24,40,3),t.fill(tr.fridge),t.roundRect(e+8,n+12,20,18,2),t.fill(tr.fridgeDoor),t.roundRect(e+8,n+32,20,16,2),t.fill(tr.fridgeDoor),t.roundRect(e+26,n+20,2,8,1),t.fill(tr.fridgeHandle),t.roundRect(e+26,n+36,2,8,1),t.fill(tr.fridgeHandle),t.roundRect(e+10,n+60,16,20,2),t.fill(tr.coffeeMaker),t.circle(e+18,n+64,2),t.fill({color:tr.coffeeMakerLight,alpha:.9});const l=e+i/2-16,c=n+r/2-12;t.roundRect(l,c,32,24,4),t.fill(tr.table),t.roundRect(l+2,c+2,28,20,3),t.fill(tr.tableTop);const d=[{cx:l-6,cy:c+12},{cx:l+38,cy:c+12},{cx:l+16,cy:c+30}];for(const p of d)t.roundRect(p.cx-5,p.cy-5,10,10,3),t.fill(tr.chair);t.circle(e+i/2,n+8,4),t.fill({color:tr.lamp,alpha:.6}),t.circle(e+i/2,n+8,8),t.fill({color:tr.lamp,alpha:.1}),t.rect(e,n,i,r),t.stroke({width:1,color:0,alpha:.08})}function VL(t,e,n,i,r){t.rect(e,n,i,r),t.fill(Ea.floor),t.roundRect(e+8,n+8,i-16,r-16,6),t.fill({color:Ea.carpet,alpha:.2}),t.roundRect(e+12,n+12,i-24,r-24,4),t.stroke({width:1,color:Ea.carpetBorder,alpha:.15});const s=e+10,l=n+10,c=i-20,d=28;t.roundRect(s,l,c,10,3),t.fill(Ea.sofaArm),t.roundRect(s,l+8,c,d-8,4),t.fill(Ea.sofa);const p=(c-12)/3;for(let E=0;E<3;E++)t.roundRect(s+4+E*(p+2),l+10,p,d-14,3),t.fill(Ea.sofaCushion);t.roundRect(s-2,l+6,6,d-4,2),t.fill(Ea.sofaArm),t.roundRect(s+c-4,l+6,6,d-4,2),t.fill(Ea.sofaArm);const m=e+i/2,g=n+r-20;t.roundRect(m-12,g+8,24,10,2),t.fill(Ea.tvStand),t.roundRect(m-20,g-12,40,22,2),t.fill(Ea.tv),t.roundRect(m-18,g-10,36,18,1),t.fill(Ea.tvScreen),t.roundRect(m-14,g-8,10,6,1),t.fill({color:16777215,alpha:.05});const x=e+i-30,v=n+r/2-8;t.roundRect(x,v,20,16,3),t.fill(Ea.sideTable),t.rect(x+3,v+2,8,11),t.fill({color:Ea.magazine,alpha:.7}),t.rect(x+8,v+4,8,10),t.fill({color:Ea.magazineAlt,alpha:.6}),t.roundRect(e+8,n+r-40,12,10,2),t.fill(9133628),t.circle(e+14,n+r-34,7),t.fill(5025616),t.circle(e+11,n+r-38,4),t.fill(3706428),t.rect(e,n,i,r),t.stroke({width:1,color:0,alpha:.08})}function XL(t,e,n){t.rect(0,0,e,n),t.fill(dt.floor);const i=20,r=80;for(let g=0;g<Math.ceil(n/i);g++){const x=g%2*(r/2),v=g*i;t.moveTo(0,v),t.lineTo(e,v),t.stroke({width:1,color:dt.floorGrout,alpha:.4});for(let E=0;E<Math.ceil(e/r)+1;E++){const A=E*r-x;A>0&&A<e&&(t.moveTo(A,v),t.lineTo(A,v+i),t.stroke({width:1,color:dt.floorGrout,alpha:.25}))}g%3===0&&(t.rect(0,v+2,e,i-4),t.fill({color:dt.floorHighlight,alpha:.08}))}const s=42;t.rect(0,s,e,4),t.fill({color:0,alpha:.1}),t.rect(0,0,e,s),t.fill({color:dt.wall,alpha:.2}),t.rect(0,0,e,3),t.fill({color:dt.wallTrim,alpha:.15}),t.rect(0,s-4,e,4),t.fill({color:dt.baseboard,alpha:.2});const l=120,c=e-l*2,d=n-200,p=l,m=100;c>100&&d>60&&(t.roundRect(p+3,m+3,c,d,6),t.fill({color:0,alpha:.08}),t.roundRect(p,m,c,d,6),t.fill({color:dt.rug,alpha:.15}),t.roundRect(p+4,m+4,c-8,d-8,4),t.stroke({width:1.5,color:dt.rugBorder,alpha:.12}),t.roundRect(p+12,m+12,c-24,d-24,3),t.stroke({width:1,color:dt.rugPattern,alpha:.1}))}function KL(t,e,n){const i=e+ol/2,r=n+Jc+8;for(let A=0;A<5;A++){const C=A/5*Math.PI*2-Math.PI/2,w=i+Math.cos(C)*10,k=r+14+Math.sin(C)*5;t.circle(w,k,2),t.fill(dt.chairWheel)}t.rect(i-1.5,r+4,3,12),t.fill(dt.chairBase),t.roundRect(i-14,r,28,10,4),t.fill(dt.chairSeat),t.roundRect(i-12,r+1,24,4,3),t.fill({color:dt.chairBack,alpha:.5}),t.roundRect(i-12,r-16,24,18,5),t.fill(dt.chairBack),t.roundRect(i-10,r-14,20,8,3),t.fill({color:16777215,alpha:.05}),t.roundRect(e+3,n+3,ol,Jc,4),t.fill({color:0,alpha:.12}),t.roundRect(e,n,ol,Jc,4),t.fill(dt.desk),t.roundRect(e+2,n+2,ol-4,Jc-4,3),t.fill(dt.deskTop);for(let A=0;A<3;A++){const C=n+10+A*16;t.moveTo(e+6,C),t.lineTo(e+ol-6,C),t.stroke({width:.5,color:dt.deskShadow,alpha:.2})}t.rect(e+2,n+Jc-6,ol-4,4),t.fill(dt.deskEdge);const s=4,l=8;t.rect(e+4,n+Jc,s,l),t.fill(dt.deskLeg),t.rect(e+ol-4-s,n+Jc,s,l),t.fill(dt.deskLeg);const c=32,d=22,p=e+(ol-c)/2,m=n+8;t.roundRect(p+c/2-10,m+d+4,20,4,2),t.fill(dt.monitorStand),t.rect(p+c/2-2,m+d,4,6),t.fill(dt.monitorStand),t.roundRect(p,m,c,d,2),t.fill(dt.monitor),t.roundRect(p+2,m+2,c-4,d-5,1),t.fill(dt.monitorScreen),t.roundRect(p+3,m+3,c-6,6,1),t.fill({color:dt.monitorScreenGlow,alpha:.3});const g=24,x=8,v=p+(c-g)/2,E=m+d+10;t.roundRect(v,E,g,x,2),t.fill(dt.keyboard);for(let A=0;A<3;A++)for(let C=0;C<6;C++)t.rect(v+2+C*3.5,E+1.5+A*2.5,2.5,1.5),t.fill(dt.keyboardKey);t.roundRect(e+ol-18,n+14,7,8,2),t.fill(14142664),t.roundRect(e+ol-11,n+16,3,4,1),t.fill(14142664),t.rect(e+8,n+20,14,18),t.fill(16775620),t.rect(e+8,n+20,14,2),t.fill(16635957),t.rect(e+10,n+24,10,1.5),t.fill(1402304)}function WL(t,e,n){t.roundRect(e+2,n+2,44,64,3),t.fill({color:0,alpha:.1}),t.roundRect(e,n,44,64,3),t.fill(dt.bookshelf),t.roundRect(e+1,n+1,42,62,2),t.stroke({width:1,color:dt.bookshelfEdge,alpha:.3}),t.rect(e+3,n+3,38,58),t.fill({color:6048310,alpha:.5});for(let i=0;i<3;i++){const r=n+8+i*20;t.rect(e+3,r+14,38,3),t.fill(dt.bookshelfEdge),t.rect(e+3,r+17,38,1),t.fill({color:0,alpha:.1});const s=4+i%2;for(let l=0;l<s;l++){const c=e+5+l*(34/s),d=Math.max(4,34/s-2),p=10+(l*3+i*2)%5,m=(l+i*3)%dt.bookColors.length;t.rect(c,r+14-p,d,p),t.fill(dt.bookColors[m]),t.rect(c+1,r+14-p+2,.8,p-4),t.fill({color:16777215,alpha:.15})}i===1&&(t.circle(e+38,r+8,4),t.fill({color:4367861,alpha:.6}),t.circle(e+38,r+8,4),t.stroke({width:.5,color:2001125,alpha:.4}))}t.roundRect(e+14,n-4,8,6,1),t.fill(dt.pot),t.circle(e+18,n-6,5),t.fill(dt.plantLight),t.circle(e+15,n-8,3),t.fill(dt.plant)}function Hw(t,e,n){t.ellipse(e+12,n+34,12,3),t.fill({color:0,alpha:.1}),t.moveTo(e+2,n+16),t.lineTo(e+4,n+32),t.lineTo(e+20,n+32),t.lineTo(e+22,n+16),t.closePath(),t.fill(dt.pot),t.roundRect(e,n+14,24,5,2),t.fill(dt.potRim),t.roundRect(e+2,n+14,20,2,1),t.fill({color:16777215,alpha:.08}),t.ellipse(e+12,n+16,10,3),t.fill(dt.soil),t.rect(e+11,n+2,2,14),t.fill(dt.plantDark),t.ellipse(e+6,n+4,7,5),t.fill(dt.plantDark),t.ellipse(e+18,n+2,6,5),t.fill(dt.plantDark),t.ellipse(e+12,n+1,8,6),t.fill(dt.plant),t.ellipse(e+4,n+8,6,4),t.fill(dt.plant),t.ellipse(e+20,n+8,6,4),t.fill(dt.plant),t.ellipse(e+9,n+5,5,4),t.fill(dt.plantLight),t.ellipse(e+15,n+3,5,4),t.fill(dt.plantLight),t.moveTo(e+12,n-2),t.lineTo(e+12,n+6),t.stroke({width:.5,color:dt.plantDark,alpha:.3})}function ZL(t,e,n){t.roundRect(e+2,n+2,80,40,4),t.fill({color:0,alpha:.1}),t.roundRect(e,n,80,40,4),t.fill(Or.counter),t.roundRect(e+1,n+1,78,8,3),t.fill(Or.counterTop),t.roundRect(e+2,n+2,76,3,2),t.fill({color:16777215,alpha:.06}),t.roundRect(e+4,n-14,28,38,3),t.fill(Or.machine),t.roundRect(e+5,n-14,26,6,2),t.fill(Or.machineTop),t.roundRect(e+8,n+16,20,4,1),t.fill({color:2503224,alpha:.8}),t.rect(e+13,n+8,3,8),t.fill(Or.machineTop),t.rect(e+20,n+8,3,8),t.fill(Or.machineTop),t.circle(e+18,n-8,2.5),t.fill({color:Or.machineLight,alpha:.9}),t.circle(e+18,n-8,5),t.fill({color:Or.machineLight,alpha:.15}),t.roundRect(e+38,n+8,8,10,2),t.fill(Or.cup),t.roundRect(e+46,n+10,3,5,1),t.fill(Or.cup),t.roundRect(e+48,n+6,8,10,2),t.fill(Or.cupShadow),t.ellipse(e+42,n+20,10,3),t.fill(Or.saucer),t.roundRect(e+60,n+6,16,14,3),t.fill(Or.sink),t.roundRect(e+62,n+8,12,10,2),t.fill({color:5533306,alpha:.8}),t.rect(e+66,n-2,3,10),t.fill(Or.faucet),t.roundRect(e+65,n-4,8,3,1),t.fill(Or.faucet),t.roundRect(e+10,n-30,30,14,2),t.fill(Or.menu),t.rect(e+14,n-27,22,2),t.fill({color:16777215,alpha:.5}),t.rect(e+14,n-23,16,1.5),t.fill({color:16777215,alpha:.3}),t.rect(e+14,n-20,18,1.5),t.fill({color:16777215,alpha:.3})}function $L(t,e,n){t.roundRect(e-16,n-24,128,96,6),t.fill({color:Xa.carpet,alpha:.25}),t.roundRect(e-12,n-20,120,88,4),t.stroke({width:1,color:Xa.carpetPattern,alpha:.2});const i=e+10,r=n-20;t.roundRect(i+2,r+2,76,16,2),t.fill({color:0,alpha:.1}),t.roundRect(i,r,76,16,2),t.fill(Xa.whiteboardFrame),t.roundRect(i+2,r+2,72,12,1),t.fill(Xa.whiteboard),t.rect(i+6,r+4,18,8),t.fill({color:16775620,alpha:.6}),t.rect(i+28,r+4,18,8),t.fill({color:12312315,alpha:.6}),t.rect(i+50,r+4,18,8),t.fill({color:13166281,alpha:.6}),t.roundRect(i+20,r+14,36,3,1),t.fill(Xa.whiteboardFrame),t.roundRect(e+3,n+3,96,48,6),t.fill({color:0,alpha:.1}),t.roundRect(e,n,96,48,6),t.fill(Xa.table),t.roundRect(e+2,n+2,92,44,5),t.fill(Xa.tableTop),t.roundRect(e+6,n+4,40,10,3),t.fill({color:16777215,alpha:.04}),t.roundRect(e+1,n+1,94,46,5),t.stroke({width:1,color:Xa.tableEdge,alpha:.4});const s=4,l=6;t.rect(e+8,n+48,s,l),t.fill(Xa.tableLeg),t.rect(e+84,n+48,s,l),t.fill(Xa.tableLeg);const c=[{cx:e+16,cy:n-10},{cx:e+48,cy:n-10},{cx:e+80,cy:n-10},{cx:e+16,cy:n+56},{cx:e+48,cy:n+56},{cx:e+80,cy:n+56}];for(const d of c){const m=d.cy<n?d.cy-6:d.cy+6;t.roundRect(d.cx-8,m-4,16,10,3),t.fill(Xa.chairBack),t.roundRect(d.cx-7,d.cy-4,14,8,3),t.fill(Xa.chairSeat),t.roundRect(d.cx-5,d.cy-3,10,3,2),t.fill({color:16777215,alpha:.06}),t.circle(d.cx,d.cy+5,2),t.fill(Xa.chair)}t.roundRect(e+10,n+8,18,12,2),t.fill(3622735),t.roundRect(e+11,n+9,16,8,1),t.fill(4545124),t.rect(e+60,n+12,12,16),t.fill({color:16777215,alpha:.7}),t.rect(e+62,n+14,8,1),t.fill({color:3355443,alpha:.3}),t.rect(e+62,n+17,6,1),t.fill({color:3355443,alpha:.3}),t.roundRect(e+40,n+10,6,14,2),t.fill({color:4367861,alpha:.6}),t.roundRect(e+41,n+7,4,4,1),t.fill({color:9489145,alpha:.5})}const QL={running:uf.statusRunning,idle:uf.statusIdle,completed:uf.statusCompleted,checkpoint:uf.statusCheckpoint};function JL(t,e,n,i){const r=n*.85,s=e+(n-r)/2,l=6,c=30;t.roundRect(s+2,l+2,r,c,8),t.fill({color:0,alpha:.15}),t.roundRect(s,l,r,c,8),t.fill({color:uf.background,alpha:.85}),t.roundRect(s+2,l+1,r-4,8,6),t.fill({color:uf.backgroundGlow,alpha:.4}),t.roundRect(s,l,r,c,8),t.stroke({width:1,color:16777215,alpha:.08});const d=QL[i]??uf.statusIdle,p=s+r-18,m=l+c/2;t.circle(p,m,7),t.fill({color:d,alpha:.2}),t.circle(p,m,4),t.fill(d),t.circle(p-1,m-1,1.5),t.fill({color:16777215,alpha:.3}),t.circle(s+14,m,2),t.fill({color:16777215,alpha:.1})}Q0({Container:br,Graphics:Aa,Sprite:ih,Text:$0});function t1({agent:t,textures:e,bubbleText:n,animX:i,animY:r,animPose:s}){const l=FL(t.colorIndex,s),c=e.get(l),d=wD[t.status==="walking"?"idle":t.status]??8947848,p=t.status==="checkpoint",m=G.useCallback(x=>{x.clear(),x.circle(0,0,l0/2+6),x.fill({color:d,alpha:p?.4:.15})},[d,p]),g=G.useCallback(x=>{if(x.clear(),!n)return;const v=Math.min(n.length*5+16,160);x.roundRect(-v/2,-42,v,22,6),x.fill({color:1710638,alpha:.9}),x.moveTo(-4,-20),x.lineTo(4,-20),x.lineTo(0,-15),x.closePath(),x.fill({color:1710638,alpha:.9})},[n]);return R.jsxs("container",{x:i,y:r,children:[R.jsx("graphics",{draw:m}),c&&R.jsx("sprite",{texture:c,anchor:.5}),R.jsx("text",{text:t.name,y:l0/2+4,anchor:{x:.5,y:0},style:{fontSize:9,fill:"#cccccc",fontFamily:"sans-serif"}}),p&&R.jsx("text",{text:"⚠",y:-l0/2-12,anchor:.5,style:{fontSize:14,fill:"#ff9800",fontFamily:"sans-serif"}}),n&&R.jsxs(R.Fragment,{children:[R.jsx("graphics",{draw:g}),R.jsx("text",{text:n.length>80?n.slice(-80)+"…":n,y:-31,anchor:{x:.5,y:.5},style:{fontSize:8,fill:"#ffffff",fontFamily:"sans-serif",wordWrap:!0,wordWrapWidth:140}})]})]})}Q0({Container:br,Graphics:Aa,Text:$0});function e8({squadName:t,status:e,agents:n,textures:i,bubbles:r,animStates:s,originX:l,originY:c,roomWidth:d,roomHeight:p}){const m={x:0,y:0},g=dm(m,d,p),x=TC(m,d,p),v=G.useCallback(E=>{E.clear(),XL(E,d,p),JL(E,0,d,e);for(let A=0;A<n.length;A++){const C=Wd(A,m);KL(E,C.x-48,C.y-32)}ZL(E,g.x,g.y),$L(E,x.x,x.y),WL(E,d-60,44),Hw(E,10,p-50),Hw(E,d-40,50)},[n.length,e,d,p]);return R.jsxs("container",{x:l,y:c,children:[R.jsx("graphics",{draw:v}),R.jsx("text",{text:t,x:d/2,y:22,anchor:.5,style:{fontSize:14,fill:"#ffffff",fontFamily:"sans-serif",fontWeight:"bold"}}),n.map(E=>{const A=`${t}:${E.id}`,C=r[A],w=s[E.id];return w!=null&&w.isExternalTransit?null:R.jsx(t1,{agent:E,textures:i,bubbleText:(C==null?void 0:C.text)??null,animX:(w==null?void 0:w.x)??E.position.x,animY:(w==null?void 0:w.y)??E.position.y,animPose:(w==null?void 0:w.pose)??(E.status==="working"?"typing":"seated")},E.id)})]})}function t8(t,e,n,i,r){t.rect(e,n,i,r),t.fill(Sa.floor);const s=16,l=60;for(let V=0;V<Math.ceil(r/s);V++){const X=V%2*(l/2),ne=n+V*s;t.moveTo(e,ne),t.lineTo(e+i,ne),t.stroke({width:.5,color:4861984,alpha:.3});for(let q=0;q<Math.ceil(i/l)+1;q++){const Q=e+q*l-X;Q>e&&Q<e+i&&(t.moveTo(Q,ne),t.lineTo(Q,ne+s),t.stroke({width:.5,color:4861984,alpha:.2}))}}const c=30,d=i-c*2,p=r-c*2,m=e+c,g=n+c;t.roundRect(m+2,g+2,d,p,6),t.fill({color:0,alpha:.1}),t.roundRect(m,g,d,p,6),t.fill({color:Sa.carpet,alpha:.6}),t.roundRect(m+6,g+6,d-12,p-12,4),t.stroke({width:1.5,color:Sa.carpetBorder,alpha:.4}),t.roundRect(m+14,g+14,d-28,p-28,3),t.stroke({width:1,color:16766287,alpha:.15});const x=e+8,v=n+40,E=6,A=80;t.roundRect(x-2,v-2,E+4,A+4,2),t.fill(Sa.windowFrame),t.roundRect(x,v,E,A,1),t.fill(Sa.window),t.rect(x+1,v+4,2,A/3),t.fill({color:16777215,alpha:.2}),t.roundRect(x-4,v+A+2,E+8,3,1),t.fill(Sa.windowSill);const C=120,w=60,k=e+i/2-C/2,N=n+r/2-w/2-10;t.roundRect(k+3,N+3,C,w,4),t.fill({color:0,alpha:.12}),t.roundRect(k,N,C,w,4),t.fill(Sa.desk),t.roundRect(k+3,N+3,C-6,w-6,3),t.fill(Sa.deskTop),t.roundRect(k+1,N+1,C-2,w-2,4),t.stroke({width:1,color:Sa.deskEdge,alpha:.3}),t.roundRect(k+20,N+8,32,22,2),t.fill(2236976),t.roundRect(k+22,N+10,28,16,1),t.fill(1981020),t.roundRect(k+18,N+34,36,10,2),t.fill(3355456),t.rect(k+70,N+10,16,22),t.fill({color:16777215,alpha:.7}),t.rect(k+72,N+14,10,1),t.fill({color:3355443,alpha:.3}),t.rect(k+72,N+17,8,1),t.fill({color:3355443,alpha:.3}),t.roundRect(k+90,N+12,10,14,2),t.fill(3622735),t.circle(k+100,N+42,5),t.fill(14142664),t.circle(k+100,N+42,3),t.fill(7951688);const D=k+C/2,H=N+w+16;t.roundRect(D-14,H-4,28,16,6),t.fill(Sa.chair),t.roundRect(D-12,H-8,24,12,4),t.fill(Sa.chairSeat),t.roundRect(D-8,H-6,16,4,2),t.fill({color:16777215,alpha:.06}),t.circle(D,H+14,3),t.fill(4473924);for(const V of[-8,0,8])t.circle(D+V,H+18,1.5),t.fill(3355443);const z=e+i-54,F=n+20;t.roundRect(z,F,44,80,3),t.fill(Sa.bookshelf);const ee=[15022389,2001125,4431943,16750592,9315498,35195];for(let V=0;V<3;V++){const X=F+8+V*26;t.rect(z+3,X+18,38,3),t.fill(9139029);for(let ne=0;ne<5;ne++){const q=z+5+ne*7,Q=12+(ne*3+V*2)%6;t.rect(q,X+18-Q,5,Q),t.fill(ee[(ne+V*2)%ee.length])}}const P=e+i-54,I=n+r-60;t.roundRect(P,I+10,24,16,2),t.fill(6111287),t.rect(P+10,I+4,4,8),t.fill(7901340),t.circle(P+12,I,10),t.fill(Sa.globe),t.circle(P+12,I,10),t.stroke({width:.5,color:2001125,alpha:.4}),t.circle(P+9,I-3,3),t.fill({color:16777215,alpha:.15}),t.roundRect(k+44,N+38,36,10,2),t.fill(Sa.nameplate),t.roundRect(k+44,N+38,36,10,2),t.stroke({width:.5,color:13215744,alpha:.5}),t.rect(e,n,i,r),t.stroke({width:1,color:0,alpha:.08})}Q0({Container:br,Graphics:Aa,Text:$0});const jw=["Precisamos escalar o time de vendas...","O Q4 vai ser decisivo.","Investir mais em marketing digital.","Meta trimestral no caminho certo.","Revisar budget de R&D...","Nova parceria pode mudar tudo.","Churn rate precisa cair 20%.","Hora de expandir para LATAM.","Reunião com investidores amanhã.","NPS subiu 15 pontos!","Cultura da empresa vem primeiro.","Mais dados antes de decidir.","Vamos automatizar esse processo.","Roadmap do próximo quarter...","Reter talentos é prioridade.","Revenue cresceu 30% no trimestre.","Precisamos de mais diversidade no time.","O mercado está mudando rápido.","Foco no cliente sempre.","Inovação é nosso diferencial."],Uy=900,Pw=2400,n8=6e3,i8={id:"ceo",name:"CEO",colorIndex:3,status:"working",deskIndex:0,position:{x:0,y:0},targetPosition:null};function r8({x:t,y:e,width:n,height:i,textures:r,ticker:s}){const[l,c]=G.useState(null),[d,p]=G.useState("seated"),m=G.useRef(0),g=G.useRef(Uy+Math.floor(Math.random()*(Pw-Uy))),x=G.useRef(null),v=n/2,E=i/2+10,A=G.useCallback(C=>{C.clear(),t8(C,0,0,n,i)},[n,i]);return G.useEffect(()=>{if(!s)return;const C=()=>{m.current++;const w=m.current,k=Math.floor(w/48)%2===0?"typing":"seated";if(p(k),g.current--,g.current<=0){const N=jw[Math.floor(Math.random()*jw.length)];c(N),p("standing"),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{c(null)},n8),g.current=Uy+Math.floor(Math.random()*(Pw-Uy))}};return s.add(C),()=>{s.remove(C),x.current&&clearTimeout(x.current)}},[s]),R.jsxs("container",{x:t,y:e,children:[R.jsx("graphics",{draw:A}),R.jsx("text",{text:"CEO",x:n/2,y:12,anchor:.5,style:{fontSize:13,fill:"#ffd700",fontFamily:"sans-serif",fontWeight:"bold"}}),R.jsx(t1,{agent:i8,textures:r,bubbleText:l,animX:v,animY:E,animPose:d})]})}const Gx=150,a8=48,Fx=30,Iy=3,s8=4e3,Hy=600,qx=1800,l8=60,Gw=900,Fw=5e3,qw=[["Cafe novo?","Sim, colombiano!"],["Viu o deploy?","Passou nos testes!"],["Reuniao as 3?","Vou confirmar."],["Bug no login?","Ja corrigi."],["Almoco onde?","Sushi hoje?"],["PR aprovado?","Mergeei agora."],["Ta ocupado?","Pode falar."],["Deadline?","Sexta-feira."],["Novo feature?","Ficou muito bom!"],["Ajuda aqui?","Claro, mostra."],["Sprint review?","Amanha cedo."],["Stand-up?","Ja comecou!"],["Refatorei aquele modulo.","Ficou mais limpo."],["Testes passando?","Todos verdes!"],["Viu o Figma?","Design top!"],["Pipeline rodou?","Em 2 min."],["Code review?","Ja olhei, aprovo."],["Qual branch?","feature/office."],["Bom dia!","Bom dia! Tudo bem?"],["Feriado proximo?","Semana que vem!"]];function o8(t,e,n,i,r,s){const l={x:0,y:0},c=Math.random();if(c<.2){const d={x:r+t.x,y:s+t.y},p=hm(d,`squad-${i}`,"kitchen",n),m=DD(n);return{x:m.x,y:m.y,destination:"kitchen",waypoints:p,isExternal:!0}}else if(c<.35){const d={x:r+t.x,y:s+t.y},p=hm(d,`squad-${i}`,"rest-area",n),m=zD(n);return{x:m.x,y:m.y,destination:"restArea",waypoints:p,isExternal:!0}}else if(c<.45){const d=Math.random()<.5?"male":"female",p={x:r+t.x,y:s+t.y},m=d==="male"?"bathroom-male":"bathroom-female",g=hm(p,`squad-${i}`,m,n),x=OD(n,d);return{x:x.x,y:x.y,destination:m,waypoints:g,isExternal:!0}}else if(c<.6){const d=TC(l,e.width,e.height);return{x:d.x+(Math.random()-.5)*40,y:d.y+(Math.random()-.5)*30,destination:"meeting"}}else if(c<.75){const d=dm(l,e.width,e.height);return{x:d.x+(Math.random()-.5)*30,y:d.y+(Math.random()-.5)*20,destination:"coffee"}}else if(c<.9){const d={x:r+t.x,y:s+t.y},p=BD(n),m=[d,n.doorPoints[`squad-${i}`],p];return{x:p.x,y:p.y,destination:"corridor",waypoints:m,isExternal:!0}}else{const d=Math.floor(Math.random()*4),p=Wd(d,l,e.width,e.height);return{x:p.x+(Math.random()-.5)*40,y:p.y+(Math.random()-.5)*20,destination:"neighbor"}}}function c8(t){const[e,n]=G.useState({}),i=G.useRef({}),r=G.useRef({}),s=G.useRef({}),l=G.useRef({}),c=G.useRef(0),d=G.useRef({}),p=G.useRef({});G.useEffect(()=>{const g=ri.subscribe((x,v)=>{var C,w;const E=x.bubbles,A=v.bubbles;for(const k of Object.keys(E))if(((C=E[k])==null?void 0:C.updatedAt)!==((w=A[k])==null?void 0:w.updatedAt)){d.current[k]&&clearTimeout(d.current[k]);const[N,D]=k.split(":");d.current[k]=setTimeout(()=>{ri.getState().clearBubble(N,D),delete d.current[k]},s8)}});return()=>{g();for(const x of Object.values(d.current))clearTimeout(x);d.current={}}},[]);const m=G.useCallback(()=>{c.current++;const g=c.current,x=ri.getState(),v={},E=y0(x.rooms.length);for(const[A,C]of Object.entries(x.agentVisuals)){i.current[A]||(i.current[A]={}),r.current[A]||(r.current[A]={}),v[A]={};const w=x.rooms.indexOf(A),k=E.squadOrigins[w],N=(k==null?void 0:k.origin)??{x:0,y:0},D=[];for(const H of C){const z=i.current[A],F=r.current[A],ee=`${A}:${H.id}`;F[H.id]||(F[H.id]={x:H.position.x,y:H.position.y,baseY:H.position.y},s.current[ee]=Math.floor(Math.random()*qx));const P=F[H.id];if(H.targetPosition&&(!z[H.id]||z[H.id].progress>=1)){const V=z[H.id];if(V!=null&&V.isExternalTransit){const X=V.globalX??P.x+N.x,ne=V.globalY??P.y+N.y,q={x:X,y:ne},Q={x:H.targetPosition.x+N.x,y:H.targetPosition.y+N.y},B=l.current[ee],Y=B==="kitchen"?"kitchen":B==="restArea"?"rest-area":B==="bathroom-male"?"bathroom-male":B==="bathroom-female"?"bathroom-female":`squad-${w}`,Z=hm(q,Y,`squad-${w}`,E);Z[Z.length-1]=Q;const $=Z.shift(),j=Z.length>0?Z.shift():$,K=_y($,j);z[H.id]={startX:$.x,startY:$.y,targetX:j.x,targetY:j.y,progress:0,duration:Math.max(30,Math.ceil(K/Iy)),baseY:H.targetPosition.y,waypointQueue:Z,isExternalTransit:!0,globalX:X,globalY:ne}}else z[H.id]={startX:P.x,startY:P.baseY,targetX:H.targetPosition.x,targetY:H.targetPosition.y,progress:0,duration:Gx,baseY:H.targetPosition.y,waypointQueue:[],isExternalTransit:!1}}if(H.status==="idle"&&(!z[H.id]||z[H.id].progress>=1)){const V=z[H.id];if(V!=null&&V.isExternalTransit&&V.waypointQueue.length===0&&V.progress>=1&&(V.globalX!==void 0&&V.globalY!==void 0&&(P.x=V.globalX-N.x,P.y=V.globalY-N.y,P.baseY=P.y),V.isExternalTransit=!1,V.globalX=void 0,V.globalY=void 0),s.current[ee]===void 0&&(s.current[ee]=Hy+Math.floor(Math.random()*(qx-Hy))),s.current[ee]--,s.current[ee]<=0){const X=z[H.id];if(X!=null&&X.isExternalTransit){const ne=X.globalX??P.x+N.x,q=X.globalY??P.y+N.y,Q={x:ne,y:q},B=Wd(H.deskIndex,{x:0,y:0}),Y={x:B.x+N.x,y:B.y+N.y},Z=l.current[ee],$=Z==="kitchen"?"kitchen":Z==="restArea"?"rest-area":Z==="bathroom-male"?"bathroom-male":Z==="bathroom-female"?"bathroom-female":`squad-${w}`,j=hm(Q,$,`squad-${w}`,E);j[j.length-1]=Y;const K=j.shift(),te=j.length>0?j.shift():K,U=_y(K,te);l.current[ee]="neighbor",z[H.id]={startX:K.x,startY:K.y,targetX:te.x,targetY:te.y,progress:0,duration:Math.max(30,Math.ceil(U/Iy)),baseY:B.y,waypointQueue:j,isExternalTransit:!0,globalX:ne,globalY:q}}else{const q=o8(N,k??{width:Zo,height:Wa},E,w,P.x,P.baseY);if(l.current[ee]=q.destination,q.isExternal&&q.waypoints&&q.waypoints.length>1){const Q=[...q.waypoints],B=Q.shift(),Y=Q.length>0?Q.shift():B,Z=_y(B,Y);z[H.id]={startX:B.x,startY:B.y,targetX:Y.x,targetY:Y.y,progress:0,duration:Math.max(30,Math.ceil(Z/Iy)),baseY:q.y-N.y,waypointQueue:Q,isExternalTransit:!0,globalX:B.x,globalY:B.y}}else z[H.id]={startX:P.x,startY:P.baseY,targetX:q.x,targetY:q.y,progress:0,duration:Gx+Math.floor(Math.random()*30),baseY:q.y,waypointQueue:[],isExternalTransit:!1}}s.current[ee]=Hy+Math.floor(Math.random()*(qx-Hy))}}const I=z[H.id];if(I&&I.progress<1){I.progress=Math.min(1,I.progress+1/I.duration);const V=ND(I.progress);if(I.isExternalTransit){const X=vy(I.startX,I.targetX,V),ne=vy(I.startY,I.targetY,V);I.globalX=X,I.globalY=ne,P.x=X-N.x,P.y=ne-N.y;const q=Math.floor(g/Fx)%2===0?"walk-right":"walk-left";v[A][H.id]={x:P.x,y:P.y,pose:q,isExternalTransit:!0,globalX:X,globalY:ne}}else{P.x=vy(I.startX,I.targetX,V),P.y=vy(I.startY,I.targetY,V),P.baseY=I.baseY;const X=Math.floor(g/Fx)%2===0?"walk-right":"walk-left";v[A][H.id]={x:P.x,y:P.y,pose:X}}}else if(I&&I.progress>=1&&I.waypointQueue.length>0){const V=I.waypointQueue.shift(),X={x:I.targetX,y:I.targetY},ne=_y(X,V);I.startX=I.targetX,I.startY=I.targetY,I.targetX=V.x,I.targetY=V.y,I.progress=0,I.duration=I.isExternalTransit?Math.max(30,Math.ceil(ne/Iy)):Gx,I.isExternalTransit&&(I.globalX=I.startX,I.globalY=I.startY);const q=Math.floor(g/Fx)%2===0?"walk-right":"walk-left";I.isExternalTransit?v[A][H.id]={x:P.x,y:P.y,pose:q,isExternalTransit:!0,globalX:I.startX,globalY:I.startY}:v[A][H.id]={x:P.x,y:P.y,pose:q}}else if(H.status==="working"){const V=Math.floor(g/a8)%2===0?"typing":"seated";v[A][H.id]={x:P.x,y:P.baseY,pose:V}}else if(H.status==="idle"){const V=l.current[ee]??"coffee",X=z[H.id];if((X==null?void 0:X.isExternalTransit)??!1)v[A][H.id]={x:P.x,y:P.y,pose:"standing",isExternalTransit:!0,globalX:(X==null?void 0:X.globalX)??P.x+N.x,globalY:(X==null?void 0:X.globalY)??P.y+N.y};else{const q=Math.sin(g*.07+H.deskIndex*1.5)*2;let Q;V==="coffee"||V==="kitchen"?Q="coffee":V==="meeting"||V==="neighbor"?Q=Math.floor(g/90)%2===0?"standing":"coffee":V==="restArea"?Q="seated":(V.startsWith("bathroom"),Q="standing"),v[A][H.id]={x:P.x,y:P.baseY+q,pose:Q},D.push({agentKey:ee,agentId:H.id,agentName:H.name,x:P.x,y:P.baseY})}}else H.status==="checkpoint"?v[A][H.id]={x:P.x,y:P.baseY,pose:"seated"}:v[A][H.id]={x:P.x,y:P.baseY,pose:"seated"}}if(g%60===0&&D.length>=2)for(let H=0;H<D.length;H++){const z=D[H];if(!(p.current[z.agentKey]&&g-p.current[z.agentKey]<Gw)&&!x.bubbles[z.agentKey])for(let F=H+1;F<D.length;F++){const ee=D[F];if(p.current[ee.agentKey]&&g-p.current[ee.agentKey]<Gw||x.bubbles[ee.agentKey])continue;const P=z.x-ee.x,I=z.y-ee.y;if(Math.sqrt(P*P+I*I)<l8){const[X,ne]=qw[Math.floor(Math.random()*qw.length)];x.appendBubble(A,z.agentId,X),setTimeout(()=>{ri.getState().appendBubble(A,ee.agentId,ne)},1500),p.current[z.agentKey]=g,p.current[ee.agentKey]=g;const q=`${A}:${z.agentId}`,Q=`${A}:${ee.agentId}`;d.current[q]&&clearTimeout(d.current[q]),d.current[Q]&&clearTimeout(d.current[Q]),d.current[q]=setTimeout(()=>{ri.getState().clearBubble(A,z.agentId),delete d.current[q]},Fw),d.current[Q]=setTimeout(()=>{ri.getState().clearBubble(A,ee.agentId),delete d.current[Q]},Fw+1500);break}}}}n(v)},[]);return G.useEffect(()=>{if(t)return t.add(m),()=>{t.remove(m)}},[t,m]),e}Q0({Container:br,Graphics:Aa,Text:$0});const u8=.3,f8=2;function d8(){const{app:t}=IL(),e=G.useRef(null),[n,i]=G.useState(new Map),r=G.useRef(null),s=ri(x=>x.rooms),l=ri(x=>x.agentVisuals),c=ri(x=>x.bubbles),d=Ta(x=>x.activeStates),p=c8((t==null?void 0:t.ticker)??null),m=G.useMemo(()=>y0(s.length),[s.length]);G.useEffect(()=>{t!=null&&t.renderer&&i(GL(t))},[t]);const g=G.useCallback(x=>{x.clear(),qL(x,m),Iw(x,m.bathroomMale.x,m.bathroomMale.y,m.bathroomMale.width,m.bathroomMale.height,"male"),Iw(x,m.bathroomFemale.x,m.bathroomFemale.y,m.bathroomFemale.width,m.bathroomFemale.height,"female"),YL(x,m.kitchen.x,m.kitchen.y,m.kitchen.width,m.kitchen.height),VL(x,m.restArea.x,m.restArea.y,m.restArea.width,m.restArea.height)},[m]);return G.useEffect(()=>{const x=t==null?void 0:t.canvas;if(!x)return;const v=w=>{const k=e.current;k&&(r.current={startX:w.clientX,startY:w.clientY,pivotX:k.position.x,pivotY:k.position.y},x.setPointerCapture(w.pointerId))},E=w=>{const k=e.current,N=r.current;!k||!N||(k.position.x=N.pivotX+(w.clientX-N.startX),k.position.y=N.pivotY+(w.clientY-N.startY))},A=w=>{r.current=null,x.releasePointerCapture(w.pointerId)},C=w=>{w.preventDefault();const k=e.current;if(!k)return;const N=k.scale.x,D=w.deltaY>0?.9:1.1,H=Math.max(u8,Math.min(f8,N*D)),z=x.getBoundingClientRect(),F=w.clientX-z.left,ee=w.clientY-z.top,P=H/N;k.position.x=F-(F-k.position.x)*P,k.position.y=ee-(ee-k.position.y)*P,k.scale.set(H)};return x.addEventListener("pointerdown",v),x.addEventListener("pointermove",E),x.addEventListener("pointerup",A),x.addEventListener("pointerleave",A),x.addEventListener("wheel",C,{passive:!1}),()=>{x.removeEventListener("pointerdown",v),x.removeEventListener("pointermove",E),x.removeEventListener("pointerup",A),x.removeEventListener("pointerleave",A),x.removeEventListener("wheel",C)}},[t]),R.jsxs("container",{ref:e,children:[R.jsx("graphics",{draw:g}),m.corridorV.height>0&&R.jsx("text",{text:"Corredor",x:m.corridorV.x+m.corridorV.width/2,y:m.corridorV.y+8,anchor:{x:.5,y:0},style:{fontSize:11,fill:"#666666",fontFamily:"sans-serif",fontWeight:"bold"}}),R.jsx("text",{text:"Corredor",x:m.corridorH.x+m.corridorH.width/2,y:m.corridorH.y+8,anchor:{x:.5,y:0},style:{fontSize:11,fill:"#666666",fontFamily:"sans-serif",fontWeight:"bold"}}),R.jsx("text",{text:"WC ♂",x:m.bathroomMale.x+m.bathroomMale.width/2,y:m.bathroomMale.y+m.bathroomMale.height-8,anchor:{x:.5,y:1},style:{fontSize:10,fill:"#546e7a",fontFamily:"sans-serif",fontWeight:"bold"}}),R.jsx("text",{text:"WC ♀",x:m.bathroomFemale.x+m.bathroomFemale.width/2,y:m.bathroomFemale.y+m.bathroomFemale.height-8,anchor:{x:.5,y:1},style:{fontSize:10,fill:"#546e7a",fontFamily:"sans-serif",fontWeight:"bold"}}),R.jsx("text",{text:"Cozinha",x:m.kitchen.x+m.kitchen.width/2,y:m.kitchen.y+12,anchor:{x:.5,y:0},style:{fontSize:10,fill:"#795548",fontFamily:"sans-serif",fontWeight:"bold"}}),R.jsx("text",{text:"Descanso",x:m.restArea.x+m.restArea.width/2,y:m.restArea.y+12,anchor:{x:.5,y:0},style:{fontSize:10,fill:"#546e7a",fontFamily:"sans-serif",fontWeight:"bold"}}),s.map((x,v)=>{var k;const E=m.squadOrigins[v];if(!E)return null;const A=l[x]??[],C=((k=d[x])==null?void 0:k.status)??"idle",w=p[x]??{};return R.jsx(e8,{squadName:x,status:C,agents:A,textures:n,bubbles:c,animStates:w,originX:E.origin.x,originY:E.origin.y,roomWidth:E.width,roomHeight:E.height},x)}),s.map((x,v)=>{const E=l[x]??[],A=p[x]??{};return E.filter(C=>{const w=A[C.id];return(w==null?void 0:w.isExternalTransit)&&w.globalX!==void 0&&w.globalY!==void 0}).map(C=>{const w=A[C.id],k=`${x}:${C.id}`,N=c[k];return R.jsx(t1,{agent:C,textures:n,bubbleText:(N==null?void 0:N.text)??null,animX:w.globalX,animY:w.globalY,animPose:w.pose},`transit-${C.id}`)})}),R.jsx(r8,{x:m.ceoOffice.x,y:m.ceoOffice.y,width:m.ceoOffice.width,height:m.ceoOffice.height,textures:n,ticker:(t==null?void 0:t.ticker)??null})]})}function h8(){const t=ri(i=>i.activeRoom),e=ri(i=>i.checkpoints),n=t?e[t]:void 0;return R.jsx("div",{style:{display:"flex",height:"100%"},children:R.jsxs("div",{style:{flex:1,position:"relative",overflow:"hidden"},children:[R.jsx(UL,{background:13158600,antialias:!0,resizeTo:window,style:{width:"100%",height:"100%"},children:R.jsx(d8,{})}),n&&R.jsx(HL,{agentName:n.agentName,question:n.question,onRespond:i=>ED(t,i)})]})})}function p8(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const m8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,g8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,y8={};function Yw(t,e){return(y8.jsx?g8:m8).test(t)}const b8=/[ \t\n\f\r]/g;function x8(t){return typeof t=="object"?t.type==="text"?Vw(t.value):!1:Vw(t)}function Vw(t){return t.replace(b8,"")===""}class Vm{constructor(e,n,i){this.normal=n,this.property=e,i&&(this.space=i)}}Vm.prototype.normal={};Vm.prototype.property={};Vm.prototype.space=void 0;function pM(t,e){const n={},i={};for(const r of t)Object.assign(n,r.property),Object.assign(i,r.normal);return new Vm(n,i,e)}function t_(t){return t.toLowerCase()}class Ra{constructor(e,n){this.attribute=n,this.property=e}}Ra.prototype.attribute="";Ra.prototype.booleanish=!1;Ra.prototype.boolean=!1;Ra.prototype.commaOrSpaceSeparated=!1;Ra.prototype.commaSeparated=!1;Ra.prototype.defined=!1;Ra.prototype.mustUseProperty=!1;Ra.prototype.number=!1;Ra.prototype.overloadedBoolean=!1;Ra.prototype.property="";Ra.prototype.spaceSeparated=!1;Ra.prototype.space=void 0;let v8=0;const Ct=wf(),ki=wf(),n_=wf(),Oe=wf(),In=wf(),Zd=wf(),$a=wf();function wf(){return 2**++v8}const i_=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ct,booleanish:ki,commaOrSpaceSeparated:$a,commaSeparated:Zd,number:Oe,overloadedBoolean:n_,spaceSeparated:In},Symbol.toStringTag,{value:"Module"})),Yx=Object.keys(i_);class n1 extends Ra{constructor(e,n,i,r){let s=-1;if(super(e,n),Xw(this,"space",r),typeof i=="number")for(;++s<Yx.length;){const l=Yx[s];Xw(this,Yx[s],(i&i_[l])===i_[l])}}}n1.prototype.defined=!0;function Xw(t,e,n){n&&(t[e]=n)}function bh(t){const e={},n={};for(const[i,r]of Object.entries(t.properties)){const s=new n1(i,t.transform(t.attributes||{},i),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),e[i]=s,n[t_(i)]=i,n[t_(s.attribute)]=i}return new Vm(e,n,t.space)}const mM=bh({properties:{ariaActiveDescendant:null,ariaAtomic:ki,ariaAutoComplete:null,ariaBusy:ki,ariaChecked:ki,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:In,ariaCurrent:null,ariaDescribedBy:In,ariaDetails:null,ariaDisabled:ki,ariaDropEffect:In,ariaErrorMessage:null,ariaExpanded:ki,ariaFlowTo:In,ariaGrabbed:ki,ariaHasPopup:null,ariaHidden:ki,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:In,ariaLevel:Oe,ariaLive:null,ariaModal:ki,ariaMultiLine:ki,ariaMultiSelectable:ki,ariaOrientation:null,ariaOwns:In,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:ki,ariaReadOnly:ki,ariaRelevant:null,ariaRequired:ki,ariaRoleDescription:In,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:ki,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function gM(t,e){return e in t?t[e]:e}function yM(t,e){return gM(t,e.toLowerCase())}const _8=bh({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zd,acceptCharset:In,accessKey:In,action:null,allow:null,allowFullScreen:Ct,allowPaymentRequest:Ct,allowUserMedia:Ct,alt:null,as:null,async:Ct,autoCapitalize:null,autoComplete:In,autoFocus:Ct,autoPlay:Ct,blocking:In,capture:null,charSet:null,checked:Ct,cite:null,className:In,cols:Oe,colSpan:null,content:null,contentEditable:ki,controls:Ct,controlsList:In,coords:Oe|Zd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ct,defer:Ct,dir:null,dirName:null,disabled:Ct,download:n_,draggable:ki,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ct,formTarget:null,headers:In,height:Oe,hidden:n_,high:Oe,href:null,hrefLang:null,htmlFor:In,httpEquiv:In,id:null,imageSizes:null,imageSrcSet:null,inert:Ct,inputMode:null,integrity:null,is:null,isMap:Ct,itemId:null,itemProp:In,itemRef:In,itemScope:Ct,itemType:In,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ct,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:Ct,muted:Ct,name:null,nonce:null,noModule:Ct,noValidate:Ct,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ct,optimum:Oe,pattern:null,ping:In,placeholder:null,playsInline:Ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ct,referrerPolicy:null,rel:In,required:Ct,reversed:Ct,rows:Oe,rowSpan:Oe,sandbox:In,scope:null,scoped:Ct,seamless:Ct,selected:Ct,shadowRootClonable:Ct,shadowRootDelegatesFocus:Ct,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:ki,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:Ct,useMap:null,value:ki,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:In,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ct,declare:Ct,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:Ct,noHref:Ct,noShade:Ct,noWrap:Ct,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:ki,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ct,disableRemotePlayback:Ct,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:yM}),S8=bh({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:$a,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:In,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:Ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Zd,g2:Zd,glyphName:Zd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:$a,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Oe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:In,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$a,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$a,rev:$a,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$a,requiredFeatures:$a,requiredFonts:$a,requiredFormats:$a,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:$a,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$a,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:$a,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:gM}),bM=bh({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),xM=bh({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:yM}),vM=bh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),E8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},w8=/[A-Z]/g,Kw=/-[a-z]/g,T8=/^data[-\w.:]+$/i;function C8(t,e){const n=t_(e);let i=e,r=Ra;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&T8.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(Kw,M8);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!Kw.test(s)){let l=s.replace(w8,A8);l.charAt(0)!=="-"&&(l="-"+l),e="data"+l}}r=n1}return new r(i,e)}function A8(t){return"-"+t.toLowerCase()}function M8(t){return t.charAt(1).toUpperCase()}const N8=pM([mM,_8,bM,xM,vM],"html"),i1=pM([mM,S8,bM,xM,vM],"svg");function R8(t){return t.join(" ").trim()}var zd={},Vx,Ww;function k8(){if(Ww)return Vx;Ww=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
345
- `,p="/",m="*",g="",x="comment",v="declaration";function E(C,w){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];w=w||{};var k=1,N=1;function D(q){var Q=q.match(e);Q&&(k+=Q.length);var B=q.lastIndexOf(d);N=~B?q.length-B:N+q.length}function H(){var q={line:k,column:N};return function(Q){return Q.position=new z(q),P(),Q}}function z(q){this.start=q,this.end={line:k,column:N},this.source=w.source}z.prototype.content=C;function F(q){var Q=new Error(w.source+":"+k+":"+N+": "+q);if(Q.reason=q,Q.filename=w.source,Q.line=k,Q.column=N,Q.source=C,!w.silent)throw Q}function ee(q){var Q=q.exec(C);if(Q){var B=Q[0];return D(B),C=C.slice(B.length),Q}}function P(){ee(n)}function I(q){var Q;for(q=q||[];Q=V();)Q!==!1&&q.push(Q);return q}function V(){var q=H();if(!(p!=C.charAt(0)||m!=C.charAt(1))){for(var Q=2;g!=C.charAt(Q)&&(m!=C.charAt(Q)||p!=C.charAt(Q+1));)++Q;if(Q+=2,g===C.charAt(Q-1))return F("End of comment missing");var B=C.slice(2,Q-2);return N+=2,D(B),C=C.slice(Q),N+=2,q({type:x,comment:B})}}function X(){var q=H(),Q=ee(i);if(Q){if(V(),!ee(r))return F("property missing ':'");var B=ee(s),Y=q({type:v,property:A(Q[0].replace(t,g)),value:B?A(B[0].replace(t,g)):g});return ee(l),Y}}function ne(){var q=[];I(q);for(var Q;Q=X();)Q!==!1&&(q.push(Q),I(q));return q}return P(),ne()}function A(C){return C?C.replace(c,g):g}return Vx=E,Vx}var Zw;function O8(){if(Zw)return zd;Zw=1;var t=zd&&zd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(zd,"__esModule",{value:!0}),zd.default=n;const e=t(k8());function n(i,r){let s=null;if(!i||typeof i!="string")return s;const l=(0,e.default)(i),c=typeof r=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:p,value:m}=d;c?r(p,m,d):m&&(s=s||{},s[p]=m)}),s}return zd}var Jp={},$w;function D8(){if($w)return Jp;$w=1,Object.defineProperty(Jp,"__esModule",{value:!0}),Jp.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,s=function(p){return!p||n.test(p)||t.test(p)},l=function(p,m){return m.toUpperCase()},c=function(p,m){return"".concat(m,"-")},d=function(p,m){return m===void 0&&(m={}),s(p)?p:(p=p.toLowerCase(),m.reactCompat?p=p.replace(r,c):p=p.replace(i,c),p.replace(e,l))};return Jp.camelCase=d,Jp}var em,Qw;function z8(){if(Qw)return em;Qw=1;var t=em&&em.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},e=t(O8()),n=D8();function i(r,s){var l={};return!r||typeof r!="string"||(0,e.default)(r,function(c,d){c&&d&&(l[(0,n.camelCase)(c,s)]=d)}),l}return i.default=i,em=i,em}var B8=z8();const L8=lu(B8),_M=SM("end"),r1=SM("start");function SM(t){return e;function e(n){const i=n&&n.position&&n.position[t]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function U8(t){const e=r1(t),n=_M(t);if(e&&n)return{start:e,end:n}}function bm(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Jw(t.position):"start"in t||"end"in t?Jw(t):"line"in t||"column"in t?r_(t):""}function r_(t){return e2(t&&t.line)+":"+e2(t&&t.column)}function Jw(t){return r_(t&&t.start)+"-"+r_(t&&t.end)}function e2(t){return t&&typeof t=="number"?t:1}class Br extends Error{constructor(e,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},l=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?r=e:!s.cause&&e&&(l=!0,r=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof i=="string"){const d=i.indexOf(":");d===-1?s.ruleId=i:(s.source=i.slice(0,d),s.ruleId=i.slice(d+1))}if(!s.place&&s.ancestors&&s.ancestors){const d=s.ancestors[s.ancestors.length-1];d&&(s.place=d.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=c?c.line:void 0,this.name=bm(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Br.prototype.file="";Br.prototype.name="";Br.prototype.reason="";Br.prototype.message="";Br.prototype.stack="";Br.prototype.column=void 0;Br.prototype.line=void 0;Br.prototype.ancestors=void 0;Br.prototype.cause=void 0;Br.prototype.fatal=void 0;Br.prototype.place=void 0;Br.prototype.ruleId=void 0;Br.prototype.source=void 0;const a1={}.hasOwnProperty,I8=new Map,H8=/[A-Z]/g,j8=new Set(["table","tbody","thead","tfoot","tr"]),P8=new Set(["td","th"]),EM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function G8(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let i;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Z8(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=W8(n,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:i,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?i1:N8,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=wM(r,t,void 0);return s&&typeof s!="string"?s:r.create(t,r.Fragment,{children:s||void 0},void 0)}function wM(t,e,n){if(e.type==="element")return F8(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return q8(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return V8(t,e,n);if(e.type==="mdxjsEsm")return Y8(t,e);if(e.type==="root")return X8(t,e,n);if(e.type==="text")return K8(t,e)}function F8(t,e,n){const i=t.schema;let r=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=i1,t.schema=r),t.ancestors.push(e);const s=CM(t,e.tagName,!1),l=$8(t,e);let c=l1(t,e);return j8.has(e.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!x8(d):!0})),TM(t,l,s,e),s1(l,c),t.ancestors.pop(),t.schema=i,t.create(e,s,l,n)}function q8(t,e){if(e.data&&e.data.estree&&t.evaluater){const i=e.data.estree.body[0];return i.type,t.evaluater.evaluateExpression(i.expression)}Rm(t,e.position)}function Y8(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Rm(t,e.position)}function V8(t,e,n){const i=t.schema;let r=i;e.name==="svg"&&i.space==="html"&&(r=i1,t.schema=r),t.ancestors.push(e);const s=e.name===null?t.Fragment:CM(t,e.name,!0),l=Q8(t,e),c=l1(t,e);return TM(t,l,s,e),s1(l,c),t.ancestors.pop(),t.schema=i,t.create(e,s,l,n)}function X8(t,e,n){const i={};return s1(i,l1(t,e)),t.create(e,t.Fragment,i,n)}function K8(t,e){return e.value}function TM(t,e,n,i){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=i)}function s1(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function W8(t,e,n){return i;function i(r,s,l,c){const p=Array.isArray(l.children)?n:e;return c?p(s,l,c):p(s,l)}}function Z8(t,e){return n;function n(i,r,s,l){const c=Array.isArray(s.children),d=r1(i);return e(r,s,l,c,{columnNumber:d?d.column-1:void 0,fileName:t,lineNumber:d?d.line:void 0},void 0)}}function $8(t,e){const n={};let i,r;for(r in e.properties)if(r!=="children"&&a1.call(e.properties,r)){const s=J8(t,r,e.properties[r]);if(s){const[l,c]=s;t.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&P8.has(e.tagName)?i=c:n[l]=c}}if(i){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Q8(t,e){const n={};for(const i of e.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&t.evaluater){const s=i.data.estree.body[0];s.type;const l=s.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,t.evaluater.evaluateExpression(c.argument))}else Rm(t,e.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&t.evaluater){const c=i.value.data.estree.body[0];c.type,s=t.evaluater.evaluateExpression(c.expression)}else Rm(t,e.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function l1(t,e){const n=[];let i=-1;const r=t.passKeys?new Map:I8;for(;++i<e.children.length;){const s=e.children[i];let l;if(t.passKeys){const d=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(d){const p=r.get(d)||0;l=d+"-"+p,r.set(d,p+1)}}const c=wM(t,s,l);c!==void 0&&n.push(c)}return n}function J8(t,e,n){const i=C8(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?p8(n):R8(n)),i.property==="style"){let r=typeof n=="object"?n:eU(t,String(n));return t.stylePropertyNameCase==="css"&&(r=tU(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&i.space?E8[i.property]||i.property:i.attribute,n]}}function eU(t,e){try{return L8(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const i=n,r=new Br("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=EM+"#cannot-parse-style-attribute",r}}function CM(t,e,n){let i;if(!n)i={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let s=-1,l;for(;++s<r.length;){const c=Yw(r[s])?{type:"Identifier",name:r[s]}:{type:"Literal",value:r[s]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}i=l}else i=Yw(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(i.type==="Literal"){const r=i.value;return a1.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(i);Rm(t)}function Rm(t,e){const n=new Br("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=EM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function tU(t){const e={};let n;for(n in t)a1.call(t,n)&&(e[nU(n)]=t[n]);return e}function nU(t){let e=t.replace(H8,iU);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function iU(t){return"-"+t.toLowerCase()}const Xx={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},rU={};function o1(t,e){const n=rU,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return AM(t,i,r)}function AM(t,e,n){if(aU(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return t2(t.children,e,n)}return Array.isArray(t)?t2(t,e,n):""}function t2(t,e,n){const i=[];let r=-1;for(;++r<t.length;)i[r]=AM(t[r],e,n);return i.join("")}function aU(t){return!!(t&&typeof t=="object")}const n2=document.createElement("i");function c1(t){const e="&"+t+";";n2.innerHTML=e;const n=n2.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function es(t,e,n,i){const r=t.length;let s=0,l;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,n=n>0?n:0,i.length<1e4)l=Array.from(i),l.unshift(e,n),t.splice(...l);else for(n&&t.splice(e,n);s<i.length;)l=i.slice(s,s+1e4),l.unshift(e,0),t.splice(...l),s+=1e4,e+=1e4}function Rs(t,e){return t.length>0?(es(t,t.length,0,e),t):e}const i2={}.hasOwnProperty;function MM(t){const e={};let n=-1;for(;++n<t.length;)sU(e,t[n]);return e}function sU(t,e){let n;for(n in e){const r=(i2.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let l;if(s)for(l in s){i2.call(r,l)||(r[l]=[]);const c=s[l];lU(r[l],Array.isArray(c)?c:c?[c]:[])}}}function lU(t,e){let n=-1;const i=[];for(;++n<e.length;)(e[n].add==="after"?t:i).push(e[n]);es(t,0,0,i)}function NM(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function gl(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const la=ou(/[A-Za-z]/),zr=ou(/[\dA-Za-z]/),oU=ou(/[#-'*+\--9=?A-Z^-~]/);function T0(t){return t!==null&&(t<32||t===127)}const a_=ou(/\d/),cU=ou(/[\dA-Fa-f]/),uU=ou(/[!-/:-@[-`{-~]/);function st(t){return t!==null&&t<-2}function Dn(t){return t!==null&&(t<0||t===32)}function Lt(t){return t===-2||t===-1||t===32}const J0=ou(new RegExp("\\p{P}|\\p{S}","u")),yf=ou(/\s/);function ou(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function xh(t){const e=[];let n=-1,i=0,r=0;for(;++n<t.length;){const s=t.charCodeAt(n);let l="";if(s===37&&zr(t.charCodeAt(n+1))&&zr(t.charCodeAt(n+2)))r=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const c=t.charCodeAt(n+1);s<56320&&c>56319&&c<57344?(l=String.fromCharCode(s,c),r=1):l="�"}else l=String.fromCharCode(s);l&&(e.push(t.slice(i,n),encodeURIComponent(l)),i=n+r+1,l=""),r&&(n+=r,r=0)}return e.join("")+t.slice(i)}function Kt(t,e,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(d){return Lt(d)?(t.enter(n),c(d)):e(d)}function c(d){return Lt(d)&&s++<r?(t.consume(d),c):(t.exit(n),e(d))}}const fU={tokenize:dU};function dU(t){const e=t.attempt(this.parser.constructs.contentInitial,i,r);let n;return e;function i(c){if(c===null){t.consume(c);return}return t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),Kt(t,e,"linePrefix")}function r(c){return t.enter("paragraph"),s(c)}function s(c){const d=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(c);return}return st(c)?(t.consume(c),t.exit("chunkText"),s):(t.consume(c),l)}}const hU={tokenize:pU},r2={tokenize:mU};function pU(t){const e=this,n=[];let i=0,r,s,l;return c;function c(N){if(i<n.length){const D=n[i];return e.containerState=D[1],t.attempt(D[0].continuation,d,p)(N)}return p(N)}function d(N){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&k();const D=e.events.length;let H=D,z;for(;H--;)if(e.events[H][0]==="exit"&&e.events[H][1].type==="chunkFlow"){z=e.events[H][1].end;break}w(i);let F=D;for(;F<e.events.length;)e.events[F][1].end={...z},F++;return es(e.events,H+1,0,e.events.slice(D)),e.events.length=F,p(N)}return c(N)}function p(N){if(i===n.length){if(!r)return x(N);if(r.currentConstruct&&r.currentConstruct.concrete)return E(N);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(r2,m,g)(N)}function m(N){return r&&k(),w(i),x(N)}function g(N){return e.parser.lazy[e.now().line]=i!==n.length,l=e.now().offset,E(N)}function x(N){return e.containerState={},t.attempt(r2,v,E)(N)}function v(N){return i++,n.push([e.currentConstruct,e.containerState]),x(N)}function E(N){if(N===null){r&&k(),w(0),t.consume(N);return}return r=r||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:s}),A(N)}function A(N){if(N===null){C(t.exit("chunkFlow"),!0),w(0),t.consume(N);return}return st(N)?(t.consume(N),C(t.exit("chunkFlow")),i=0,e.interrupt=void 0,c):(t.consume(N),A)}function C(N,D){const H=e.sliceStream(N);if(D&&H.push(null),N.previous=s,s&&(s.next=N),s=N,r.defineSkip(N.start),r.write(H),e.parser.lazy[N.start.line]){let z=r.events.length;for(;z--;)if(r.events[z][1].start.offset<l&&(!r.events[z][1].end||r.events[z][1].end.offset>l))return;const F=e.events.length;let ee=F,P,I;for(;ee--;)if(e.events[ee][0]==="exit"&&e.events[ee][1].type==="chunkFlow"){if(P){I=e.events[ee][1].end;break}P=!0}for(w(i),z=F;z<e.events.length;)e.events[z][1].end={...I},z++;es(e.events,ee+1,0,e.events.slice(F)),e.events.length=z}}function w(N){let D=n.length;for(;D-- >N;){const H=n[D];e.containerState=H[1],H[0].exit.call(e,t)}n.length=N}function k(){r.write([null]),s=void 0,r=void 0,e.containerState._closeFlow=void 0}}function mU(t,e,n){return Kt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function sh(t){if(t===null||Dn(t)||yf(t))return 1;if(J0(t))return 2}function eb(t,e,n){const i=[];let r=-1;for(;++r<t.length;){const s=t[r].resolveAll;s&&!i.includes(s)&&(e=s(e,n),i.push(s))}return e}const s_={name:"attention",resolveAll:gU,tokenize:yU};function gU(t,e){let n=-1,i,r,s,l,c,d,p,m;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(i=n;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&e.sliceSerialize(t[i][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[i][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;d=t[i][1].end.offset-t[i][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const g={...t[i][1].end},x={...t[n][1].start};a2(g,-d),a2(x,d),l={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...t[i][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:x},s={type:d>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[n][1].start}},r={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},t[i][1].end={...l.start},t[n][1].start={...c.end},p=[],t[i][1].end.offset-t[i][1].start.offset&&(p=Rs(p,[["enter",t[i][1],e],["exit",t[i][1],e]])),p=Rs(p,[["enter",r,e],["enter",l,e],["exit",l,e],["enter",s,e]]),p=Rs(p,eb(e.parser.constructs.insideSpan.null,t.slice(i+1,n),e)),p=Rs(p,[["exit",s,e],["enter",c,e],["exit",c,e],["exit",r,e]]),t[n][1].end.offset-t[n][1].start.offset?(m=2,p=Rs(p,[["enter",t[n][1],e],["exit",t[n][1],e]])):m=0,es(t,i-1,n-i+3,p),n=i+p.length-m-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function yU(t,e){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=sh(i);let s;return l;function l(d){return s=d,t.enter("attentionSequence"),c(d)}function c(d){if(d===s)return t.consume(d),c;const p=t.exit("attentionSequence"),m=sh(d),g=!m||m===2&&r||n.includes(d),x=!r||r===2&&m||n.includes(i);return p._open=!!(s===42?g:g&&(r||!x)),p._close=!!(s===42?x:x&&(m||!g)),e(d)}}function a2(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const bU={name:"autolink",tokenize:xU};function xU(t,e,n){let i=0;return r;function r(v){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(v),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(v){return la(v)?(t.consume(v),l):v===64?n(v):p(v)}function l(v){return v===43||v===45||v===46||zr(v)?(i=1,c(v)):p(v)}function c(v){return v===58?(t.consume(v),i=0,d):(v===43||v===45||v===46||zr(v))&&i++<32?(t.consume(v),c):(i=0,p(v))}function d(v){return v===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(v),t.exit("autolinkMarker"),t.exit("autolink"),e):v===null||v===32||v===60||T0(v)?n(v):(t.consume(v),d)}function p(v){return v===64?(t.consume(v),m):oU(v)?(t.consume(v),p):n(v)}function m(v){return zr(v)?g(v):n(v)}function g(v){return v===46?(t.consume(v),i=0,m):v===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(v),t.exit("autolinkMarker"),t.exit("autolink"),e):x(v)}function x(v){if((v===45||zr(v))&&i++<63){const E=v===45?x:g;return t.consume(v),E}return n(v)}}const Xm={partial:!0,tokenize:vU};function vU(t,e,n){return i;function i(s){return Lt(s)?Kt(t,r,"linePrefix")(s):r(s)}function r(s){return s===null||st(s)?e(s):n(s)}}const RM={continuation:{tokenize:SU},exit:EU,name:"blockQuote",tokenize:_U};function _U(t,e,n){const i=this;return r;function r(l){if(l===62){const c=i.containerState;return c.open||(t.enter("blockQuote",{_container:!0}),c.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(l),t.exit("blockQuoteMarker"),s}return n(l)}function s(l){return Lt(l)?(t.enter("blockQuotePrefixWhitespace"),t.consume(l),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(l))}}function SU(t,e,n){const i=this;return r;function r(l){return Lt(l)?Kt(t,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return t.attempt(RM,e,n)(l)}}function EU(t){t.exit("blockQuote")}const kM={name:"characterEscape",tokenize:wU};function wU(t,e,n){return i;function i(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),r}function r(s){return uU(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const OM={name:"characterReference",tokenize:TU};function TU(t,e,n){const i=this;let r=0,s,l;return c;function c(g){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(g),t.exit("characterReferenceMarker"),d}function d(g){return g===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(g),t.exit("characterReferenceMarkerNumeric"),p):(t.enter("characterReferenceValue"),s=31,l=zr,m(g))}function p(g){return g===88||g===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(g),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,l=cU,m):(t.enter("characterReferenceValue"),s=7,l=a_,m(g))}function m(g){if(g===59&&r){const x=t.exit("characterReferenceValue");return l===zr&&!c1(i.sliceSerialize(x))?n(g):(t.enter("characterReferenceMarker"),t.consume(g),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return l(g)&&r++<s?(t.consume(g),m):n(g)}}const s2={partial:!0,tokenize:AU},l2={concrete:!0,name:"codeFenced",tokenize:CU};function CU(t,e,n){const i=this,r={partial:!0,tokenize:H};let s=0,l=0,c;return d;function d(z){return p(z)}function p(z){const F=i.events[i.events.length-1];return s=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,c=z,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),m(z)}function m(z){return z===c?(l++,t.consume(z),m):l<3?n(z):(t.exit("codeFencedFenceSequence"),Lt(z)?Kt(t,g,"whitespace")(z):g(z))}function g(z){return z===null||st(z)?(t.exit("codeFencedFence"),i.interrupt?e(z):t.check(s2,A,D)(z)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),x(z))}function x(z){return z===null||st(z)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),g(z)):Lt(z)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Kt(t,v,"whitespace")(z)):z===96&&z===c?n(z):(t.consume(z),x)}function v(z){return z===null||st(z)?g(z):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),E(z))}function E(z){return z===null||st(z)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),g(z)):z===96&&z===c?n(z):(t.consume(z),E)}function A(z){return t.attempt(r,D,C)(z)}function C(z){return t.enter("lineEnding"),t.consume(z),t.exit("lineEnding"),w}function w(z){return s>0&&Lt(z)?Kt(t,k,"linePrefix",s+1)(z):k(z)}function k(z){return z===null||st(z)?t.check(s2,A,D)(z):(t.enter("codeFlowValue"),N(z))}function N(z){return z===null||st(z)?(t.exit("codeFlowValue"),k(z)):(t.consume(z),N)}function D(z){return t.exit("codeFenced"),e(z)}function H(z,F,ee){let P=0;return I;function I(Q){return z.enter("lineEnding"),z.consume(Q),z.exit("lineEnding"),V}function V(Q){return z.enter("codeFencedFence"),Lt(Q)?Kt(z,X,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):X(Q)}function X(Q){return Q===c?(z.enter("codeFencedFenceSequence"),ne(Q)):ee(Q)}function ne(Q){return Q===c?(P++,z.consume(Q),ne):P>=l?(z.exit("codeFencedFenceSequence"),Lt(Q)?Kt(z,q,"whitespace")(Q):q(Q)):ee(Q)}function q(Q){return Q===null||st(Q)?(z.exit("codeFencedFence"),F(Q)):ee(Q)}}}function AU(t,e,n){const i=this;return r;function r(l){return l===null?n(l):(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),s)}function s(l){return i.parser.lazy[i.now().line]?n(l):e(l)}}const Kx={name:"codeIndented",tokenize:NU},MU={partial:!0,tokenize:RU};function NU(t,e,n){const i=this;return r;function r(p){return t.enter("codeIndented"),Kt(t,s,"linePrefix",5)(p)}function s(p){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(p):n(p)}function l(p){return p===null?d(p):st(p)?t.attempt(MU,l,d)(p):(t.enter("codeFlowValue"),c(p))}function c(p){return p===null||st(p)?(t.exit("codeFlowValue"),l(p)):(t.consume(p),c)}function d(p){return t.exit("codeIndented"),e(p)}}function RU(t,e,n){const i=this;return r;function r(l){return i.parser.lazy[i.now().line]?n(l):st(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),r):Kt(t,s,"linePrefix",5)(l)}function s(l){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(l):st(l)?r(l):n(l)}}const kU={name:"codeText",previous:DU,resolve:OU,tokenize:zU};function OU(t){let e=t.length-4,n=3,i,r;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(i=n;++i<e;)if(t[i][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(i=n-1,e++;++i<=e;)r===void 0?i!==e&&t[i][1].type!=="lineEnding"&&(r=i):(i===e||t[i][1].type==="lineEnding")&&(t[r][1].type="codeTextData",i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),e-=i-r-2,i=r+2),r=void 0);return t}function DU(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function zU(t,e,n){let i=0,r,s;return l;function l(g){return t.enter("codeText"),t.enter("codeTextSequence"),c(g)}function c(g){return g===96?(t.consume(g),i++,c):(t.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(t.enter("space"),t.consume(g),t.exit("space"),d):g===96?(s=t.enter("codeTextSequence"),r=0,m(g)):st(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),d):(t.enter("codeTextData"),p(g))}function p(g){return g===null||g===32||g===96||st(g)?(t.exit("codeTextData"),d(g)):(t.consume(g),p)}function m(g){return g===96?(t.consume(g),r++,m):r===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(g)):(s.type="codeTextData",p(g))}}class BU{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(e,i):e>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,n,i){const r=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&tm(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),tm(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tm(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);tm(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);tm(this.left,n.reverse())}}}function tm(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function DM(t){const e={};let n=-1,i,r,s,l,c,d,p;const m=new BU(t);for(;++n<m.length;){for(;n in e;)n=e[n];if(i=m.get(n),n&&i[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=i[1]._tokenizer.events,s=0,s<d.length&&d[s][1].type==="lineEndingBlank"&&(s+=2),s<d.length&&d[s][1].type==="content"))for(;++s<d.length&&d[s][1].type!=="content";)d[s][1].type==="chunkText"&&(d[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,LU(m,n)),n=e[n],p=!0);else if(i[1]._container){for(s=n,r=void 0;s--;)if(l=m.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(r&&(m.get(r)[1].type="lineEndingBlank"),l[1].type="lineEnding",r=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;r&&(i[1].end={...m.get(r)[1].start},c=m.slice(r,n),c.unshift(i),m.splice(r,n-r+1,c))}}return es(t,0,Number.POSITIVE_INFINITY,m.slice(0)),!p}function LU(t,e){const n=t.get(e)[1],i=t.get(e)[2];let r=e-1;const s=[];let l=n._tokenizer;l||(l=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],p={};let m,g,x=-1,v=n,E=0,A=0;const C=[A];for(;v;){for(;t.get(++r)[1]!==v;);s.push(r),v._tokenizer||(m=i.sliceStream(v),v.next||m.push(null),g&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=n;++x<c.length;)c[x][0]==="exit"&&c[x-1][0]==="enter"&&c[x][1].type===c[x-1][1].type&&c[x][1].start.line!==c[x][1].end.line&&(A=x+1,C.push(A),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):C.pop(),x=C.length;x--;){const w=c.slice(C[x],C[x+1]),k=s.pop();d.push([k,k+w.length-1]),t.splice(k,2,w)}for(d.reverse(),x=-1;++x<d.length;)p[E+d[x][0]]=E+d[x][1],E+=d[x][1]-d[x][0]-1;return p}const UU={resolve:HU,tokenize:jU},IU={partial:!0,tokenize:PU};function HU(t){return DM(t),t}function jU(t,e){let n;return i;function i(c){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),r(c)}function r(c){return c===null?s(c):st(c)?t.check(IU,l,s)(c):(t.consume(c),r)}function s(c){return t.exit("chunkContent"),t.exit("content"),e(c)}function l(c){return t.consume(c),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function PU(t,e,n){const i=this;return r;function r(l){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),Kt(t,s,"linePrefix")}function s(l){if(l===null||st(l))return n(l);const c=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(l):t.interrupt(i.parser.constructs.flow,n,e)(l)}}function zM(t,e,n,i,r,s,l,c,d){const p=d||Number.POSITIVE_INFINITY;let m=0;return g;function g(w){return w===60?(t.enter(i),t.enter(r),t.enter(s),t.consume(w),t.exit(s),x):w===null||w===32||w===41||T0(w)?n(w):(t.enter(i),t.enter(l),t.enter(c),t.enter("chunkString",{contentType:"string"}),A(w))}function x(w){return w===62?(t.enter(s),t.consume(w),t.exit(s),t.exit(r),t.exit(i),e):(t.enter(c),t.enter("chunkString",{contentType:"string"}),v(w))}function v(w){return w===62?(t.exit("chunkString"),t.exit(c),x(w)):w===null||w===60||st(w)?n(w):(t.consume(w),w===92?E:v)}function E(w){return w===60||w===62||w===92?(t.consume(w),v):v(w)}function A(w){return!m&&(w===null||w===41||Dn(w))?(t.exit("chunkString"),t.exit(c),t.exit(l),t.exit(i),e(w)):m<p&&w===40?(t.consume(w),m++,A):w===41?(t.consume(w),m--,A):w===null||w===32||w===40||T0(w)?n(w):(t.consume(w),w===92?C:A)}function C(w){return w===40||w===41||w===92?(t.consume(w),A):A(w)}}function BM(t,e,n,i,r,s){const l=this;let c=0,d;return p;function p(v){return t.enter(i),t.enter(r),t.consume(v),t.exit(r),t.enter(s),m}function m(v){return c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(t.exit(s),t.enter(r),t.consume(v),t.exit(r),t.exit(i),e):st(v)?(t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),m):(t.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||st(v)||c++>999?(t.exit("chunkString"),m(v)):(t.consume(v),d||(d=!Lt(v)),v===92?x:g)}function x(v){return v===91||v===92||v===93?(t.consume(v),c++,g):g(v)}}function LM(t,e,n,i,r,s){let l;return c;function c(x){return x===34||x===39||x===40?(t.enter(i),t.enter(r),t.consume(x),t.exit(r),l=x===40?41:x,d):n(x)}function d(x){return x===l?(t.enter(r),t.consume(x),t.exit(r),t.exit(i),e):(t.enter(s),p(x))}function p(x){return x===l?(t.exit(s),d(l)):x===null?n(x):st(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),Kt(t,p,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===l||x===null||st(x)?(t.exit("chunkString"),p(x)):(t.consume(x),x===92?g:m)}function g(x){return x===l||x===92?(t.consume(x),m):m(x)}}function xm(t,e){let n;return i;function i(r){return st(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,i):Lt(r)?Kt(t,i,n?"linePrefix":"lineSuffix")(r):e(r)}}const GU={name:"definition",tokenize:qU},FU={partial:!0,tokenize:YU};function qU(t,e,n){const i=this;let r;return s;function s(v){return t.enter("definition"),l(v)}function l(v){return BM.call(i,t,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return r=gl(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),v===58?(t.enter("definitionMarker"),t.consume(v),t.exit("definitionMarker"),d):n(v)}function d(v){return Dn(v)?xm(t,p)(v):p(v)}function p(v){return zM(t,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function m(v){return t.attempt(FU,g,g)(v)}function g(v){return Lt(v)?Kt(t,x,"whitespace")(v):x(v)}function x(v){return v===null||st(v)?(t.exit("definition"),i.parser.defined.push(r),e(v)):n(v)}}function YU(t,e,n){return i;function i(c){return Dn(c)?xm(t,r)(c):n(c)}function r(c){return LM(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return Lt(c)?Kt(t,l,"whitespace")(c):l(c)}function l(c){return c===null||st(c)?e(c):n(c)}}const VU={name:"hardBreakEscape",tokenize:XU};function XU(t,e,n){return i;function i(s){return t.enter("hardBreakEscape"),t.consume(s),r}function r(s){return st(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const KU={name:"headingAtx",resolve:WU,tokenize:ZU};function WU(t,e){let n=t.length-2,i=3,r,s;return t[i][1].type==="whitespace"&&(i+=2),n-2>i&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&t[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:t[i][1].start,end:t[n][1].end},s={type:"chunkText",start:t[i][1].start,end:t[n][1].end,contentType:"text"},es(t,i,n-i+1,[["enter",r,e],["enter",s,e],["exit",s,e],["exit",r,e]])),t}function ZU(t,e,n){let i=0;return r;function r(m){return t.enter("atxHeading"),s(m)}function s(m){return t.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&i++<6?(t.consume(m),l):m===null||Dn(m)?(t.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(t.enter("atxHeadingSequence"),d(m)):m===null||st(m)?(t.exit("atxHeading"),e(m)):Lt(m)?Kt(t,c,"whitespace")(m):(t.enter("atxHeadingText"),p(m))}function d(m){return m===35?(t.consume(m),d):(t.exit("atxHeadingSequence"),c(m))}function p(m){return m===null||m===35||Dn(m)?(t.exit("atxHeadingText"),c(m)):(t.consume(m),p)}}const $U=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],o2=["pre","script","style","textarea"],QU={concrete:!0,name:"htmlFlow",resolveTo:tI,tokenize:nI},JU={partial:!0,tokenize:rI},eI={partial:!0,tokenize:iI};function tI(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function nI(t,e,n){const i=this;let r,s,l,c,d;return p;function p(U){return m(U)}function m(U){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(U),g}function g(U){return U===33?(t.consume(U),x):U===47?(t.consume(U),s=!0,A):U===63?(t.consume(U),r=3,i.interrupt?e:j):la(U)?(t.consume(U),l=String.fromCharCode(U),C):n(U)}function x(U){return U===45?(t.consume(U),r=2,v):U===91?(t.consume(U),r=5,c=0,E):la(U)?(t.consume(U),r=4,i.interrupt?e:j):n(U)}function v(U){return U===45?(t.consume(U),i.interrupt?e:j):n(U)}function E(U){const le="CDATA[";return U===le.charCodeAt(c++)?(t.consume(U),c===le.length?i.interrupt?e:X:E):n(U)}function A(U){return la(U)?(t.consume(U),l=String.fromCharCode(U),C):n(U)}function C(U){if(U===null||U===47||U===62||Dn(U)){const le=U===47,de=l.toLowerCase();return!le&&!s&&o2.includes(de)?(r=1,i.interrupt?e(U):X(U)):$U.includes(l.toLowerCase())?(r=6,le?(t.consume(U),w):i.interrupt?e(U):X(U)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(U):s?k(U):N(U))}return U===45||zr(U)?(t.consume(U),l+=String.fromCharCode(U),C):n(U)}function w(U){return U===62?(t.consume(U),i.interrupt?e:X):n(U)}function k(U){return Lt(U)?(t.consume(U),k):I(U)}function N(U){return U===47?(t.consume(U),I):U===58||U===95||la(U)?(t.consume(U),D):Lt(U)?(t.consume(U),N):I(U)}function D(U){return U===45||U===46||U===58||U===95||zr(U)?(t.consume(U),D):H(U)}function H(U){return U===61?(t.consume(U),z):Lt(U)?(t.consume(U),H):N(U)}function z(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(t.consume(U),d=U,F):Lt(U)?(t.consume(U),z):ee(U)}function F(U){return U===d?(t.consume(U),d=null,P):U===null||st(U)?n(U):(t.consume(U),F)}function ee(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||Dn(U)?H(U):(t.consume(U),ee)}function P(U){return U===47||U===62||Lt(U)?N(U):n(U)}function I(U){return U===62?(t.consume(U),V):n(U)}function V(U){return U===null||st(U)?X(U):Lt(U)?(t.consume(U),V):n(U)}function X(U){return U===45&&r===2?(t.consume(U),B):U===60&&r===1?(t.consume(U),Y):U===62&&r===4?(t.consume(U),K):U===63&&r===3?(t.consume(U),j):U===93&&r===5?(t.consume(U),$):st(U)&&(r===6||r===7)?(t.exit("htmlFlowData"),t.check(JU,te,ne)(U)):U===null||st(U)?(t.exit("htmlFlowData"),ne(U)):(t.consume(U),X)}function ne(U){return t.check(eI,q,te)(U)}function q(U){return t.enter("lineEnding"),t.consume(U),t.exit("lineEnding"),Q}function Q(U){return U===null||st(U)?ne(U):(t.enter("htmlFlowData"),X(U))}function B(U){return U===45?(t.consume(U),j):X(U)}function Y(U){return U===47?(t.consume(U),l="",Z):X(U)}function Z(U){if(U===62){const le=l.toLowerCase();return o2.includes(le)?(t.consume(U),K):X(U)}return la(U)&&l.length<8?(t.consume(U),l+=String.fromCharCode(U),Z):X(U)}function $(U){return U===93?(t.consume(U),j):X(U)}function j(U){return U===62?(t.consume(U),K):U===45&&r===2?(t.consume(U),j):X(U)}function K(U){return U===null||st(U)?(t.exit("htmlFlowData"),te(U)):(t.consume(U),K)}function te(U){return t.exit("htmlFlow"),e(U)}}function iI(t,e,n){const i=this;return r;function r(l){return st(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),s):n(l)}function s(l){return i.parser.lazy[i.now().line]?n(l):e(l)}}function rI(t,e,n){return i;function i(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),t.attempt(Xm,e,n)}}const aI={name:"htmlText",tokenize:sI};function sI(t,e,n){const i=this;let r,s,l;return c;function c(j){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(j),d}function d(j){return j===33?(t.consume(j),p):j===47?(t.consume(j),H):j===63?(t.consume(j),N):la(j)?(t.consume(j),ee):n(j)}function p(j){return j===45?(t.consume(j),m):j===91?(t.consume(j),s=0,E):la(j)?(t.consume(j),k):n(j)}function m(j){return j===45?(t.consume(j),v):n(j)}function g(j){return j===null?n(j):j===45?(t.consume(j),x):st(j)?(l=g,Y(j)):(t.consume(j),g)}function x(j){return j===45?(t.consume(j),v):g(j)}function v(j){return j===62?B(j):j===45?x(j):g(j)}function E(j){const K="CDATA[";return j===K.charCodeAt(s++)?(t.consume(j),s===K.length?A:E):n(j)}function A(j){return j===null?n(j):j===93?(t.consume(j),C):st(j)?(l=A,Y(j)):(t.consume(j),A)}function C(j){return j===93?(t.consume(j),w):A(j)}function w(j){return j===62?B(j):j===93?(t.consume(j),w):A(j)}function k(j){return j===null||j===62?B(j):st(j)?(l=k,Y(j)):(t.consume(j),k)}function N(j){return j===null?n(j):j===63?(t.consume(j),D):st(j)?(l=N,Y(j)):(t.consume(j),N)}function D(j){return j===62?B(j):N(j)}function H(j){return la(j)?(t.consume(j),z):n(j)}function z(j){return j===45||zr(j)?(t.consume(j),z):F(j)}function F(j){return st(j)?(l=F,Y(j)):Lt(j)?(t.consume(j),F):B(j)}function ee(j){return j===45||zr(j)?(t.consume(j),ee):j===47||j===62||Dn(j)?P(j):n(j)}function P(j){return j===47?(t.consume(j),B):j===58||j===95||la(j)?(t.consume(j),I):st(j)?(l=P,Y(j)):Lt(j)?(t.consume(j),P):B(j)}function I(j){return j===45||j===46||j===58||j===95||zr(j)?(t.consume(j),I):V(j)}function V(j){return j===61?(t.consume(j),X):st(j)?(l=V,Y(j)):Lt(j)?(t.consume(j),V):P(j)}function X(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(t.consume(j),r=j,ne):st(j)?(l=X,Y(j)):Lt(j)?(t.consume(j),X):(t.consume(j),q)}function ne(j){return j===r?(t.consume(j),r=void 0,Q):j===null?n(j):st(j)?(l=ne,Y(j)):(t.consume(j),ne)}function q(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||Dn(j)?P(j):(t.consume(j),q)}function Q(j){return j===47||j===62||Dn(j)?P(j):n(j)}function B(j){return j===62?(t.consume(j),t.exit("htmlTextData"),t.exit("htmlText"),e):n(j)}function Y(j){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(j),t.exit("lineEnding"),Z}function Z(j){return Lt(j)?Kt(t,$,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):$(j)}function $(j){return t.enter("htmlTextData"),l(j)}}const u1={name:"labelEnd",resolveAll:uI,resolveTo:fI,tokenize:dI},lI={tokenize:hI},oI={tokenize:pI},cI={tokenize:mI};function uI(t){let e=-1;const n=[];for(;++e<t.length;){const i=t[e][1];if(n.push(t[e]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const r=i.type==="labelImage"?4:2;i.type="data",e+=r}}return t.length!==n.length&&es(t,0,t.length,n),t}function fI(t,e){let n=t.length,i=0,r,s,l,c;for(;n--;)if(r=t[n][1],s){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;t[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(l){if(t[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(s=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(l=n);const d={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},p={type:"label",start:{...t[s][1].start},end:{...t[l][1].end}},m={type:"labelText",start:{...t[s+i+2][1].end},end:{...t[l-2][1].start}};return c=[["enter",d,e],["enter",p,e]],c=Rs(c,t.slice(s+1,s+i+3)),c=Rs(c,[["enter",m,e]]),c=Rs(c,eb(e.parser.constructs.insideSpan.null,t.slice(s+i+4,l-3),e)),c=Rs(c,[["exit",m,e],t[l-2],t[l-1],["exit",p,e]]),c=Rs(c,t.slice(l+1)),c=Rs(c,[["exit",d,e]]),es(t,s,t.length,c),t}function dI(t,e,n){const i=this;let r=i.events.length,s,l;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){s=i.events[r][1];break}return c;function c(x){return s?s._inactive?g(x):(l=i.parser.defined.includes(gl(i.sliceSerialize({start:s.end,end:i.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(x),t.exit("labelMarker"),t.exit("labelEnd"),d):n(x)}function d(x){return x===40?t.attempt(lI,m,l?m:g)(x):x===91?t.attempt(oI,m,l?p:g)(x):l?m(x):g(x)}function p(x){return t.attempt(cI,m,g)(x)}function m(x){return e(x)}function g(x){return s._balanced=!0,n(x)}}function hI(t,e,n){return i;function i(g){return t.enter("resource"),t.enter("resourceMarker"),t.consume(g),t.exit("resourceMarker"),r}function r(g){return Dn(g)?xm(t,s)(g):s(g)}function s(g){return g===41?m(g):zM(t,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function l(g){return Dn(g)?xm(t,d)(g):m(g)}function c(g){return n(g)}function d(g){return g===34||g===39||g===40?LM(t,p,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function p(g){return Dn(g)?xm(t,m)(g):m(g)}function m(g){return g===41?(t.enter("resourceMarker"),t.consume(g),t.exit("resourceMarker"),t.exit("resource"),e):n(g)}}function pI(t,e,n){const i=this;return r;function r(c){return BM.call(i,t,s,l,"reference","referenceMarker","referenceString")(c)}function s(c){return i.parser.defined.includes(gl(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(c):n(c)}function l(c){return n(c)}}function mI(t,e,n){return i;function i(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),r}function r(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const gI={name:"labelStartImage",resolveAll:u1.resolveAll,tokenize:yI};function yI(t,e,n){const i=this;return r;function r(c){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(c),t.exit("labelImageMarker"),s}function s(c){return c===91?(t.enter("labelMarker"),t.consume(c),t.exit("labelMarker"),t.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(c):e(c)}}const bI={name:"labelStartLink",resolveAll:u1.resolveAll,tokenize:xI};function xI(t,e,n){const i=this;return r;function r(l){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(l):e(l)}}const Wx={name:"lineEnding",tokenize:vI};function vI(t,e){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),Kt(t,e,"linePrefix")}}const u0={name:"thematicBreak",tokenize:_I};function _I(t,e,n){let i=0,r;return s;function s(p){return t.enter("thematicBreak"),l(p)}function l(p){return r=p,c(p)}function c(p){return p===r?(t.enter("thematicBreakSequence"),d(p)):i>=3&&(p===null||st(p))?(t.exit("thematicBreak"),e(p)):n(p)}function d(p){return p===r?(t.consume(p),i++,d):(t.exit("thematicBreakSequence"),Lt(p)?Kt(t,c,"whitespace")(p):c(p))}}const wa={continuation:{tokenize:TI},exit:AI,name:"list",tokenize:wI},SI={partial:!0,tokenize:MI},EI={partial:!0,tokenize:CI};function wI(t,e,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,l=0;return c;function c(v){const E=i.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!i.containerState.marker||v===i.containerState.marker:a_(v)){if(i.containerState.type||(i.containerState.type=E,t.enter(E,{_container:!0})),E==="listUnordered")return t.enter("listItemPrefix"),v===42||v===45?t.check(u0,n,p)(v):p(v);if(!i.interrupt||v===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),d(v)}return n(v)}function d(v){return a_(v)&&++l<10?(t.consume(v),d):(!i.interrupt||l<2)&&(i.containerState.marker?v===i.containerState.marker:v===41||v===46)?(t.exit("listItemValue"),p(v)):n(v)}function p(v){return t.enter("listItemMarker"),t.consume(v),t.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||v,t.check(Xm,i.interrupt?n:m,t.attempt(SI,x,g))}function m(v){return i.containerState.initialBlankLine=!0,s++,x(v)}function g(v){return Lt(v)?(t.enter("listItemPrefixWhitespace"),t.consume(v),t.exit("listItemPrefixWhitespace"),x):n(v)}function x(v){return i.containerState.size=s+i.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(v)}}function TI(t,e,n){const i=this;return i.containerState._closeFlow=void 0,t.check(Xm,r,s);function r(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Kt(t,e,"listItemIndent",i.containerState.size+1)(c)}function s(c){return i.containerState.furtherBlankLines||!Lt(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,t.attempt(EI,e,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,Kt(t,t.attempt(wa,e,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function CI(t,e,n){const i=this;return Kt(t,r,"listItemIndent",i.containerState.size+1);function r(s){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?e(s):n(s)}}function AI(t){t.exit(this.containerState.type)}function MI(t,e,n){const i=this;return Kt(t,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const l=i.events[i.events.length-1];return!Lt(s)&&l&&l[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const c2={name:"setextUnderline",resolveTo:NI,tokenize:RI};function NI(t,e){let n=t.length,i,r,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){i=n;break}t[n][1].type==="paragraph"&&(r=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const l={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[r][1].type="setextHeadingText",s?(t.splice(r,0,["enter",l,e]),t.splice(s+1,0,["exit",t[i][1],e]),t[i][1].end={...t[s][1].end}):t[i][1]=l,t.push(["exit",l,e]),t}function RI(t,e,n){const i=this;let r;return s;function s(p){let m=i.events.length,g;for(;m--;)if(i.events[m][1].type!=="lineEnding"&&i.events[m][1].type!=="linePrefix"&&i.events[m][1].type!=="content"){g=i.events[m][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||g)?(t.enter("setextHeadingLine"),r=p,l(p)):n(p)}function l(p){return t.enter("setextHeadingLineSequence"),c(p)}function c(p){return p===r?(t.consume(p),c):(t.exit("setextHeadingLineSequence"),Lt(p)?Kt(t,d,"lineSuffix")(p):d(p))}function d(p){return p===null||st(p)?(t.exit("setextHeadingLine"),e(p)):n(p)}}const kI={tokenize:OI};function OI(t){const e=this,n=t.attempt(Xm,i,t.attempt(this.parser.constructs.flowInitial,r,Kt(t,t.attempt(this.parser.constructs.flow,r,t.attempt(UU,r)),"linePrefix")));return n;function i(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function r(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const DI={resolveAll:IM()},zI=UM("string"),BI=UM("text");function UM(t){return{resolveAll:IM(t==="text"?LI:void 0),tokenize:e};function e(n){const i=this,r=this.parser.constructs[t],s=n.attempt(r,l,c);return l;function l(m){return p(m)?s(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return p(m)?(n.exit("data"),s(m)):(n.consume(m),d)}function p(m){if(m===null)return!0;const g=r[m];let x=-1;if(g)for(;++x<g.length;){const v=g[x];if(!v.previous||v.previous.call(i,i.previous))return!0}return!1}}}function IM(t){return e;function e(n,i){let r=-1,s;for(;++r<=n.length;)s===void 0?n[r]&&n[r][1].type==="data"&&(s=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==s+2&&(n[s][1].end=n[r-1][1].end,n.splice(s+2,r-s-2),r=s+2),s=void 0);return t?t(n,i):n}}function LI(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const i=t[n-1][1],r=e.sliceStream(i);let s=r.length,l=-1,c=0,d;for(;s--;){const p=r[s];if(typeof p=="string"){for(l=p.length;p.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(p===-2)d=!0,c++;else if(p!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(c=0),c){const p={type:n===t.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:i.start._bufferIndex+l,_index:i.start._index+s,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...p.start},i.start.offset===i.end.offset?Object.assign(i,p):(t.splice(n,0,["enter",p,e],["exit",p,e]),n+=2)}n++}return t}const UI={42:wa,43:wa,45:wa,48:wa,49:wa,50:wa,51:wa,52:wa,53:wa,54:wa,55:wa,56:wa,57:wa,62:RM},II={91:GU},HI={[-2]:Kx,[-1]:Kx,32:Kx},jI={35:KU,42:u0,45:[c2,u0],60:QU,61:c2,95:u0,96:l2,126:l2},PI={38:OM,92:kM},GI={[-5]:Wx,[-4]:Wx,[-3]:Wx,33:gI,38:OM,42:s_,60:[bU,aI],91:bI,92:[VU,kM],93:u1,95:s_,96:kU},FI={null:[s_,DI]},qI={null:[42,95]},YI={null:[]},VI=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:qI,contentInitial:II,disable:YI,document:UI,flow:jI,flowInitial:HI,insideSpan:FI,string:PI,text:GI},Symbol.toStringTag,{value:"Module"}));function XI(t,e,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},s=[];let l=[],c=[];const d={attempt:F(H),check:F(z),consume:k,enter:N,exit:D,interrupt:F(z,{interrupt:!0})},p={code:null,containerState:{},defineSkip:A,events:[],now:E,parser:t,previous:null,sliceSerialize:x,sliceStream:v,write:g};let m=e.tokenize.call(p,d);return e.resolveAll&&s.push(e),p;function g(V){return l=Rs(l,V),C(),l[l.length-1]!==null?[]:(ee(e,0),p.events=eb(s,p.events,p),p.events)}function x(V,X){return WI(v(V),X)}function v(V){return KI(l,V)}function E(){const{_bufferIndex:V,_index:X,line:ne,column:q,offset:Q}=i;return{_bufferIndex:V,_index:X,line:ne,column:q,offset:Q}}function A(V){r[V.line]=V.column,I()}function C(){let V;for(;i._index<l.length;){const X=l[i._index];if(typeof X=="string")for(V=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===V&&i._bufferIndex<X.length;)w(X.charCodeAt(i._bufferIndex));else w(X)}}function w(V){m=m(V)}function k(V){st(V)?(i.line++,i.column=1,i.offset+=V===-3?2:1,I()):V!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),p.previous=V}function N(V,X){const ne=X||{};return ne.type=V,ne.start=E(),p.events.push(["enter",ne,p]),c.push(ne),ne}function D(V){const X=c.pop();return X.end=E(),p.events.push(["exit",X,p]),X}function H(V,X){ee(V,X.from)}function z(V,X){X.restore()}function F(V,X){return ne;function ne(q,Q,B){let Y,Z,$,j;return Array.isArray(q)?te(q):"tokenize"in q?te([q]):K(q);function K(ge){return se;function se(pe){const Ae=pe!==null&&ge[pe],Le=pe!==null&&ge.null,Ge=[...Array.isArray(Ae)?Ae:Ae?[Ae]:[],...Array.isArray(Le)?Le:Le?[Le]:[]];return te(Ge)(pe)}}function te(ge){return Y=ge,Z=0,ge.length===0?B:U(ge[Z])}function U(ge){return se;function se(pe){return j=P(),$=ge,ge.partial||(p.currentConstruct=ge),ge.name&&p.parser.constructs.disable.null.includes(ge.name)?de():ge.tokenize.call(X?Object.assign(Object.create(p),X):p,d,le,de)(pe)}}function le(ge){return V($,j),Q}function de(ge){return j.restore(),++Z<Y.length?U(Y[Z]):B}}}function ee(V,X){V.resolveAll&&!s.includes(V)&&s.push(V),V.resolve&&es(p.events,X,p.events.length-X,V.resolve(p.events.slice(X),p)),V.resolveTo&&(p.events=V.resolveTo(p.events,p))}function P(){const V=E(),X=p.previous,ne=p.currentConstruct,q=p.events.length,Q=Array.from(c);return{from:q,restore:B};function B(){i=V,p.previous=X,p.currentConstruct=ne,p.events.length=q,c=Q,I()}}function I(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function KI(t,e){const n=e.start._index,i=e.start._bufferIndex,r=e.end._index,s=e.end._bufferIndex;let l;if(n===r)l=[t[n].slice(i,s)];else{if(l=t.slice(n,r),i>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(i):l.shift()}s>0&&l.push(t[r].slice(0,s))}return l}function WI(t,e){let n=-1;const i=[];let r;for(;++n<t.length;){const s=t[n];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
346
- `;break}case-3:{l=`\r
347
- `;break}case-2:{l=e?" ":" ";break}case-1:{if(!e&&r)continue;l=" ";break}default:l=String.fromCharCode(s)}r=s===-2,i.push(l)}return i.join("")}function ZI(t){const i={constructs:MM([VI,...(t||{}).extensions||[]]),content:r(fU),defined:[],document:r(hU),flow:r(kI),lazy:{},string:r(zI),text:r(BI)};return i;function r(s){return l;function l(c){return XI(i,s,c)}}}function $I(t){for(;!DM(t););return t}const u2=/[\0\t\n\r]/g;function QI(){let t=1,e="",n=!0,i;return r;function r(s,l,c){const d=[];let p,m,g,x,v;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s)),g=0,e="",n&&(s.charCodeAt(0)===65279&&g++,n=void 0);g<s.length;){if(u2.lastIndex=g,p=u2.exec(s),x=p&&p.index!==void 0?p.index:s.length,v=s.charCodeAt(x),!p){e=s.slice(g);break}if(v===10&&g===x&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=void 0),g<x&&(d.push(s.slice(g,x)),t+=x-g),v){case 0:{d.push(65533),t++;break}case 9:{for(m=Math.ceil(t/4)*4,d.push(-2);t++<m;)d.push(-1);break}case 10:{d.push(-4),t=1;break}default:i=!0,t=1}g=x+1}return c&&(i&&d.push(-5),e&&d.push(e),d.push(null)),d}}const JI=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function eH(t){return t.replace(JI,tH)}function tH(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),s=r===120||r===88;return NM(n.slice(s?2:1),s?16:10)}return c1(n)||t}const HM={}.hasOwnProperty;function nH(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),iH(n)($I(ZI(n).document().write(QI()(t,e,!0))))}function iH(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Bn),autolinkProtocol:P,autolinkEmail:P,atxHeading:s(ut),blockQuote:s(Le),characterEscape:P,characterReference:P,codeFenced:s(Ge),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(Ge,l),codeText:s(Pe,l),codeTextData:P,data:P,codeFlowValue:P,definition:s(Ie),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(We),hardBreakEscape:s(Ue),hardBreakTrailing:s(Ue),htmlFlow:s(At,l),htmlFlowData:P,htmlText:s(At,l),htmlTextData:P,image:s(zn),label:l,link:s(Bn),listItem:s(wi),listItemValue:x,listOrdered:s(bn,g),listUnordered:s(bn),paragraph:s(ka),reference:U,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(ut),strong:s(Lr),thematicBreak:s(ua)},exit:{atxHeading:d(),atxHeadingSequence:H,autolink:d(),autolinkEmail:Ae,autolinkProtocol:pe,blockQuote:d(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:ge,characterReference:se,codeFenced:d(C),codeFencedFence:A,codeFencedFenceInfo:v,codeFencedFenceMeta:E,codeFlowValue:I,codeIndented:d(w),codeText:d(Q),codeTextData:I,data:I,definition:d(),definitionDestinationString:D,definitionLabelString:k,definitionTitleString:N,emphasis:d(),hardBreakEscape:d(X),hardBreakTrailing:d(X),htmlFlow:d(ne),htmlFlowData:I,htmlText:d(q),htmlTextData:I,image:d(Y),label:$,labelText:Z,lineEnding:V,link:d(B),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:le,resourceDestinationString:j,resourceTitleString:K,resource:te,setextHeading:d(ee),setextHeadingLineSequence:F,setextHeadingText:z,strong:d(),thematicBreak:d()}};jM(e,(t||{}).mdastExtensions||[]);const n={};return i;function i(_e){let Re={type:"root",children:[]};const Je={stack:[Re],tokenStack:[],config:e,enter:c,exit:p,buffer:l,resume:m,data:n},bt=[];let kt=-1;for(;++kt<_e.length;)if(_e[kt][1].type==="listOrdered"||_e[kt][1].type==="listUnordered")if(_e[kt][0]==="enter")bt.push(kt);else{const yi=bt.pop();kt=r(_e,yi,kt)}for(kt=-1;++kt<_e.length;){const yi=e[_e[kt][0]];HM.call(yi,_e[kt][1].type)&&yi[_e[kt][1].type].call(Object.assign({sliceSerialize:_e[kt][2].sliceSerialize},Je),_e[kt][1])}if(Je.tokenStack.length>0){const yi=Je.tokenStack[Je.tokenStack.length-1];(yi[1]||f2).call(Je,void 0,yi[0])}for(Re.position={start:Wc(_e.length>0?_e[0][1].start:{line:1,column:1,offset:0}),end:Wc(_e.length>0?_e[_e.length-2][1].end:{line:1,column:1,offset:0})},kt=-1;++kt<e.transforms.length;)Re=e.transforms[kt](Re)||Re;return Re}function r(_e,Re,Je){let bt=Re-1,kt=-1,yi=!1,rr,xn,Zt,Gn;for(;++bt<=Je;){const Pt=_e[bt];switch(Pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Pt[0]==="enter"?kt++:kt--,Gn=void 0;break}case"lineEndingBlank":{Pt[0]==="enter"&&(rr&&!Gn&&!kt&&!Zt&&(Zt=bt),Gn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Gn=void 0}if(!kt&&Pt[0]==="enter"&&Pt[1].type==="listItemPrefix"||kt===-1&&Pt[0]==="exit"&&(Pt[1].type==="listUnordered"||Pt[1].type==="listOrdered")){if(rr){let Fi=bt;for(xn=void 0;Fi--;){const Qn=_e[Fi];if(Qn[1].type==="lineEnding"||Qn[1].type==="lineEndingBlank"){if(Qn[0]==="exit")continue;xn&&(_e[xn][1].type="lineEndingBlank",yi=!0),Qn[1].type="lineEnding",xn=Fi}else if(!(Qn[1].type==="linePrefix"||Qn[1].type==="blockQuotePrefix"||Qn[1].type==="blockQuotePrefixWhitespace"||Qn[1].type==="blockQuoteMarker"||Qn[1].type==="listItemIndent"))break}Zt&&(!xn||Zt<xn)&&(rr._spread=!0),rr.end=Object.assign({},xn?_e[xn][1].start:Pt[1].end),_e.splice(xn||bt,0,["exit",rr,Pt[2]]),bt++,Je++}if(Pt[1].type==="listItemPrefix"){const Fi={type:"listItem",_spread:!1,start:Object.assign({},Pt[1].start),end:void 0};rr=Fi,_e.splice(bt,0,["enter",Fi,Pt[2]]),bt++,Je++,Zt=void 0,Gn=!0}}}return _e[Re][1]._spread=yi,Je}function s(_e,Re){return Je;function Je(bt){c.call(this,_e(bt),bt),Re&&Re.call(this,bt)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(_e,Re,Je){this.stack[this.stack.length-1].children.push(_e),this.stack.push(_e),this.tokenStack.push([Re,Je||void 0]),_e.position={start:Wc(Re.start),end:void 0}}function d(_e){return Re;function Re(Je){_e&&_e.call(this,Je),p.call(this,Je)}}function p(_e,Re){const Je=this.stack.pop(),bt=this.tokenStack.pop();if(bt)bt[0].type!==_e.type&&(Re?Re.call(this,_e,bt[0]):(bt[1]||f2).call(this,_e,bt[0]));else throw new Error("Cannot close `"+_e.type+"` ("+bm({start:_e.start,end:_e.end})+"): it’s not open");Je.position.end=Wc(_e.end)}function m(){return o1(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(_e){if(this.data.expectingFirstListItemValue){const Re=this.stack[this.stack.length-2];Re.start=Number.parseInt(this.sliceSerialize(_e),10),this.data.expectingFirstListItemValue=void 0}}function v(){const _e=this.resume(),Re=this.stack[this.stack.length-1];Re.lang=_e}function E(){const _e=this.resume(),Re=this.stack[this.stack.length-1];Re.meta=_e}function A(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const _e=this.resume(),Re=this.stack[this.stack.length-1];Re.value=_e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const _e=this.resume(),Re=this.stack[this.stack.length-1];Re.value=_e.replace(/(\r?\n|\r)$/g,"")}function k(_e){const Re=this.resume(),Je=this.stack[this.stack.length-1];Je.label=Re,Je.identifier=gl(this.sliceSerialize(_e)).toLowerCase()}function N(){const _e=this.resume(),Re=this.stack[this.stack.length-1];Re.title=_e}function D(){const _e=this.resume(),Re=this.stack[this.stack.length-1];Re.url=_e}function H(_e){const Re=this.stack[this.stack.length-1];if(!Re.depth){const Je=this.sliceSerialize(_e).length;Re.depth=Je}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function F(_e){const Re=this.stack[this.stack.length-1];Re.depth=this.sliceSerialize(_e).codePointAt(0)===61?1:2}function ee(){this.data.setextHeadingSlurpLineEnding=void 0}function P(_e){const Je=this.stack[this.stack.length-1].children;let bt=Je[Je.length-1];(!bt||bt.type!=="text")&&(bt=hn(),bt.position={start:Wc(_e.start),end:void 0},Je.push(bt)),this.stack.push(bt)}function I(_e){const Re=this.stack.pop();Re.value+=this.sliceSerialize(_e),Re.position.end=Wc(_e.end)}function V(_e){const Re=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Je=Re.children[Re.children.length-1];Je.position.end=Wc(_e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Re.type)&&(P.call(this,_e),I.call(this,_e))}function X(){this.data.atHardBreak=!0}function ne(){const _e=this.resume(),Re=this.stack[this.stack.length-1];Re.value=_e}function q(){const _e=this.resume(),Re=this.stack[this.stack.length-1];Re.value=_e}function Q(){const _e=this.resume(),Re=this.stack[this.stack.length-1];Re.value=_e}function B(){const _e=this.stack[this.stack.length-1];if(this.data.inReference){const Re=this.data.referenceType||"shortcut";_e.type+="Reference",_e.referenceType=Re,delete _e.url,delete _e.title}else delete _e.identifier,delete _e.label;this.data.referenceType=void 0}function Y(){const _e=this.stack[this.stack.length-1];if(this.data.inReference){const Re=this.data.referenceType||"shortcut";_e.type+="Reference",_e.referenceType=Re,delete _e.url,delete _e.title}else delete _e.identifier,delete _e.label;this.data.referenceType=void 0}function Z(_e){const Re=this.sliceSerialize(_e),Je=this.stack[this.stack.length-2];Je.label=eH(Re),Je.identifier=gl(Re).toLowerCase()}function $(){const _e=this.stack[this.stack.length-1],Re=this.resume(),Je=this.stack[this.stack.length-1];if(this.data.inReference=!0,Je.type==="link"){const bt=_e.children;Je.children=bt}else Je.alt=Re}function j(){const _e=this.resume(),Re=this.stack[this.stack.length-1];Re.url=_e}function K(){const _e=this.resume(),Re=this.stack[this.stack.length-1];Re.title=_e}function te(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function le(_e){const Re=this.resume(),Je=this.stack[this.stack.length-1];Je.label=Re,Je.identifier=gl(this.sliceSerialize(_e)).toLowerCase(),this.data.referenceType="full"}function de(_e){this.data.characterReferenceType=_e.type}function ge(_e){const Re=this.sliceSerialize(_e),Je=this.data.characterReferenceType;let bt;Je?(bt=NM(Re,Je==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):bt=c1(Re);const kt=this.stack[this.stack.length-1];kt.value+=bt}function se(_e){const Re=this.stack.pop();Re.position.end=Wc(_e.end)}function pe(_e){I.call(this,_e);const Re=this.stack[this.stack.length-1];Re.url=this.sliceSerialize(_e)}function Ae(_e){I.call(this,_e);const Re=this.stack[this.stack.length-1];Re.url="mailto:"+this.sliceSerialize(_e)}function Le(){return{type:"blockquote",children:[]}}function Ge(){return{type:"code",lang:null,meta:null,value:""}}function Pe(){return{type:"inlineCode",value:""}}function Ie(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function We(){return{type:"emphasis",children:[]}}function ut(){return{type:"heading",depth:0,children:[]}}function Ue(){return{type:"break"}}function At(){return{type:"html",value:""}}function zn(){return{type:"image",title:null,url:"",alt:null}}function Bn(){return{type:"link",title:null,url:"",children:[]}}function bn(_e){return{type:"list",ordered:_e.type==="listOrdered",start:null,spread:_e._spread,children:[]}}function wi(_e){return{type:"listItem",spread:_e._spread,checked:null,children:[]}}function ka(){return{type:"paragraph",children:[]}}function Lr(){return{type:"strong",children:[]}}function hn(){return{type:"text",value:""}}function ua(){return{type:"thematicBreak"}}}function Wc(t){return{line:t.line,column:t.column,offset:t.offset}}function jM(t,e){let n=-1;for(;++n<e.length;){const i=e[n];Array.isArray(i)?jM(t,i):rH(t,i)}}function rH(t,e){let n;for(n in e)if(HM.call(e,n))switch(n){case"canContainEols":{const i=e[n];i&&t[n].push(...i);break}case"transforms":{const i=e[n];i&&t[n].push(...i);break}case"enter":case"exit":{const i=e[n];i&&Object.assign(t[n],i);break}}}function f2(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+bm({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+bm({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+bm({start:e.start,end:e.end})+") is still open")}function aH(t){const e=this;e.parser=n;function n(i){return nH(i,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function sH(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function lH(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
348
- `}]}function oH(t,e){const n=e.value?e.value+`
349
- `:"",i={},r=e.lang?e.lang.split(/\s+/):[];r.length>0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function cH(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function uH(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function fH(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=xh(i.toLowerCase()),s=t.footnoteOrder.indexOf(i);let l,c=t.footnoteCounts.get(i);c===void 0?(c=0,t.footnoteOrder.push(i),l=t.footnoteOrder.length):l=s+1,c+=1,t.footnoteCounts.set(i,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};t.patch(e,d);const p={type:"element",tagName:"sup",properties:{},children:[d]};return t.patch(e,p),t.applyData(e,p)}function dH(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function hH(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function PM(t,e){const n=e.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+i}];const r=t.all(e),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const l=r[r.length-1];return l&&l.type==="text"?l.value+=i:r.push({type:"text",value:i}),r}function pH(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return PM(t,e);const r={src:xh(i.url||""),alt:e.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,s),t.applyData(e,s)}function mH(t,e){const n={src:xh(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,i),t.applyData(e,i)}function gH(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,i),t.applyData(e,i)}function yH(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return PM(t,e);const r={href:xh(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function bH(t,e){const n={href:xh(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function xH(t,e,n){const i=t.all(e),r=n?vH(n):GM(e),s={},l=[];if(typeof e.checked=="boolean"){const m=i[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},i.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;for(;++c<i.length;){const m=i[c];(r||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
350
- `}),m.type==="element"&&m.tagName==="p"&&!r?l.push(...m.children):l.push(m)}const d=i[i.length-1];d&&(r||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
351
- `});const p={type:"element",tagName:"li",properties:s,children:l};return t.patch(e,p),t.applyData(e,p)}function vH(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let i=-1;for(;!e&&++i<n.length;)e=GM(n[i])}return e}function GM(t){const e=t.spread;return e??t.children.length>1}function _H(t,e){const n={},i=t.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++r<i.length;){const l=i[r];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function SH(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function EH(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function wH(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function TH(t,e){const n=t.all(e),i=n.shift(),r=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:t.wrap([i],!0)};t.patch(e.children[0],l),r.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},c=r1(e.children[1]),d=_M(e.children[e.children.length-1]);c&&d&&(l.position={start:c,end:d}),r.push(l)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function CH(t,e,n){const i=n?n.children:void 0,s=(i?i.indexOf(e):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:e.children.length;let d=-1;const p=[];for(;++d<c;){const g=e.children[d],x={},v=l?l[d]:void 0;v&&(x.align=v);let E={type:"element",tagName:s,properties:x,children:[]};g&&(E.children=t.all(g),t.patch(g,E),E=t.applyData(g,E)),p.push(E)}const m={type:"element",tagName:"tr",properties:{},children:t.wrap(p,!0)};return t.patch(e,m),t.applyData(e,m)}function AH(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const d2=9,h2=32;function MH(t){const e=String(t),n=/\r?\n|\r/g;let i=n.exec(e),r=0;const s=[];for(;i;)s.push(p2(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(e);return s.push(p2(e.slice(r),r>0,!1)),s.join("")}function p2(t,e,n){let i=0,r=t.length;if(e){let s=t.codePointAt(i);for(;s===d2||s===h2;)i++,s=t.codePointAt(i)}if(n){let s=t.codePointAt(r-1);for(;s===d2||s===h2;)r--,s=t.codePointAt(r-1)}return r>i?t.slice(i,r):""}function NH(t,e){const n={type:"text",value:MH(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function RH(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const kH={blockquote:sH,break:lH,code:oH,delete:cH,emphasis:uH,footnoteReference:fH,heading:dH,html:hH,imageReference:pH,image:mH,inlineCode:gH,linkReference:yH,link:bH,listItem:xH,list:_H,paragraph:SH,root:EH,strong:wH,table:TH,tableCell:AH,tableRow:CH,text:NH,thematicBreak:RH,toml:jy,yaml:jy,definition:jy,footnoteDefinition:jy};function jy(){}const FM=-1,tb=0,vm=1,C0=2,f1=3,d1=4,h1=5,p1=6,qM=7,YM=8,m2=typeof self=="object"?self:globalThis,OH=(t,e)=>{const n=(r,s)=>(t.set(s,r),r),i=r=>{if(t.has(r))return t.get(r);const[s,l]=e[r];switch(s){case tb:case FM:return n(l,r);case vm:{const c=n([],r);for(const d of l)c.push(i(d));return c}case C0:{const c=n({},r);for(const[d,p]of l)c[i(d)]=i(p);return c}case f1:return n(new Date(l),r);case d1:{const{source:c,flags:d}=l;return n(new RegExp(c,d),r)}case h1:{const c=n(new Map,r);for(const[d,p]of l)c.set(i(d),i(p));return c}case p1:{const c=n(new Set,r);for(const d of l)c.add(i(d));return c}case qM:{const{name:c,message:d}=l;return n(new m2[c](d),r)}case YM:return n(BigInt(l),r);case"BigInt":return n(Object(BigInt(l)),r);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new m2[s](l),r)};return i},g2=t=>OH(new Map,t)(0),Bd="",{toString:DH}={},{keys:zH}=Object,nm=t=>{const e=typeof t;if(e!=="object"||!t)return[tb,e];const n=DH.call(t).slice(8,-1);switch(n){case"Array":return[vm,Bd];case"Object":return[C0,Bd];case"Date":return[f1,Bd];case"RegExp":return[d1,Bd];case"Map":return[h1,Bd];case"Set":return[p1,Bd];case"DataView":return[vm,n]}return n.includes("Array")?[vm,n]:n.includes("Error")?[qM,n]:[C0,n]},Py=([t,e])=>t===tb&&(e==="function"||e==="symbol"),BH=(t,e,n,i)=>{const r=(l,c)=>{const d=i.push(l)-1;return n.set(c,d),d},s=l=>{if(n.has(l))return n.get(l);let[c,d]=nm(l);switch(c){case tb:{let m=l;switch(d){case"bigint":c=YM,m=l.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return r([FM],l)}return r([c,m],l)}case vm:{if(d){let x=l;return d==="DataView"?x=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(x=new Uint8Array(l)),r([d,[...x]],l)}const m=[],g=r([c,m],l);for(const x of l)m.push(s(x));return g}case C0:{if(d)switch(d){case"BigInt":return r([d,l.toString()],l);case"Boolean":case"Number":case"String":return r([d,l.valueOf()],l)}if(e&&"toJSON"in l)return s(l.toJSON());const m=[],g=r([c,m],l);for(const x of zH(l))(t||!Py(nm(l[x])))&&m.push([s(x),s(l[x])]);return g}case f1:return r([c,l.toISOString()],l);case d1:{const{source:m,flags:g}=l;return r([c,{source:m,flags:g}],l)}case h1:{const m=[],g=r([c,m],l);for(const[x,v]of l)(t||!(Py(nm(x))||Py(nm(v))))&&m.push([s(x),s(v)]);return g}case p1:{const m=[],g=r([c,m],l);for(const x of l)(t||!Py(nm(x)))&&m.push(s(x));return g}}const{message:p}=l;return r([c,{name:d,message:p}],l)};return s},y2=(t,{json:e,lossy:n}={})=>{const i=[];return BH(!(e||n),!!e,new Map,i)(t),i},A0=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?g2(y2(t,e)):structuredClone(t):(t,e)=>g2(y2(t,e));function LH(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function UH(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function IH(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||LH,i=t.options.footnoteBackLabel||UH,r=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",l=t.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<t.footnoteOrder.length;){const p=t.footnoteById.get(t.footnoteOrder[d]);if(!p)continue;const m=t.all(p),g=String(p.identifier).toUpperCase(),x=xh(g.toLowerCase());let v=0;const E=[],A=t.footnoteCounts.get(g);for(;A!==void 0&&++v<=A;){E.length>0&&E.push({type:"text",value:" "});let k=typeof n=="string"?n:n(d,v);typeof k=="string"&&(k={type:"text",value:k}),E.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+x+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,v),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const C=m[m.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const k=C.children[C.children.length-1];k&&k.type==="text"?k.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...E)}else m.push(...E);const w={type:"element",tagName:"li",properties:{id:e+"fn-"+x},children:t.wrap(m,!0)};t.patch(p,w),c.push(w)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...A0(l),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
352
- `},{type:"element",tagName:"ol",properties:{},children:t.wrap(c,!0)},{type:"text",value:`
353
- `}]}}const Km=(function(t){if(t==null)return GH;if(typeof t=="function")return nb(t);if(typeof t=="object")return Array.isArray(t)?HH(t):jH(t);if(typeof t=="string")return PH(t);throw new Error("Expected function, string, or object as test")});function HH(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Km(t[n]);return nb(i);function i(...r){let s=-1;for(;++s<e.length;)if(e[s].apply(this,r))return!0;return!1}}function jH(t){const e=t;return nb(n);function n(i){const r=i;let s;for(s in t)if(r[s]!==e[s])return!1;return!0}}function PH(t){return nb(e);function e(n){return n&&n.type===t}}function nb(t){return e;function e(n,i,r){return!!(FH(n)&&t.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function GH(){return!0}function FH(t){return t!==null&&typeof t=="object"&&"type"in t}const VM=[],qH=!0,l_=!1,YH="skip";function XM(t,e,n,i){let r;typeof e=="function"&&typeof n!="function"?(i=n,n=e):r=e;const s=Km(r),l=i?-1:1;c(t,void 0,[])();function c(d,p,m){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const v=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return x;function x(){let v=VM,E,A,C;if((!e||s(d,p,m[m.length-1]||void 0))&&(v=VH(n(d,m)),v[0]===l_))return v;if("children"in d&&d.children){const w=d;if(w.children&&v[0]!==YH)for(A=(i?w.children.length:-1)+l,C=m.concat(w);A>-1&&A<w.children.length;){const k=w.children[A];if(E=c(k,A,C)(),E[0]===l_)return E;A=typeof E[1]=="number"?E[1]:A+l}}return v}}}function VH(t){return Array.isArray(t)?t:typeof t=="number"?[qH,t]:t==null?VM:[t]}function ib(t,e,n,i){let r,s,l;typeof e=="function"&&typeof n!="function"?(s=void 0,l=e,r=n):(s=e,l=n,r=i),XM(t,s,c,r);function c(d,p){const m=p[p.length-1],g=m?m.children.indexOf(d):void 0;return l(d,g,m)}}const o_={}.hasOwnProperty,XH={};function KH(t,e){const n=e||XH,i=new Map,r=new Map,s=new Map,l={...kH,...n.handlers},c={all:p,applyData:ZH,definitionById:i,footnoteById:r,footnoteCounts:s,footnoteOrder:[],handlers:l,one:d,options:n,patch:WH,wrap:QH};return ib(t,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?i:r,x=String(m.identifier).toUpperCase();g.has(x)||g.set(x,m)}}),c;function d(m,g){const x=m.type,v=c.handlers[x];if(o_.call(c.handlers,x)&&v)return v(c,m,g);if(c.options.passThrough&&c.options.passThrough.includes(x)){if("children"in m){const{children:A,...C}=m,w=A0(C);return w.children=c.all(m),w}return A0(m)}return(c.options.unknownHandler||$H)(c,m,g)}function p(m){const g=[];if("children"in m){const x=m.children;let v=-1;for(;++v<x.length;){const E=c.one(x[v],m);if(E){if(v&&x[v-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=b2(E.value)),!Array.isArray(E)&&E.type==="element")){const A=E.children[0];A&&A.type==="text"&&(A.value=b2(A.value))}Array.isArray(E)?g.push(...E):g.push(E)}}}return g}}function WH(t,e){t.position&&(e.position=U8(t))}function ZH(t,e){let n=e;if(t&&t.data){const i=t.data.hName,r=t.data.hChildren,s=t.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const l="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:l}}n.type==="element"&&s&&Object.assign(n.properties,A0(s)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function $H(t,e){const n=e.data||{},i="value"in e&&!(o_.call(n,"hProperties")||o_.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function QH(t,e){const n=[];let i=-1;for(e&&n.push({type:"text",value:`
354
- `});++i<t.length;)i&&n.push({type:"text",value:`
355
- `}),n.push(t[i]);return e&&t.length>0&&n.push({type:"text",value:`
356
- `}),n}function b2(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function x2(t,e){const n=KH(t,e),i=n.one(t,void 0),r=IH(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:`
357
- `},r),s}function JH(t,e){return t&&"run"in t?async function(n,i){const r=x2(n,{file:i,...e});await t.run(r,i)}:function(n,i){return x2(n,{file:i,...t||e})}}function v2(t){if(t)throw t}var Zx,_2;function e7(){if(_2)return Zx;_2=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(p){return typeof Array.isArray=="function"?Array.isArray(p):e.call(p)==="[object Array]"},s=function(p){if(!p||e.call(p)!=="[object Object]")return!1;var m=t.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&t.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!m&&!g)return!1;var x;for(x in p);return typeof x>"u"||t.call(p,x)},l=function(p,m){n&&m.name==="__proto__"?n(p,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):p[m.name]=m.newValue},c=function(p,m){if(m==="__proto__")if(t.call(p,m)){if(i)return i(p,m).value}else return;return p[m]};return Zx=function d(){var p,m,g,x,v,E,A=arguments[0],C=1,w=arguments.length,k=!1;for(typeof A=="boolean"&&(k=A,A=arguments[1]||{},C=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});C<w;++C)if(p=arguments[C],p!=null)for(m in p)g=c(A,m),x=c(p,m),A!==x&&(k&&x&&(s(x)||(v=r(x)))?(v?(v=!1,E=g&&r(g)?g:[]):E=g&&s(g)?g:{},l(A,{name:m,newValue:d(k,E,x)})):typeof x<"u"&&l(A,{name:m,newValue:x}));return A},Zx}var t7=e7();const $x=lu(t7);function c_(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function n7(){const t=[],e={run:n,use:i};return e;function n(...r){let s=-1;const l=r.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...r);function c(d,...p){const m=t[++s];let g=-1;if(d){l(d);return}for(;++g<r.length;)(p[g]===null||p[g]===void 0)&&(p[g]=r[g]);r=p,m?i7(m,c)(...p):l(null,...p)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return t.push(r),e}}function i7(t,e){let n;return i;function i(...l){const c=t.length>l.length;let d;c&&l.push(r);try{d=t.apply(this,l)}catch(p){const m=p;if(c&&n)throw m;return r(m)}c||(d&&d.then&&typeof d.then=="function"?d.then(s,r):d instanceof Error?r(d):s(d))}function r(l,...c){n||(n=!0,e(l,...c))}function s(l){r(null,l)}}const so={basename:r7,dirname:a7,extname:s7,join:l7,sep:"/"};function r7(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Wm(t);let n=0,i=-1,r=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;r--;)if(t.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":t.slice(n,i)}if(e===t)return"";let l=-1,c=e.length-1;for(;r--;)if(t.codePointAt(r)===47){if(s){n=r+1;break}}else l<0&&(s=!0,l=r+1),c>-1&&(t.codePointAt(r)===e.codePointAt(c--)?c<0&&(i=r):(c=-1,i=l));return n===i?i=l:i<0&&(i=t.length),t.slice(n,i)}function a7(t){if(Wm(t),t.length===0)return".";let e=-1,n=t.length,i;for(;--n;)if(t.codePointAt(n)===47){if(i){e=n;break}}else i||(i=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function s7(t){Wm(t);let e=t.length,n=-1,i=0,r=-1,s=0,l;for(;e--;){const c=t.codePointAt(e);if(c===47){if(l){i=e+1;break}continue}n<0&&(l=!0,n=e+1),c===46?r<0?r=e:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":t.slice(r,n)}function l7(...t){let e=-1,n;for(;++e<t.length;)Wm(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":o7(n)}function o7(t){Wm(t);const e=t.codePointAt(0)===47;let n=c7(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function c7(t,e){let n="",i=0,r=-1,s=0,l=-1,c,d;for(;++l<=t.length;){if(l<t.length)c=t.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(r===l-1||s===1))if(r!==l-1&&s===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),r=l,s=0;continue}}else if(n.length>0){n="",i=0,r=l,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+t.slice(r+1,l):n=t.slice(r+1,l),i=l-r-1;r=l,s=0}else c===46&&s>-1?s++:s=-1}return n}function Wm(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const u7={cwd:f7};function f7(){return"/"}function u_(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function d7(t){if(typeof t=="string")t=new URL(t);else if(!u_(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return h7(t)}function h7(t){if(t.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const i=e.codePointAt(n+2);if(i===70||i===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(e)}const Qx=["history","path","basename","stem","extname","dirname"];class KM{constructor(e){let n;e?u_(e)?n={path:e}:typeof e=="string"||p7(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":u7.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Qx.length;){const s=Qx[i];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let r;for(r in n)Qx.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?so.basename(this.path):void 0}set basename(e){ev(e,"basename"),Jx(e,"basename"),this.path=so.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?so.dirname(this.path):void 0}set dirname(e){S2(this.basename,"dirname"),this.path=so.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?so.extname(this.path):void 0}set extname(e){if(Jx(e,"extname"),S2(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=so.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){u_(e)&&(e=d7(e)),ev(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?so.basename(this.path,this.extname):void 0}set stem(e){ev(e,"stem"),Jx(e,"stem"),this.path=so.join(this.dirname||"",e+(this.extname||""))}fail(e,n,i){const r=this.message(e,n,i);throw r.fatal=!0,r}info(e,n,i){const r=this.message(e,n,i);return r.fatal=void 0,r}message(e,n,i){const r=new Br(e,n,i);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Jx(t,e){if(t&&t.includes(so.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+so.sep+"`")}function ev(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function S2(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function p7(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const m7=(function(t){const i=this.constructor.prototype,r=i[t],s=function(){return r.apply(s,arguments)};return Object.setPrototypeOf(s,i),s}),g7={}.hasOwnProperty;class m1 extends m7{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=n7()}copy(){const e=new m1;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];e.use(...i)}return e.data($x(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(iv("data",this.frozen),this.namespace[e]=n,this):g7.call(this.namespace,e)&&this.namespace[e]||void 0:e?(iv("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=n.call(e,...i);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Gy(e),i=this.parser||this.Parser;return tv("parse",i),i(String(n),n)}process(e,n){const i=this;return this.freeze(),tv("process",this.parser||this.Parser),nv("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(s,l){const c=Gy(e),d=i.parse(c);i.run(d,c,function(m,g,x){if(m||!g||!x)return p(m);const v=g,E=i.stringify(v,x);x7(E)?x.value=E:x.result=E,p(m,x)});function p(m,g){m||!g?l(m):s?s(g):n(void 0,g)}}}processSync(e){let n=!1,i;return this.freeze(),tv("processSync",this.parser||this.Parser),nv("processSync",this.compiler||this.Compiler),this.process(e,r),w2("processSync","process",n),i;function r(s,l){n=!0,v2(s),i=l}}run(e,n,i){E2(e),this.freeze();const r=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?s(void 0,i):new Promise(s);function s(l,c){const d=Gy(n);r.run(e,d,p);function p(m,g,x){const v=g||e;m?c(m):l?l(v):i(void 0,v,x)}}}runSync(e,n){let i=!1,r;return this.run(e,n,s),w2("runSync","run",i),r;function s(l,c){v2(l),r=c,i=!0}}stringify(e,n){this.freeze();const i=Gy(n),r=this.compiler||this.Compiler;return nv("stringify",r),E2(e),r(e,i)}use(e,...n){const i=this.attachers,r=this.namespace;if(iv("use",this.frozen),e!=null)if(typeof e=="function")d(e,n);else if(typeof e=="object")Array.isArray(e)?c(e):l(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(p){if(typeof p=="function")d(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[m,...g]=p;d(m,g)}else l(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function l(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(p.plugins),p.settings&&(r.settings=$x(!0,r.settings,p.settings))}function c(p){let m=-1;if(p!=null)if(Array.isArray(p))for(;++m<p.length;){const g=p[m];s(g)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function d(p,m){let g=-1,x=-1;for(;++g<i.length;)if(i[g][0]===p){x=g;break}if(x===-1)i.push([p,...m]);else if(m.length>0){let[v,...E]=m;const A=i[x][1];c_(A)&&c_(v)&&(v=$x(!0,A,v)),i[x]=[p,v,...E]}}}}const y7=new m1().freeze();function tv(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function nv(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function iv(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function E2(t){if(!c_(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function w2(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Gy(t){return b7(t)?t:new KM(t)}function b7(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function x7(t){return typeof t=="string"||v7(t)}function v7(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const _7="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",T2=[],C2={allowDangerousHtml:!0},S7=/^(https?|ircs?|mailto|xmpp)$/i,E7=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function w7(t){const e=T7(t),n=C7(t);return A7(e.runSync(e.parse(n),n),t)}function T7(t){const e=t.rehypePlugins||T2,n=t.remarkPlugins||T2,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...C2}:C2;return y7().use(aH).use(n).use(JH,i).use(e)}function C7(t){const e=t.children||"",n=new KM;return typeof e=="string"&&(n.value=e),n}function A7(t,e){const n=e.allowedElements,i=e.allowElement,r=e.components,s=e.disallowedElements,l=e.skipHtml,c=e.unwrapDisallowed,d=e.urlTransform||M7;for(const m of E7)Object.hasOwn(e,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+_7+m.id,void 0);return ib(t,p),G8(t,{Fragment:R.Fragment,components:r,ignoreInvalidStyle:!0,jsx:R.jsx,jsxs:R.jsxs,passKeys:!0,passNode:!0});function p(m,g,x){if(m.type==="raw"&&x&&typeof g=="number")return l?x.children.splice(g,1):x.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let v;for(v in Xx)if(Object.hasOwn(Xx,v)&&Object.hasOwn(m.properties,v)){const E=m.properties[v],A=Xx[v];(A===null||A.includes(m.tagName))&&(m.properties[v]=d(String(E||""),v,m))}}if(m.type==="element"){let v=n?!n.includes(m.tagName):s?s.includes(m.tagName):!1;if(!v&&i&&typeof g=="number"&&(v=!i(m,g,x)),v&&x&&typeof g=="number")return c&&m.children?x.children.splice(g,1,...m.children):x.children.splice(g,1),g}}}function M7(t){const e=t.indexOf(":"),n=t.indexOf("?"),i=t.indexOf("#"),r=t.indexOf("/");return e===-1||r!==-1&&e>r||n!==-1&&e>n||i!==-1&&e>i||S7.test(t.slice(0,e))?t:""}function A2(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(e);for(;r!==-1;)i++,r=n.indexOf(e,r+e.length);return i}function N7(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function R7(t,e,n){const r=Km((n||{}).ignore||[]),s=k7(e);let l=-1;for(;++l<s.length;)XM(t,"text",c);function c(p,m){let g=-1,x;for(;++g<m.length;){const v=m[g],E=x?x.children:void 0;if(r(v,E?E.indexOf(v):void 0,x))return;x=v}if(x)return d(p,m)}function d(p,m){const g=m[m.length-1],x=s[l][0],v=s[l][1];let E=0;const C=g.children.indexOf(p);let w=!1,k=[];x.lastIndex=0;let N=x.exec(p.value);for(;N;){const D=N.index,H={index:N.index,input:N.input,stack:[...m,p]};let z=v(...N,H);if(typeof z=="string"&&(z=z.length>0?{type:"text",value:z}:void 0),z===!1?x.lastIndex=D+1:(E!==D&&k.push({type:"text",value:p.value.slice(E,D)}),Array.isArray(z)?k.push(...z):z&&k.push(z),E=D+N[0].length,w=!0),!x.global)break;N=x.exec(p.value)}return w?(E<p.value.length&&k.push({type:"text",value:p.value.slice(E)}),g.children.splice(C,1,...k)):k=[p],C+k.length}}function k7(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let i=-1;for(;++i<n.length;){const r=n[i];e.push([O7(r[0]),D7(r[1])])}return e}function O7(t){return typeof t=="string"?new RegExp(N7(t),"g"):t}function D7(t){return typeof t=="function"?t:function(){return t}}const rv="phrasing",av=["autolink","link","image","label"];function z7(){return{transforms:[P7],enter:{literalAutolink:L7,literalAutolinkEmail:sv,literalAutolinkHttp:sv,literalAutolinkWww:sv},exit:{literalAutolink:j7,literalAutolinkEmail:H7,literalAutolinkHttp:U7,literalAutolinkWww:I7}}}function B7(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:rv,notInConstruct:av},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:rv,notInConstruct:av},{character:":",before:"[ps]",after:"\\/",inConstruct:rv,notInConstruct:av}]}}function L7(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function sv(t){this.config.enter.autolinkProtocol.call(this,t)}function U7(t){this.config.exit.autolinkProtocol.call(this,t)}function I7(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function H7(t){this.config.exit.autolinkEmail.call(this,t)}function j7(t){this.exit(t)}function P7(t){R7(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,G7],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),F7]],{ignore:["link","linkReference"]})}function G7(t,e,n,i,r){let s="";if(!WM(r)||(/^w/i.test(e)&&(n=e+n,e="",s="http://"),!q7(n)))return!1;const l=Y7(n+i);if(!l[0])return!1;const c={type:"link",title:null,url:s+e+l[0],children:[{type:"text",value:e+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function F7(t,e,n,i){return!WM(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function q7(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function Y7(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],i=n.indexOf(")");const r=A2(t,"(");let s=A2(t,")");for(;i!==-1&&r>s;)t+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[t,n]}function WM(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||yf(n)||J0(n))&&(!e||n!==47)}ZM.peek=ej;function V7(){this.buffer()}function X7(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function K7(){this.buffer()}function W7(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Z7(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gl(this.sliceSerialize(t)).toLowerCase(),n.label=e}function $7(t){this.exit(t)}function Q7(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=gl(this.sliceSerialize(t)).toLowerCase(),n.label=e}function J7(t){this.exit(t)}function ej(){return"["}function ZM(t,e,n,i){const r=n.createTracker(i);let s=r.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return s+=r.move(n.safe(n.associationId(t),{after:"]",before:s})),c(),l(),s+=r.move("]"),s}function tj(){return{enter:{gfmFootnoteCallString:V7,gfmFootnoteCall:X7,gfmFootnoteDefinitionLabelString:K7,gfmFootnoteDefinition:W7},exit:{gfmFootnoteCallString:Z7,gfmFootnoteCall:$7,gfmFootnoteDefinitionLabelString:Q7,gfmFootnoteDefinition:J7}}}function nj(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:ZM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,l){const c=s.createTracker(l);let d=c.move("[^");const p=s.enter("footnoteDefinition"),m=s.enter("label");return d+=c.move(s.safe(s.associationId(i),{before:d,after:"]"})),m(),d+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),d+=c.move((e?`
358
- `:" ")+s.indentLines(s.containerFlow(i,c.current()),e?$M:ij))),p(),d}}function ij(t,e,n){return e===0?t:$M(t,e,n)}function $M(t,e,n){return(n?"":" ")+t}const rj=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];QM.peek=cj;function aj(){return{canContainEols:["delete"],enter:{strikethrough:lj},exit:{strikethrough:oj}}}function sj(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:rj}],handlers:{delete:QM}}}function lj(t){this.enter({type:"delete",children:[]},t)}function oj(t){this.exit(t)}function QM(t,e,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let l=r.move("~~");return l+=n.containerPhrasing(t,{...r.current(),before:l,after:"~"}),l+=r.move("~~"),s(),l}function cj(){return"~"}function uj(t){return t.length}function fj(t,e){const n=e||{},i=(n.align||[]).concat(),r=n.stringLength||uj,s=[],l=[],c=[],d=[];let p=0,m=-1;for(;++m<t.length;){const A=[],C=[];let w=-1;for(t[m].length>p&&(p=t[m].length);++w<t[m].length;){const k=dj(t[m][w]);if(n.alignDelimiters!==!1){const N=r(k);C[w]=N,(d[w]===void 0||N>d[w])&&(d[w]=N)}A.push(k)}l[m]=A,c[m]=C}let g=-1;if(typeof i=="object"&&"length"in i)for(;++g<p;)s[g]=M2(i[g]);else{const A=M2(i);for(;++g<p;)s[g]=A}g=-1;const x=[],v=[];for(;++g<p;){const A=s[g];let C="",w="";A===99?(C=":",w=":"):A===108?C=":":A===114&&(w=":");let k=n.alignDelimiters===!1?1:Math.max(1,d[g]-C.length-w.length);const N=C+"-".repeat(k)+w;n.alignDelimiters!==!1&&(k=C.length+k+w.length,k>d[g]&&(d[g]=k),v[g]=k),x[g]=N}l.splice(1,0,x),c.splice(1,0,v),m=-1;const E=[];for(;++m<l.length;){const A=l[m],C=c[m];g=-1;const w=[];for(;++g<p;){const k=A[g]||"";let N="",D="";if(n.alignDelimiters!==!1){const H=d[g]-(C[g]||0),z=s[g];z===114?N=" ".repeat(H):z===99?H%2?(N=" ".repeat(H/2+.5),D=" ".repeat(H/2-.5)):(N=" ".repeat(H/2),D=N):D=" ".repeat(H)}n.delimiterStart!==!1&&!g&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&k==="")&&(n.delimiterStart!==!1||g)&&w.push(" "),n.alignDelimiters!==!1&&w.push(N),w.push(k),n.alignDelimiters!==!1&&w.push(D),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||g!==p-1)&&w.push("|")}E.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return E.join(`
359
- `)}function dj(t){return t==null?"":String(t)}function M2(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function hj(t,e,n,i){const r=n.enter("blockquote"),s=n.createTracker(i);s.move("> "),s.shift(2);const l=n.indentLines(n.containerFlow(t,s.current()),pj);return r(),l}function pj(t,e,n){return">"+(n?"":" ")+t}function mj(t,e){return N2(t,e.inConstruct,!0)&&!N2(t,e.notInConstruct,!1)}function N2(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let i=-1;for(;++i<e.length;)if(t.includes(e[i]))return!0;return!1}function R2(t,e,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
360
- `&&mj(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
361
- `}function gj(t,e){const n=String(t);let i=n.indexOf(e),r=i,s=0,l=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++s>l&&(l=s):s=1,r=i+e.length,i=n.indexOf(e,r);return l}function yj(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function bj(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function xj(t,e,n,i){const r=bj(n),s=t.value||"",l=r==="`"?"GraveAccent":"Tilde";if(yj(t,n)){const g=n.enter("codeIndented"),x=n.indentLines(s,vj);return g(),x}const c=n.createTracker(i),d=r.repeat(Math.max(gj(s,r)+1,3)),p=n.enter("codeFenced");let m=c.move(d);if(t.lang){const g=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(t.lang,{before:m,after:" ",encode:["`"],...c.current()})),g()}if(t.lang&&t.meta){const g=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(t.meta,{before:m,after:`
362
- `,encode:["`"],...c.current()})),g()}return m+=c.move(`
363
- `),s&&(m+=c.move(s+`
364
- `)),m+=c.move(d),p(),m}function vj(t,e,n){return(n?"":" ")+t}function g1(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function _j(t,e,n,i){const r=g1(n),s=r==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const d=n.createTracker(i);let p=d.move("[");return p+=d.move(n.safe(n.associationId(t),{before:p,after:"]",...d.current()})),p+=d.move("]: "),c(),!t.url||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(n.safe(t.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(c=n.enter("destinationRaw"),p+=d.move(n.safe(t.url,{before:p,after:t.title?" ":`
365
- `,...d.current()}))),c(),t.title&&(c=n.enter(`title${s}`),p+=d.move(" "+r),p+=d.move(n.safe(t.title,{before:p,after:r,...d.current()})),p+=d.move(r),c()),l(),p}function Sj(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function km(t){return"&#x"+t.toString(16).toUpperCase()+";"}function M0(t,e,n){const i=sh(t),r=sh(e);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}JM.peek=Ej;function JM(t,e,n,i){const r=Sj(n),s=n.enter("emphasis"),l=n.createTracker(i),c=l.move(r);let d=l.move(n.containerPhrasing(t,{after:r,before:c,...l.current()}));const p=d.charCodeAt(0),m=M0(i.before.charCodeAt(i.before.length-1),p,r);m.inside&&(d=km(p)+d.slice(1));const g=d.charCodeAt(d.length-1),x=M0(i.after.charCodeAt(0),g,r);x.inside&&(d=d.slice(0,-1)+km(g));const v=l.move(r);return s(),n.attentionEncodeSurroundingInfo={after:x.outside,before:m.outside},c+d+v}function Ej(t,e,n){return n.options.emphasis||"*"}function wj(t,e){let n=!1;return ib(t,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,l_}),!!((!t.depth||t.depth<3)&&o1(t)&&(e.options.setext||n))}function Tj(t,e,n,i){const r=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(i);if(wj(t,n)){const m=n.enter("headingSetext"),g=n.enter("phrasing"),x=n.containerPhrasing(t,{...s.current(),before:`
366
- `,after:`
367
- `});return g(),m(),x+`
368
- `+(r===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
369
- `))+1))}const l="#".repeat(r),c=n.enter("headingAtx"),d=n.enter("phrasing");s.move(l+" ");let p=n.containerPhrasing(t,{before:"# ",after:`
370
- `,...s.current()});return/^[\t ]/.test(p)&&(p=km(p.charCodeAt(0))+p.slice(1)),p=p?l+" "+p:l,n.options.closeAtx&&(p+=" "+l),d(),c(),p}eN.peek=Cj;function eN(t){return t.value||""}function Cj(){return"<"}tN.peek=Aj;function tN(t,e,n,i){const r=g1(n),s=r==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(i);let p=d.move("![");return p+=d.move(n.safe(t.alt,{before:p,after:"]",...d.current()})),p+=d.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(n.safe(t.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(c=n.enter("destinationRaw"),p+=d.move(n.safe(t.url,{before:p,after:t.title?" ":")",...d.current()}))),c(),t.title&&(c=n.enter(`title${s}`),p+=d.move(" "+r),p+=d.move(n.safe(t.title,{before:p,after:r,...d.current()})),p+=d.move(r),c()),p+=d.move(")"),l(),p}function Aj(){return"!"}nN.peek=Mj;function nN(t,e,n,i){const r=t.referenceType,s=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(i);let d=c.move("![");const p=n.safe(t.alt,{before:d,after:"]",...c.current()});d+=c.move(p+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(t),{before:d,after:"]",...c.current()});return l(),n.stack=m,s(),r==="full"||!p||p!==g?d+=c.move(g+"]"):r==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function Mj(){return"!"}iN.peek=Nj;function iN(t,e,n){let i=t.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s<n.unsafe.length;){const l=n.unsafe[s],c=n.compilePattern(l);let d;if(l.atBreak)for(;d=c.exec(i);){let p=d.index;i.charCodeAt(p)===10&&i.charCodeAt(p-1)===13&&p--,i=i.slice(0,p)+" "+i.slice(d.index+1)}}return r+i+r}function Nj(){return"`"}function rN(t,e){const n=o1(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}aN.peek=Rj;function aN(t,e,n,i){const r=g1(n),s=r==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let c,d;if(rN(t,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let g=l.move("<");return g+=l.move(n.containerPhrasing(t,{before:g,after:">",...l.current()})),g+=l.move(">"),c(),n.stack=m,g}c=n.enter("link"),d=n.enter("label");let p=l.move("[");return p+=l.move(n.containerPhrasing(t,{before:p,after:"](",...l.current()})),p+=l.move("]("),d(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(d=n.enter("destinationLiteral"),p+=l.move("<"),p+=l.move(n.safe(t.url,{before:p,after:">",...l.current()})),p+=l.move(">")):(d=n.enter("destinationRaw"),p+=l.move(n.safe(t.url,{before:p,after:t.title?" ":")",...l.current()}))),d(),t.title&&(d=n.enter(`title${s}`),p+=l.move(" "+r),p+=l.move(n.safe(t.title,{before:p,after:r,...l.current()})),p+=l.move(r),d()),p+=l.move(")"),c(),p}function Rj(t,e,n){return rN(t,n)?"<":"["}sN.peek=kj;function sN(t,e,n,i){const r=t.referenceType,s=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(i);let d=c.move("[");const p=n.containerPhrasing(t,{before:d,after:"]",...c.current()});d+=c.move(p+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(t),{before:d,after:"]",...c.current()});return l(),n.stack=m,s(),r==="full"||!p||p!==g?d+=c.move(g+"]"):r==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function kj(){return"["}function y1(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Oj(t){const e=y1(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Dj(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function lN(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function zj(t,e,n,i){const r=n.enter("list"),s=n.bulletCurrent;let l=t.ordered?Dj(n):y1(n);const c=t.ordered?l==="."?")":".":Oj(n);let d=e&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!t.ordered){const m=t.children?t.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),lN(n)===l&&m){let g=-1;for(;++g<t.children.length;){const x=t.children[g];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=c),n.bulletCurrent=l;const p=n.containerFlow(t,i);return n.bulletLastUsed=l,n.bulletCurrent=s,r(),p}function Bj(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function Lj(t,e,n,i){const r=Bj(n);let s=n.bulletCurrent||y1(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let l=s.length+1;(r==="tab"||r==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(i);c.move(s+" ".repeat(l-s.length)),c.shift(l);const d=n.enter("listItem"),p=n.indentLines(n.containerFlow(t,c.current()),m);return d(),p;function m(g,x,v){return x?(v?"":" ".repeat(l))+g:(v?s:s+" ".repeat(l-s.length))+g}}function Uj(t,e,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(t,i);return s(),r(),l}const Ij=Km(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Hj(t,e,n,i){return(t.children.some(function(l){return Ij(l)})?n.containerPhrasing:n.containerFlow).call(n,t,i)}function jj(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}oN.peek=Pj;function oN(t,e,n,i){const r=jj(n),s=n.enter("strong"),l=n.createTracker(i),c=l.move(r+r);let d=l.move(n.containerPhrasing(t,{after:r,before:c,...l.current()}));const p=d.charCodeAt(0),m=M0(i.before.charCodeAt(i.before.length-1),p,r);m.inside&&(d=km(p)+d.slice(1));const g=d.charCodeAt(d.length-1),x=M0(i.after.charCodeAt(0),g,r);x.inside&&(d=d.slice(0,-1)+km(g));const v=l.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:x.outside,before:m.outside},c+d+v}function Pj(t,e,n){return n.options.strong||"*"}function Gj(t,e,n,i){return n.safe(t.value,i)}function Fj(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function qj(t,e,n){const i=(lN(n)+(n.options.ruleSpaces?" ":"")).repeat(Fj(n));return n.options.ruleSpaces?i.slice(0,-1):i}const cN={blockquote:hj,break:R2,code:xj,definition:_j,emphasis:JM,hardBreak:R2,heading:Tj,html:eN,image:tN,imageReference:nN,inlineCode:iN,link:aN,linkReference:sN,list:zj,listItem:Lj,paragraph:Uj,root:Hj,strong:oN,text:Gj,thematicBreak:qj};function Yj(){return{enter:{table:Vj,tableData:k2,tableHeader:k2,tableRow:Kj},exit:{codeText:Wj,table:Xj,tableData:lv,tableHeader:lv,tableRow:lv}}}function Vj(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function Xj(t){this.exit(t),this.data.inTable=void 0}function Kj(t){this.enter({type:"tableRow",children:[]},t)}function lv(t){this.exit(t)}function k2(t){this.enter({type:"tableCell",children:[]},t)}function Wj(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,Zj));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function Zj(t,e){return e==="|"?e:t}function $j(t){const e=t||{},n=e.tableCellPadding,i=e.tablePipeAlign,r=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
371
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:l,tableCell:d,tableRow:c}};function l(v,E,A,C){return p(m(v,A,C),v.align)}function c(v,E,A,C){const w=g(v,A,C),k=p([w]);return k.slice(0,k.indexOf(`
372
- `))}function d(v,E,A,C){const w=A.enter("tableCell"),k=A.enter("phrasing"),N=A.containerPhrasing(v,{...C,before:s,after:s});return k(),w(),N}function p(v,E){return fj(v,{align:E,alignDelimiters:i,padding:n,stringLength:r})}function m(v,E,A){const C=v.children;let w=-1;const k=[],N=E.enter("table");for(;++w<C.length;)k[w]=g(C[w],E,A);return N(),k}function g(v,E,A){const C=v.children;let w=-1;const k=[],N=E.enter("tableRow");for(;++w<C.length;)k[w]=d(C[w],v,E,A);return N(),k}function x(v,E,A){let C=cN.inlineCode(v,E,A);return A.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function Qj(){return{exit:{taskListCheckValueChecked:O2,taskListCheckValueUnchecked:O2,paragraph:e9}}}function Jj(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:t9}}}function O2(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function e9(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const r=e.children;let s=-1,l;for(;++s<r.length;){const c=r[s];if(c.type==="paragraph"){l=c;break}}l===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(t)}function t9(t,e,n,i){const r=t.children[0],s=typeof t.checked=="boolean"&&r&&r.type==="paragraph",l="["+(t.checked?"x":" ")+"] ",c=n.createTracker(i);s&&c.move(l);let d=cN.listItem(t,e,n,{...i,...c.current()});return s&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),d;function p(m){return m+l}}function n9(){return[z7(),tj(),aj(),Yj(),Qj()]}function i9(t){return{extensions:[B7(),nj(t),sj(),$j(t),Jj()]}}const r9={tokenize:u9,partial:!0},uN={tokenize:f9,partial:!0},fN={tokenize:d9,partial:!0},dN={tokenize:h9,partial:!0},a9={tokenize:p9,partial:!0},hN={name:"wwwAutolink",tokenize:o9,previous:mN},pN={name:"protocolAutolink",tokenize:c9,previous:gN},sc={name:"emailAutolink",tokenize:l9,previous:yN},po={};function s9(){return{text:po}}let tf=48;for(;tf<123;)po[tf]=sc,tf++,tf===58?tf=65:tf===91&&(tf=97);po[43]=sc;po[45]=sc;po[46]=sc;po[95]=sc;po[72]=[sc,pN];po[104]=[sc,pN];po[87]=[sc,hN];po[119]=[sc,hN];function l9(t,e,n){const i=this;let r,s;return l;function l(g){return!f_(g)||!yN.call(i,i.previous)||b1(i.events)?n(g):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),c(g))}function c(g){return f_(g)?(t.consume(g),c):g===64?(t.consume(g),d):n(g)}function d(g){return g===46?t.check(a9,m,p)(g):g===45||g===95||zr(g)?(s=!0,t.consume(g),d):m(g)}function p(g){return t.consume(g),r=!0,d}function m(g){return s&&r&&la(i.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(g)):n(g)}}function o9(t,e,n){const i=this;return r;function r(l){return l!==87&&l!==119||!mN.call(i,i.previous)||b1(i.events)?n(l):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(r9,t.attempt(uN,t.attempt(fN,s),n),n)(l))}function s(l){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(l)}}function c9(t,e,n){const i=this;let r="",s=!1;return l;function l(g){return(g===72||g===104)&&gN.call(i,i.previous)&&!b1(i.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),r+=String.fromCodePoint(g),t.consume(g),c):n(g)}function c(g){if(la(g)&&r.length<5)return r+=String.fromCodePoint(g),t.consume(g),c;if(g===58){const x=r.toLowerCase();if(x==="http"||x==="https")return t.consume(g),d}return n(g)}function d(g){return g===47?(t.consume(g),s?p:(s=!0,d)):n(g)}function p(g){return g===null||T0(g)||Dn(g)||yf(g)||J0(g)?n(g):t.attempt(uN,t.attempt(fN,m),n)(g)}function m(g){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(g)}}function u9(t,e,n){let i=0;return r;function r(l){return(l===87||l===119)&&i<3?(i++,t.consume(l),r):l===46&&i===3?(t.consume(l),s):n(l)}function s(l){return l===null?n(l):e(l)}}function f9(t,e,n){let i,r,s;return l;function l(p){return p===46||p===95?t.check(dN,d,c)(p):p===null||Dn(p)||yf(p)||p!==45&&J0(p)?d(p):(s=!0,t.consume(p),l)}function c(p){return p===95?i=!0:(r=i,i=void 0),t.consume(p),l}function d(p){return r||i||!s?n(p):e(p)}}function d9(t,e){let n=0,i=0;return r;function r(l){return l===40?(n++,t.consume(l),r):l===41&&i<n?s(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?t.check(dN,e,s)(l):l===null||Dn(l)||yf(l)?e(l):(t.consume(l),r)}function s(l){return l===41&&i++,t.consume(l),r}}function h9(t,e,n){return i;function i(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(t.consume(c),i):c===38?(t.consume(c),s):c===93?(t.consume(c),r):c===60||c===null||Dn(c)||yf(c)?e(c):n(c)}function r(c){return c===null||c===40||c===91||Dn(c)||yf(c)?e(c):i(c)}function s(c){return la(c)?l(c):n(c)}function l(c){return c===59?(t.consume(c),i):la(c)?(t.consume(c),l):n(c)}}function p9(t,e,n){return i;function i(s){return t.consume(s),r}function r(s){return zr(s)?n(s):e(s)}}function mN(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Dn(t)}function gN(t){return!la(t)}function yN(t){return!(t===47||f_(t))}function f_(t){return t===43||t===45||t===46||t===95||zr(t)}function b1(t){let e=t.length,n=!1;for(;e--;){const i=t[e][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const m9={tokenize:E9,partial:!0};function g9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:v9,continuation:{tokenize:_9},exit:S9}},text:{91:{name:"gfmFootnoteCall",tokenize:x9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:y9,resolveTo:b9}}}}function y9(t,e,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l;for(;r--;){const d=i.events[r][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!l||!l._balanced)return n(d);const p=gl(i.sliceSerialize({start:l.end,end:i.now()}));return p.codePointAt(0)!==94||!s.includes(p.slice(1))?n(d):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),e(d))}}function b9(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},t[t.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},c=[t[n+1],t[n+2],["enter",i,e],t[n+3],t[n+4],["enter",r,e],["exit",r,e],["enter",s,e],["enter",l,e],["exit",l,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",i,e]];return t.splice(n,t.length-n+1,...c),t}function x9(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,l;return c;function c(g){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),d}function d(g){return g!==94?n(g):(t.enter("gfmFootnoteCallMarker"),t.consume(g),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",p)}function p(g){if(s>999||g===93&&!l||g===null||g===91||Dn(g))return n(g);if(g===93){t.exit("chunkString");const x=t.exit("gfmFootnoteCallString");return r.includes(gl(i.sliceSerialize(x)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(g)}return Dn(g)||(l=!0),s++,t.consume(g),g===92?m:p}function m(g){return g===91||g===92||g===93?(t.consume(g),s++,p):p(g)}}function v9(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,l=0,c;return d;function d(E){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(E),t.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(E){return E===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(E),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",m):n(E)}function m(E){if(l>999||E===93&&!c||E===null||E===91||Dn(E))return n(E);if(E===93){t.exit("chunkString");const A=t.exit("gfmFootnoteDefinitionLabelString");return s=gl(i.sliceSerialize(A)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(E),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),x}return Dn(E)||(c=!0),l++,t.consume(E),E===92?g:m}function g(E){return E===91||E===92||E===93?(t.consume(E),l++,m):m(E)}function x(E){return E===58?(t.enter("definitionMarker"),t.consume(E),t.exit("definitionMarker"),r.includes(s)||r.push(s),Kt(t,v,"gfmFootnoteDefinitionWhitespace")):n(E)}function v(E){return e(E)}}function _9(t,e,n){return t.check(Xm,e,t.attempt(m9,e,n))}function S9(t){t.exit("gfmFootnoteDefinition")}function E9(t,e,n){const i=this;return Kt(t,r,"gfmFootnoteDefinitionIndent",5);function r(s){const l=i.events[i.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?e(s):n(s)}}function w9(t){let n=(t||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(l,c){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let p=d;for(;p--;)if(l[p][0]==="exit"&&l[p][1].type==="strikethroughSequenceTemporary"&&l[p][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[p][1].end.offset-l[p][1].start.offset){l[d][1].type="strikethroughSequence",l[p][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[p][1].start),end:Object.assign({},l[d][1].end)},g={type:"strikethroughText",start:Object.assign({},l[p][1].end),end:Object.assign({},l[d][1].start)},x=[["enter",m,c],["enter",l[p][1],c],["exit",l[p][1],c],["enter",g,c]],v=c.parser.constructs.insideSpan.null;v&&es(x,x.length,0,eb(v,l.slice(p+1,d),c)),es(x,x.length,0,[["exit",g,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",m,c]]),es(l,p-1,d-p+3,x),d=p+x.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function s(l,c,d){const p=this.previous,m=this.events;let g=0;return x;function x(E){return p===126&&m[m.length-1][1].type!=="characterEscape"?d(E):(l.enter("strikethroughSequenceTemporary"),v(E))}function v(E){const A=sh(p);if(E===126)return g>1?d(E):(l.consume(E),g++,v);if(g<2&&!n)return d(E);const C=l.exit("strikethroughSequenceTemporary"),w=sh(E);return C._open=!w||w===2&&!!A,C._close=!A||A===2&&!!w,c(E)}}}class T9{constructor(){this.map=[]}add(e,n,i){C9(this,e,n,i)}consume(e){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];i.push(e.slice()),e.length=0;let r=i.pop();for(;r;){for(const s of r)e.push(s);r=i.pop()}this.map.length=0}}function C9(t,e,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r<t.map.length;){if(t.map[r][0]===e){t.map[r][1]+=n,t.map[r][2].push(...i);return}r+=1}t.map.push([e,n,i])}}function A9(t,e){let n=!1;const i=[];for(;e<t.length;){const r=t[e];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&i.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=i.length-1;i[s]=i[s]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return i}function M9(){return{flow:{null:{name:"table",tokenize:N9,resolveAll:R9}}}}function N9(t,e,n){const i=this;let r=0,s=0,l;return c;function c(I){let V=i.events.length-1;for(;V>-1;){const q=i.events[V][1].type;if(q==="lineEnding"||q==="linePrefix")V--;else break}const X=V>-1?i.events[V][1].type:null,ne=X==="tableHead"||X==="tableRow"?z:d;return ne===z&&i.parser.lazy[i.now().line]?n(I):ne(I)}function d(I){return t.enter("tableHead"),t.enter("tableRow"),p(I)}function p(I){return I===124||(l=!0,s+=1),m(I)}function m(I){return I===null?n(I):st(I)?s>1?(s=0,i.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),v):n(I):Lt(I)?Kt(t,m,"whitespace")(I):(s+=1,l&&(l=!1,r+=1),I===124?(t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),l=!0,m):(t.enter("data"),g(I)))}function g(I){return I===null||I===124||Dn(I)?(t.exit("data"),m(I)):(t.consume(I),I===92?x:g)}function x(I){return I===92||I===124?(t.consume(I),g):g(I)}function v(I){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(I):(t.enter("tableDelimiterRow"),l=!1,Lt(I)?Kt(t,E,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):E(I))}function E(I){return I===45||I===58?C(I):I===124?(l=!0,t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),A):H(I)}function A(I){return Lt(I)?Kt(t,C,"whitespace")(I):C(I)}function C(I){return I===58?(s+=1,l=!0,t.enter("tableDelimiterMarker"),t.consume(I),t.exit("tableDelimiterMarker"),w):I===45?(s+=1,w(I)):I===null||st(I)?D(I):H(I)}function w(I){return I===45?(t.enter("tableDelimiterFiller"),k(I)):H(I)}function k(I){return I===45?(t.consume(I),k):I===58?(l=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(I),t.exit("tableDelimiterMarker"),N):(t.exit("tableDelimiterFiller"),N(I))}function N(I){return Lt(I)?Kt(t,D,"whitespace")(I):D(I)}function D(I){return I===124?E(I):I===null||st(I)?!l||r!==s?H(I):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(I)):H(I)}function H(I){return n(I)}function z(I){return t.enter("tableRow"),F(I)}function F(I){return I===124?(t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),F):I===null||st(I)?(t.exit("tableRow"),e(I)):Lt(I)?Kt(t,F,"whitespace")(I):(t.enter("data"),ee(I))}function ee(I){return I===null||I===124||Dn(I)?(t.exit("data"),F(I)):(t.consume(I),I===92?P:ee)}function P(I){return I===92||I===124?(t.consume(I),ee):ee(I)}}function R9(t,e){let n=-1,i=!0,r=0,s=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,p,m,g;const x=new T9;for(;++n<t.length;){const v=t[n],E=v[1];v[0]==="enter"?E.type==="tableHead"?(c=!1,d!==0&&(D2(x,e,d,p,m),m=void 0,d=0),p={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},x.add(n,0,[["enter",p,e]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(i=!0,g=void 0,s=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},x.add(n,0,[["enter",m,e]])),r=E.type==="tableDelimiterRow"?2:m?3:1):r&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],g=Fy(x,e,s,r,void 0,g),s=[0,0,0,0]),l[2]=n)):E.type==="tableCellDivider"&&(i?i=!1:(s[1]!==0&&(l[0]=l[1],g=Fy(x,e,s,r,void 0,g)),s=l,l=[s[1],n,0,0])):E.type==="tableHead"?(c=!0,d=n):E.type==="tableRow"||E.type==="tableDelimiterRow"?(d=n,s[1]!==0?(l[0]=l[1],g=Fy(x,e,s,r,n,g)):l[1]!==0&&(g=Fy(x,e,l,r,n,g)),r=0):r&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&D2(x,e,d,p,m),x.consume(e.events),n=-1;++n<e.events.length;){const v=e.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=A9(e.events,n))}return t}function Fy(t,e,n,i,r,s){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},Hd(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const d=Hd(e.events,n[1]);if(s={type:l,start:Object.assign({},d),end:Object.assign({},d)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const p=Hd(e.events,n[2]),m=Hd(e.events,n[3]),g={type:c,start:Object.assign({},p),end:Object.assign({},m)};if(t.add(n[2],0,[["enter",g,e]]),i!==2){const x=e.events[n[2]],v=e.events[n[3]];if(x[1].end=Object.assign({},v[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const E=n[2]+1,A=n[3]-n[2]-1;t.add(E,A,[])}}t.add(n[3]+1,0,[["exit",g,e]])}return r!==void 0&&(s.end=Object.assign({},Hd(e.events,r)),t.add(r,0,[["exit",s,e]]),s=void 0),s}function D2(t,e,n,i,r){const s=[],l=Hd(e.events,n);r&&(r.end=Object.assign({},l),s.push(["exit",r,e])),i.end=Object.assign({},l),s.push(["exit",i,e]),t.add(n+1,0,s)}function Hd(t,e){const n=t[e],i=n[0]==="enter"?"start":"end";return n[1][i]}const k9={name:"tasklistCheck",tokenize:D9};function O9(){return{text:{91:k9}}}function D9(t,e,n){const i=this;return r;function r(d){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(d):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(d),t.exit("taskListCheckMarker"),s)}function s(d){return Dn(d)?(t.enter("taskListCheckValueUnchecked"),t.consume(d),t.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(t.enter("taskListCheckValueChecked"),t.consume(d),t.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(t.enter("taskListCheckMarker"),t.consume(d),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),c):n(d)}function c(d){return st(d)?e(d):Lt(d)?t.check({tokenize:z9},e,n)(d):n(d)}}function z9(t,e,n){return Kt(t,i,"whitespace");function i(r){return r===null?n(r):e(r)}}function B9(t){return MM([s9(),g9(),w9(t),M9(),O9()])}const L9={};function U9(t){const e=this,n=t||L9,i=e.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(B9(n)),s.push(n9()),l.push(i9(n))}const z2=(function(t,e,n){const i=Km(n);if(!t||!t.type||!t.children)throw new Error("Expected parent node");if(typeof e=="number"){if(e<0||e===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(e=t.children.indexOf(e),e<0)throw new Error("Expected child node or index");for(;++e<t.children.length;)if(i(t.children[e],e,t))return t.children[e]}),Tf=(function(t){if(t==null)return j9;if(typeof t=="string")return H9(t);if(typeof t=="object")return I9(t);if(typeof t=="function")return x1(t);throw new Error("Expected function, string, or array as `test`")});function I9(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Tf(t[n]);return x1(i);function i(...r){let s=-1;for(;++s<e.length;)if(e[s].apply(this,r))return!0;return!1}}function H9(t){return x1(e);function e(n){return n.tagName===t}}function x1(t){return e;function e(n,i,r){return!!(P9(n)&&t.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function j9(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="element"&&"tagName"in t&&typeof t.tagName=="string")}function P9(t){return t!==null&&typeof t=="object"&&"type"in t&&"tagName"in t}const B2=/\n/g,L2=/[\t ]+/g,d_=Tf("br"),U2=Tf(W9),G9=Tf("p"),I2=Tf("tr"),F9=Tf(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",K9,Z9]),bN=Tf(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function q9(t,e){const n=e||{},i="children"in t?t.children:[],r=bN(t),s=_N(t,{whitespace:n.whitespace||"normal"}),l=[];(t.type==="text"||t.type==="comment")&&l.push(...vN(t,{breakBefore:!0,breakAfter:!0}));let c=-1;for(;++c<i.length;)l.push(...xN(i[c],t,{whitespace:s,breakBefore:c?void 0:r,breakAfter:c<i.length-1?d_(i[c+1]):r}));const d=[];let p;for(c=-1;++c<l.length;){const m=l[c];typeof m=="number"?p!==void 0&&m>p&&(p=m):m&&(p!==void 0&&p>-1&&d.push(`
373
- `.repeat(p)||" "),p=-1,d.push(m))}return d.join("")}function xN(t,e,n){return t.type==="element"?Y9(t,e,n):t.type==="text"?n.whitespace==="normal"?vN(t,n):V9(t):[]}function Y9(t,e,n){const i=_N(t,n),r=t.children||[];let s=-1,l=[];if(F9(t))return l;let c,d;for(d_(t)||I2(t)&&z2(e,t,I2)?d=`
374
- `:G9(t)?(c=2,d=2):bN(t)&&(c=1,d=1);++s<r.length;)l=l.concat(xN(r[s],t,{whitespace:i,breakBefore:s?void 0:c,breakAfter:s<r.length-1?d_(r[s+1]):d}));return U2(t)&&z2(e,t,U2)&&l.push(" "),c&&l.unshift(c),d&&l.push(d),l}function vN(t,e){const n=String(t.value),i=[],r=[];let s=0;for(;s<=n.length;){B2.lastIndex=s;const d=B2.exec(n),p=d&&"index"in d?d.index:n.length;i.push(X9(n.slice(s,p).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?e.breakBefore:!0,p===n.length?e.breakAfter:!0)),s=p+1}let l=-1,c;for(;++l<i.length;)i[l].charCodeAt(i[l].length-1)===8203||l<i.length-1&&i[l+1].charCodeAt(0)===8203?(r.push(i[l]),c=void 0):i[l]?(typeof c=="number"&&r.push(c),r.push(i[l]),c=0):(l===0||l===i.length-1)&&r.push(0);return r}function V9(t){return[String(t.value)]}function X9(t,e,n){const i=[];let r=0,s;for(;r<t.length;){L2.lastIndex=r;const l=L2.exec(t);s=l?l.index:t.length,!r&&!s&&l&&!e&&i.push(""),r!==s&&i.push(t.slice(r,s)),r=l?s+l[0].length:s}return r!==s&&!n&&i.push(""),i.join(" ")}function _N(t,e){if(t.type==="element"){const n=t.properties||{};switch(t.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":e.whitespace;case"textarea":return"pre-wrap"}}return e.whitespace}function K9(t){return!!(t.properties||{}).hidden}function W9(t){return t.tagName==="td"||t.tagName==="th"}function Z9(t){return t.tagName==="dialog"&&!(t.properties||{}).open}function $9(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+e.optional(r)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",c={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},m={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:e.optional(r)+t.IDENT_RE,relevance:0},v=e.optional(r)+t.IDENT_RE+"\\s*\\(",E=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],A=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],C=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],w=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],D={type:A,keyword:E,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},H={className:"function.dispatch",relevance:0,keywords:{_hint:w},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},z=[H,g,c,n,t.C_BLOCK_COMMENT_MODE,m,p],F={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:z.concat([{begin:/\(/,end:/\)/,keywords:D,contains:z.concat(["self"]),relevance:0}]),relevance:0},ee={className:"function",begin:"("+l+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:D,relevance:0},{begin:v,returnBegin:!0,contains:[x],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,m]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,p,m,c,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,p,m,c]}]},c,n,t.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:D,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(F,ee,H,z,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:D,contains:["self",c]},{begin:t.IDENT_RE+"::",keywords:D},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Q9(t){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=$9(t),i=n.keywords;return i.type=[...i.type,...e.type],i.literal=[...i.literal,...e.literal],i.built_in=[...i.built_in,...e.built_in],i._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function J9(t){const e=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),l={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,r]};r.contains.push(c);const d={match:/\\"/},p={className:"string",begin:/'/,end:/'/},m={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},x=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],v=t.SHEBANG({binary:`(${x.join("|")})`,relevance:10}),E={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},A=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],w={match:/(\/[a-z._-]+)+/},k=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],N=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],D=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],H=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:A,literal:C,built_in:[...k,...N,"set","shopt",...D,...H]},contains:[v,t.SHEBANG(),E,g,s,l,w,c,d,p,m,n]}}function eP(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="("+i+"|"+e.optional(r)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",c={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},m={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:e.optional(r)+t.IDENT_RE,relevance:0},v=e.optional(r)+t.IDENT_RE+"\\s*\\(",C={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},w=[g,c,n,t.C_BLOCK_COMMENT_MODE,m,p],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:w.concat([{begin:/\(/,end:/\)/,keywords:C,contains:w.concat(["self"]),relevance:0}]),relevance:0},N={begin:"("+l+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:C,relevance:0},{begin:v,returnBegin:!0,contains:[t.inherit(x,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,p,m,c,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,p,m,c]}]},c,n,t.C_BLOCK_COMMENT_MODE,g]};return{name:"C",aliases:["h"],keywords:C,disableAutodetect:!0,illegal:"</",contains:[].concat(k,N,w,[g,{begin:t.IDENT_RE+"::",keywords:C},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:g,strings:p,keywords:C}}}function tP(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",l="(?!struct)("+i+"|"+e.optional(r)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",c={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},m={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:e.optional(r)+t.IDENT_RE,relevance:0},v=e.optional(r)+t.IDENT_RE+"\\s*\\(",E=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],A=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],C=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],w=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],D={type:A,keyword:E,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},H={className:"function.dispatch",relevance:0,keywords:{_hint:w},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},z=[H,g,c,n,t.C_BLOCK_COMMENT_MODE,m,p],F={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:z.concat([{begin:/\(/,end:/\)/,keywords:D,contains:z.concat(["self"]),relevance:0}]),relevance:0},ee={className:"function",begin:"("+l+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:D,relevance:0},{begin:v,returnBegin:!0,contains:[x],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,m]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,p,m,c,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,p,m,c]}]},c,n,t.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:D,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(F,ee,H,z,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:D,contains:["self",c]},{begin:t.IDENT_RE+"::",keywords:D},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function nP(t){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],l={keyword:r.concat(s),built_in:e,literal:i},c=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),d={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},p={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},m={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},g=t.inherit(m,{illegal:/\n/}),x={className:"subst",begin:/\{/,end:/\}/,keywords:l},v=t.inherit(x,{illegal:/\n/}),E={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,v]},A={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]},C=t.inherit(A,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]});x.contains=[A,E,m,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,t.C_BLOCK_COMMENT_MODE],v.contains=[C,E,g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const w={variants:[p,A,E,m,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},k={begin:"<",end:">",contains:[{beginKeywords:"in out"},c]},N=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",D={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:l,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},w,d,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},c,k,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[c,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[c,k,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+N+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:l,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,k],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,relevance:0,contains:[w,d,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},D]}}const iP=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),rP=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],aP=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],sP=[...rP,...aP],lP=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),oP=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),cP=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),uP=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function fP(t){const e=t.regex,n=iP(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,l="[a-zA-Z-][a-zA-Z0-9_-]*",c=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+l,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+oP.join("|")+")"},{begin:":(:)?("+cP.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+uP.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:lP.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+sP.join("|")+")\\b"}]}}function dP(t){const e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function hP(t){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function pP(t){const e=t.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(n,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function mP(t){const e=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},i=t.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},c={begin:/\[/,end:/\]/,contains:[i,s,r,l,n,"self"],relevance:0},d=/[A-Za-z0-9_-]+/,p=/"(\\"|[^"])*"/,m=/'[^']*'/,g=e.either(d,p,m),x=e.concat(g,"(\\s*\\.\\s*",g,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:x,className:"attr",starts:{end:/$/,contains:[i,c,s,r,l,n]}}]}}var jd="[0-9](_*[0-9])*",qy=`\\.(${jd})`,Yy="[0-9a-fA-F](_*[0-9a-fA-F])*",H2={className:"number",variants:[{begin:`(\\b(${jd})((${qy})|\\.)?|(${qy}))[eE][+-]?(${jd})[fFdD]?\\b`},{begin:`\\b(${jd})((${qy})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${qy})[fFdD]?\\b`},{begin:`\\b(${jd})[fFdD]\\b`},{begin:`\\b0[xX]((${Yy})\\.?|(${Yy})?\\.(${Yy}))[pP][+-]?(${jd})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Yy})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function SN(t,e,n){return n===-1?"":t.replace(e,i=>SN(t,e,n-1))}function gP(t){const e=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+SN("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},p={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},m={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[m,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[p,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,H2,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},H2,p]}}const j2="[A-Za-z$_][0-9A-Za-z$_]*",yP=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],bP=["true","false","null","undefined","NaN","Infinity"],EN=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],wN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],TN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],xP=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],vP=[].concat(TN,EN,wN);function _P(t){const e=t.regex,n=(Z,{after:$})=>{const j="</"+Z[0].slice(1);return Z.input.indexOf(j,$)!==-1},i=j2,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Z,$)=>{const j=Z[0].length+Z.index,K=Z.input[j];if(K==="<"||K===","){$.ignoreMatch();return}K===">"&&(n(Z,{after:j})||$.ignoreMatch());let te;const U=Z.input.substring(j);if(te=U.match(/^\s*=/)){$.ignoreMatch();return}if((te=U.match(/^\s+extends\s+/))&&te.index===0){$.ignoreMatch();return}}},c={$pattern:j2,keyword:yP,literal:bP,built_in:vP,"variable.language":xP},d="[0-9](_?[0-9])*",p=`\\.(${d})`,m="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${m})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${m})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},x={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,x],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,x],subLanguage:"css"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,x],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,x]},k={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},N=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,E,A,C,{match:/\$\d+/},g];x.contains=N.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(N)});const D=[].concat(k,x.contains),H=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(D)}]),z={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:H},F={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...EN,...wN]}},P={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[z],illegal:/%/},V={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function X(Z){return e.concat("(?!",Z.join("|"),")")}const ne={match:e.concat(/\b/,X([...TN,"super","import"].map(Z=>`${Z}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Q={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},z]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",Y={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[z]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:H,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),P,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,E,A,C,k,{match:/\$\d+/},g,ee,{scope:"attr",match:i+e.lookahead(":"),relevance:0},Y,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,t.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:H}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[z,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[z]},ne,V,F,Q,{match:/\$[(.]/}]}}function SP(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[e,n,t.QUOTE_STRING_MODE,r,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Pd="[0-9](_*[0-9])*",Vy=`\\.(${Pd})`,Xy="[0-9a-fA-F](_*[0-9a-fA-F])*",EP={className:"number",variants:[{begin:`(\\b(${Pd})((${Vy})|\\.)?|(${Vy}))[eE][+-]?(${Pd})[fFdD]?\\b`},{begin:`\\b(${Pd})((${Vy})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Vy})[fFdD]?\\b`},{begin:`\\b(${Pd})[fFdD]\\b`},{begin:`\\b0[xX]((${Xy})\\.?|(${Xy})?\\.(${Xy}))[pP][+-]?(${Pd})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Xy})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function wP(t){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},l={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,r]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,s,r]}]};r.contains.push(l);const c={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},d={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(l,{className:"string"}),"self"]}]},p=EP,m=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),g={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},x=g;return x.variants[1].contains=[g],g.variants[1].contains=[x],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,m,n,i,c,d,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[g,t.C_LINE_COMMENT_MODE,m],relevance:0},t.C_LINE_COMMENT_MODE,m,c,d,l,t.C_NUMBER_MODE]},m]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},c,d]},l,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
375
- `},p]}}const TP=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),CP=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],AP=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],MP=[...CP,...AP],NP=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),CN=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),AN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),RP=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),kP=CN.concat(AN).sort().reverse();function OP(t){const e=TP(t),n=kP,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",l=[],c=[],d=function(N){return{className:"string",begin:"~?"+N+".*?"+N}},p=function(N,D,H){return{className:N,begin:D,relevance:H}},m={$pattern:/[a-z-]+/,keyword:i,attribute:NP.join(" ")},g={begin:"\\(",end:"\\)",contains:c,keywords:m,relevance:0};c.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,d("'"),d('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,g,p("variable","@@?"+r,10),p("variable","@\\{"+r+"\\}"),p("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const x=c.concat({begin:/\{/,end:/\}/,contains:l}),v={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(c)},E={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+RP.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:c}}]},A={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:m,returnEnd:!0,contains:c,relevance:0}},C={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:x}},w={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,v,p("keyword","all\\b"),p("variable","@\\{"+r+"\\}"),{begin:"\\b("+MP.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,p("selector-tag",s,0),p("selector-id","#"+s),p("selector-class","\\."+s,0),p("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+CN.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+AN.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:x},{begin:"!important"},e.FUNCTION_DISPATCH]},k={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[w]};return l.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,A,C,k,E,w,v,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:l}}function DP(t){const e="\\[=*\\[",n="\\]=*\\]",i={begin:e,end:n,contains:["self"]},r=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[i],relevance:5}])}}function zP(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},i={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,n]},r={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},l={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,n,i,r,s,l]}}function BP(t){const e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},l={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},m={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=t.inherit(p,{contains:[]}),x=t.inherit(m,{contains:[]});p.contains.push(x),m.contains.push(g);let v=[n,d];return[p,m,g,x].forEach(w=>{w.contains=w.contains.concat(v)}),v=v.concat(p,m),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:v},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:v}]}]},n,s,p,m,{className:"quote",begin:"^>\\s+",contains:v,end:"$"},r,i,d,l,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function LP(t){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,c={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},d={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:c,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+d.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:d,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function UP(t){const e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},l={begin:/->\{/,end:/\}/},c={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},d={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[c]},p={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},m=[t.BACKSLASH_ESCAPE,s,d],g=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],x=(A,C,w="\\1")=>{const k=w==="\\1"?w:e.concat(w,C);return e.concat(e.concat("(?:",A,")"),C,/(?:\\.|[^\\\/])*?/,k,/(?:\\.|[^\\\/])*?/,w,i)},v=(A,C,w)=>e.concat(e.concat("(?:",A,")"),C,/(?:\\.|[^\\\/])*?/,w,i),E=[d,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),l,{className:"string",contains:m,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},p,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:x("s|tr|y",e.either(...g,{capture:!0}))},{begin:x("s|tr|y","\\(","\\)")},{begin:x("s|tr|y","\\[","\\]")},{begin:x("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:v("(?:m|qr)?",/\//,/\//)},{begin:v("m|qr",e.either(...g,{capture:!0}),/\1/)},{begin:v("m|qr",/\(/,/\)/)},{begin:v("m|qr",/\[/,/\]/)},{begin:v("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,c]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,c,p]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=E,l.contains=E,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:E}}function IP(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,i=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=e.concat(/[A-Z]+/,n),l={scope:"variable",match:"\\$+"+i},c={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},d={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},p=t.inherit(t.APOS_STRING_MODE,{illegal:null}),m=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(d)}),g={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(d),"on:begin":(q,Q)=>{Q.data._beginMatch=q[1]||q[2]},"on:end":(q,Q)=>{Q.data._beginMatch!==q[1]&&Q.ignoreMatch()}},x=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),v=`[
376
- ]`,E={scope:"string",variants:[m,p,g,x]},A={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},C=["false","null","true"],w=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],k=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],D={keyword:w,literal:(q=>{const Q=[];return q.forEach(B=>{Q.push(B),B.toLowerCase()===B?Q.push(B.toUpperCase()):Q.push(B.toLowerCase())}),Q})(C),built_in:k},H=q=>q.map(Q=>Q.replace(/\|\d+$/,"")),z={variants:[{match:[/new/,e.concat(v,"+"),e.concat("(?!",H(k).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},F=e.concat(i,"\\b(?!\\()"),ee={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),F],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,e.concat(/::/,e.lookahead(/(?!class\b)/)),F],scope:{1:"title.class",3:"variable.constant"}},{match:[r,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},P={scope:"attr",match:e.concat(i,e.lookahead(":"),e.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:D,contains:[P,l,ee,t.C_BLOCK_COMMENT_MODE,E,A,z]},V={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",H(w).join("\\b|"),"|",H(k).join("\\b|"),"\\b)"),i,e.concat(v,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(V);const X=[P,ee,t.C_BLOCK_COMMENT_MODE,E,A,z],ne={begin:e.concat(/#\[\s*\\?/,e.either(r,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:C,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:C,keyword:["new","array"]},contains:["self",...X]},...X,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:D,contains:[ne,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},c,{scope:"variable.language",match:/\$this\b/},l,V,ee,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},z,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:D,contains:["self",ne,l,ee,t.C_BLOCK_COMMENT_MODE,E,A]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},E,A]}}function HP(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function jP(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function PP(t){const e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},m={begin:/\{\{/,relevance:0},g={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,m,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,m,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,m,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,m,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},x="[0-9](_?[0-9])*",v=`(\\b(${x}))?\\.(${x})|\\b(${x})\\.`,E=`\\b|${i.join("|")}`,A={className:"number",relevance:0,variants:[{begin:`(\\b(${x})|(${v}))[eE][+-]?(${x})[jJ]?(?=${E})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${E})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${E})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${E})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${E})`},{begin:`\\b(${x})[jJ](?=${E})`}]},C={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},w={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",d,A,g,t.HASH_COMMENT_MODE]}]};return p.contains=[g,A,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[d,A,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,C,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[w]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[A,w,g]}]}}function GP(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function FP(t){const e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[s,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function qP(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=e.concat(i,/(::\w+)*/),l={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},c={className:"doctag",begin:"@[A-Za-z]+"},d={begin:"#<",end:">"},p=[t.COMMENT("#","$",{contains:[c]}),t.COMMENT("^=begin","^=end",{contains:[c],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],m={className:"subst",begin:/#\{/,end:/\}/,keywords:l},g={className:"string",contains:[t.BACKSLASH_ESCAPE,m],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,m]})]}]},x="[1-9](_?[0-9])*|0",v="[0-9](_?[0-9])*",E={className:"number",relevance:0,variants:[{begin:`\\b(${x})(\\.(${v}))?([eE][+-]?(${v})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},A={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:l}]},z=[g,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:l},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:l},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[A]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{begin:n}],relevance:0},E,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:l},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,m],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(d,p),relevance:0}].concat(d,p);m.contains=z,A.contains=z;const I=[{begin:/^\s*=>/,starts:{end:"$",contains:z}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:l,contains:z}}];return p.unshift(d),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:l,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(I).concat(p).concat(z)}}function YP(t){const e=t.regex,n=/(r#)?/,i=e.concat(n,t.UNDERSCORE_IDENT_RE),r=e.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,e.lookahead(/\s*\(/))},l="([ui](8|16|32|64|128|size)|f(32|64))?",c=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],m=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:m,keyword:c,literal:d,built_in:p},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+l},{begin:"\\b0o([0-7_]+)"+l},{begin:"\\b0x([A-Fa-f0-9_]+)"+l},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+l}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:m}},{className:"punctuation",begin:"->"},s]}}const VP=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),XP=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],KP=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],WP=[...XP,...KP],ZP=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),$P=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),QP=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),JP=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function eG(t){const e=VP(t),n=QP,i=$P,r="@[a-z-]+",s="and or not only",c={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+WP.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},c,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+JP.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,c,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:ZP.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},c,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function tG(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function nG(t){const e=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],l=["double precision","large object","with timezone","without timezone"],c=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],m=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],x=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],v=m,E=[...p,...d].filter(H=>!m.includes(H)),A={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},w={match:e.concat(/\b/,e.either(...v),/\s*\(/),relevance:0,keywords:{built_in:v}};function k(H){return e.concat(/\b/,e.either(...H.map(z=>z.replace(/\s+/,"\\s+"))),/\b/)}const N={scope:"keyword",match:k(x),relevance:0};function D(H,{exceptions:z,when:F}={}){const ee=F;return z=z||[],H.map(P=>P.match(/\|\d+$/)||z.includes(P)?P:ee(P)?`${P}|0`:P)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:D(E,{when:H=>H.length<3}),literal:s,type:c,built_in:g},contains:[{scope:"type",match:k(l)},N,w,A,i,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,C]}}function MN(t){return t?typeof t=="string"?t:t.source:null}function im(t){return wn("(?=",t,")")}function wn(...t){return t.map(n=>MN(n)).join("")}function iG(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function aa(...t){return"("+(iG(t).capture?"":"?:")+t.map(i=>MN(i)).join("|")+")"}const v1=t=>wn(/\b/,t,/\w$/.test(t)?/\b/:/\B/),rG=["Protocol","Type"].map(v1),P2=["init","self"].map(v1),aG=["Any","Self"],ov=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],G2=["false","nil","true"],sG=["assignment","associativity","higherThan","left","lowerThan","none","right"],lG=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],F2=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],NN=aa(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),RN=aa(NN,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),cv=wn(NN,RN,"*"),kN=aa(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),N0=aa(kN,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ao=wn(kN,N0,"*"),Ky=wn(/[A-Z]/,N0,"*"),oG=["attached","autoclosure",wn(/convention\(/,aa("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",wn(/objc\(/,ao,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],cG=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function uG(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[t.C_LINE_COMMENT_MODE,n],r={match:[/\./,aa(...rG,...P2)],className:{2:"keyword"}},s={match:wn(/\./,aa(...ov)),relevance:0},l=ov.filter(Ue=>typeof Ue=="string").concat(["_|0"]),c=ov.filter(Ue=>typeof Ue!="string").concat(aG).map(v1),d={variants:[{className:"keyword",match:aa(...c,...P2)}]},p={$pattern:aa(/\b\w+/,/#\w+/),keyword:l.concat(lG),literal:G2},m=[r,s,d],g={match:wn(/\./,aa(...F2)),relevance:0},x={className:"built_in",match:wn(/\b/,aa(...F2),/(?=\()/)},v=[g,x],E={match:/->/,relevance:0},A={className:"operator",relevance:0,variants:[{match:cv},{match:`\\.(\\.|${RN})+`}]},C=[E,A],w="([0-9]_*)+",k="([0-9a-fA-F]_*)+",N={className:"number",relevance:0,variants:[{match:`\\b(${w})(\\.(${w}))?([eE][+-]?(${w}))?\\b`},{match:`\\b0x(${k})(\\.(${k}))?([pP][+-]?(${w}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},D=(Ue="")=>({className:"subst",variants:[{match:wn(/\\/,Ue,/[0\\tnr"']/)},{match:wn(/\\/,Ue,/u\{[0-9a-fA-F]{1,8}\}/)}]}),H=(Ue="")=>({className:"subst",match:wn(/\\/,Ue,/[\t ]*(?:[\r\n]|\r\n)/)}),z=(Ue="")=>({className:"subst",label:"interpol",begin:wn(/\\/,Ue,/\(/),end:/\)/}),F=(Ue="")=>({begin:wn(Ue,/"""/),end:wn(/"""/,Ue),contains:[D(Ue),H(Ue),z(Ue)]}),ee=(Ue="")=>({begin:wn(Ue,/"/),end:wn(/"/,Ue),contains:[D(Ue),z(Ue)]}),P={className:"string",variants:[F(),F("#"),F("##"),F("###"),ee(),ee("#"),ee("##"),ee("###")]},I=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],V={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},X=Ue=>{const At=wn(Ue,/\//),zn=wn(/\//,Ue);return{begin:At,end:zn,contains:[...I,{scope:"comment",begin:`#(?!.*${zn})`,end:/$/}]}},ne={scope:"regexp",variants:[X("###"),X("##"),X("#"),V]},q={match:wn(/`/,ao,/`/)},Q={className:"variable",match:/\$\d+/},B={className:"variable",match:`\\$${N0}+`},Y=[q,Q,B],Z={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:cG,contains:[...C,N,P]}]}},$={scope:"keyword",match:wn(/@/,aa(...oG),im(aa(/\(/,/\s+/)))},j={scope:"meta",match:wn(/@/,ao)},K=[Z,$,j],te={match:im(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:wn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,N0,"+")},{className:"type",match:Ky,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:wn(/\s+&\s+/,im(Ky)),relevance:0}]},U={begin:/</,end:/>/,keywords:p,contains:[...i,...m,...K,E,te]};te.contains.push(U);const le={match:wn(ao,/\s*:/),keywords:"_|0",relevance:0},de={begin:/\(/,end:/\)/,relevance:0,keywords:p,contains:["self",le,...i,ne,...m,...v,...C,N,P,...Y,...K,te]},ge={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,te]},se={begin:aa(im(wn(ao,/\s*:/)),im(wn(ao,/\s+/,ao,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ao}]},pe={begin:/\(/,end:/\)/,keywords:p,contains:[se,...i,...m,...C,N,P,...K,te,de],endsParent:!0,illegal:/["']/},Ae={match:[/(func|macro)/,/\s+/,aa(q.match,ao,cv)],className:{1:"keyword",3:"title.function"},contains:[ge,pe,e],illegal:[/\[/,/%/]},Le={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ge,pe,e],illegal:/\[|%/},Ge={match:[/operator/,/\s+/,cv],className:{1:"keyword",3:"title"}},Pe={begin:[/precedencegroup/,/\s+/,Ky],className:{1:"keyword",3:"title"},contains:[te],keywords:[...sG,...G2],end:/}/},Ie={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},We={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ut={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ao,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:p,contains:[ge,...m,{begin:/:/,end:/\{/,keywords:p,contains:[{scope:"title.class.inherited",match:Ky},...m],relevance:0}]};for(const Ue of P.variants){const At=Ue.contains.find(Bn=>Bn.label==="interpol");At.keywords=p;const zn=[...m,...v,...C,N,P,...Y];At.contains=[...zn,{begin:/\(/,end:/\)/,contains:["self",...zn]}]}return{name:"Swift",keywords:p,contains:[...i,Ae,Le,Ie,We,ut,Ge,Pe,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},ne,...m,...v,...C,N,P,...Y,...K,te,de]}}const R0="[A-Za-z$_][0-9A-Za-z$_]*",ON=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],DN=["true","false","null","undefined","NaN","Infinity"],zN=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],BN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],LN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],UN=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],IN=[].concat(LN,zN,BN);function fG(t){const e=t.regex,n=(Z,{after:$})=>{const j="</"+Z[0].slice(1);return Z.input.indexOf(j,$)!==-1},i=R0,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Z,$)=>{const j=Z[0].length+Z.index,K=Z.input[j];if(K==="<"||K===","){$.ignoreMatch();return}K===">"&&(n(Z,{after:j})||$.ignoreMatch());let te;const U=Z.input.substring(j);if(te=U.match(/^\s*=/)){$.ignoreMatch();return}if((te=U.match(/^\s+extends\s+/))&&te.index===0){$.ignoreMatch();return}}},c={$pattern:R0,keyword:ON,literal:DN,built_in:IN,"variable.language":UN},d="[0-9](_?[0-9])*",p=`\\.(${d})`,m="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${m})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${m})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},x={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,x],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,x],subLanguage:"css"}},A={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,x],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,x]},k={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},N=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,E,A,C,{match:/\$\d+/},g];x.contains=N.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(N)});const D=[].concat(k,x.contains),H=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(D)}]),z={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:H},F={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...zN,...BN]}},P={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[z],illegal:/%/},V={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function X(Z){return e.concat("(?!",Z.join("|"),")")}const ne={match:e.concat(/\b/,X([...LN,"super","import"].map(Z=>`${Z}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Q={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},z]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",Y={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[z]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:H,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),P,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,E,A,C,k,{match:/\$\d+/},g,ee,{scope:"attr",match:i+e.lookahead(":"),relevance:0},Y,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,t.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:H}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[z,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[z]},ne,V,F,Q,{match:/\$[(.]/}]}}function dG(t){const e=t.regex,n=fG(t),i=R0,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},l={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:R0,keyword:ON.concat(d),literal:DN,built_in:IN.concat(r),"variable.language":UN},m={className:"meta",begin:"@"+i},g=(A,C,w)=>{const k=A.contains.findIndex(N=>N.label===C);if(k===-1)throw new Error("can not find mode to replace");A.contains.splice(k,1,w)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(m);const x=n.contains.find(A=>A.scope==="attr"),v=Object.assign({},x,{match:e.concat(i,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,x,v]),n.contains=n.contains.concat([m,s,l,v]),g(n,"shebang",t.SHEBANG()),g(n,"use_strict",c);const E=n.contains.find(A=>A.label==="func.def");return E.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function hG(t){const e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,l=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,c=/\d{1,2}(:\d{1,2}){1,2}/,d={className:"literal",variants:[{begin:e.concat(/# */,e.either(s,r),/ *#/)},{begin:e.concat(/# */,c,/ *#/)},{begin:e.concat(/# */,l,/ *#/)},{begin:e.concat(/# */,e.either(s,r),/ +/,e.either(l,c),/ *#/)}]},p={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},m={className:"label",begin:/^\w+:/},g=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),x=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,i,d,p,m,g,x,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[x]}]}}function pG(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");const n=t.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},l={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},c={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},d={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},p={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,l,r,t.QUOTE_STRING_MODE,d,p,c]}}function mG(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},l=t.inherit(s,{begin:/\(/,end:/\)/}),c=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,d,c,l,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,l,d,c]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:p}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function gG(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},l={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},c=t.inherit(l,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),x={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},E={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},A={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},C=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},x,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},E,A,s,l],w=[...C];return w.pop(),w.push(c),v.contains=w,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}const yG={arduino:Q9,bash:J9,c:eP,cpp:tP,csharp:nP,css:fP,diff:dP,go:hP,graphql:pP,ini:mP,java:gP,javascript:_P,json:SP,kotlin:wP,less:OP,lua:DP,makefile:zP,markdown:BP,objectivec:LP,perl:UP,php:IP,"php-template":HP,plaintext:jP,python:PP,"python-repl":GP,r:FP,ruby:qP,rust:YP,scss:eG,shell:tG,sql:nG,swift:uG,typescript:dG,vbnet:hG,wasm:pG,xml:mG,yaml:gG};var uv,q2;function bG(){if(q2)return uv;q2=1;function t(ae){return ae instanceof Map?ae.clear=ae.delete=ae.set=function(){throw new Error("map is read-only")}:ae instanceof Set&&(ae.add=ae.clear=ae.delete=function(){throw new Error("set is read-only")}),Object.freeze(ae),Object.getOwnPropertyNames(ae).forEach(Ee=>{const ze=ae[Ee],et=typeof ze;(et==="object"||et==="function")&&!Object.isFrozen(ze)&&t(ze)}),ae}class e{constructor(Ee){Ee.data===void 0&&(Ee.data={}),this.data=Ee.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(ae){return ae.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function i(ae,...Ee){const ze=Object.create(null);for(const et in ae)ze[et]=ae[et];return Ee.forEach(function(et){for(const Jt in et)ze[Jt]=et[Jt]}),ze}const r="</span>",s=ae=>!!ae.scope,l=(ae,{prefix:Ee})=>{if(ae.startsWith("language:"))return ae.replace("language:","language-");if(ae.includes(".")){const ze=ae.split(".");return[`${Ee}${ze.shift()}`,...ze.map((et,Jt)=>`${et}${"_".repeat(Jt+1)}`)].join(" ")}return`${Ee}${ae}`};class c{constructor(Ee,ze){this.buffer="",this.classPrefix=ze.classPrefix,Ee.walk(this)}addText(Ee){this.buffer+=n(Ee)}openNode(Ee){if(!s(Ee))return;const ze=l(Ee.scope,{prefix:this.classPrefix});this.span(ze)}closeNode(Ee){s(Ee)&&(this.buffer+=r)}value(){return this.buffer}span(Ee){this.buffer+=`<span class="${Ee}">`}}const d=(ae={})=>{const Ee={children:[]};return Object.assign(Ee,ae),Ee};class p{constructor(){this.rootNode=d(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Ee){this.top.children.push(Ee)}openNode(Ee){const ze=d({scope:Ee});this.add(ze),this.stack.push(ze)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Ee){return this.constructor._walk(Ee,this.rootNode)}static _walk(Ee,ze){return typeof ze=="string"?Ee.addText(ze):ze.children&&(Ee.openNode(ze),ze.children.forEach(et=>this._walk(Ee,et)),Ee.closeNode(ze)),Ee}static _collapse(Ee){typeof Ee!="string"&&Ee.children&&(Ee.children.every(ze=>typeof ze=="string")?Ee.children=[Ee.children.join("")]:Ee.children.forEach(ze=>{p._collapse(ze)}))}}class m extends p{constructor(Ee){super(),this.options=Ee}addText(Ee){Ee!==""&&this.add(Ee)}startScope(Ee){this.openNode(Ee)}endScope(){this.closeNode()}__addSublanguage(Ee,ze){const et=Ee.root;ze&&(et.scope=`language:${ze}`),this.add(et)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(ae){return ae?typeof ae=="string"?ae:ae.source:null}function x(ae){return A("(?=",ae,")")}function v(ae){return A("(?:",ae,")*")}function E(ae){return A("(?:",ae,")?")}function A(...ae){return ae.map(ze=>g(ze)).join("")}function C(ae){const Ee=ae[ae.length-1];return typeof Ee=="object"&&Ee.constructor===Object?(ae.splice(ae.length-1,1),Ee):{}}function w(...ae){return"("+(C(ae).capture?"":"?:")+ae.map(et=>g(et)).join("|")+")"}function k(ae){return new RegExp(ae.toString()+"|").exec("").length-1}function N(ae,Ee){const ze=ae&&ae.exec(Ee);return ze&&ze.index===0}const D=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function H(ae,{joinWith:Ee}){let ze=0;return ae.map(et=>{ze+=1;const Jt=ze;let en=g(et),Fe="";for(;en.length>0;){const He=D.exec(en);if(!He){Fe+=en;break}Fe+=en.substring(0,He.index),en=en.substring(He.index+He[0].length),He[0][0]==="\\"&&He[1]?Fe+="\\"+String(Number(He[1])+Jt):(Fe+=He[0],He[0]==="("&&ze++)}return Fe}).map(et=>`(${et})`).join(Ee)}const z=/\b\B/,F="[a-zA-Z]\\w*",ee="[a-zA-Z_]\\w*",P="\\b\\d+(\\.\\d+)?",I="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",V="\\b(0b[01]+)",X="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ne=(ae={})=>{const Ee=/^#![ ]*\//;return ae.binary&&(ae.begin=A(Ee,/.*\b/,ae.binary,/\b.*/)),i({scope:"meta",begin:Ee,end:/$/,relevance:0,"on:begin":(ze,et)=>{ze.index!==0&&et.ignoreMatch()}},ae)},q={begin:"\\\\[\\s\\S]",relevance:0},Q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[q]},B={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[q]},Y={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Z=function(ae,Ee,ze={}){const et=i({scope:"comment",begin:ae,end:Ee,contains:[]},ze);et.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Jt=w("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return et.contains.push({begin:A(/[ ]+/,"(",Jt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),et},$=Z("//","$"),j=Z("/\\*","\\*/"),K=Z("#","$"),te={scope:"number",begin:P,relevance:0},U={scope:"number",begin:I,relevance:0},le={scope:"number",begin:V,relevance:0},de={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[q,{begin:/\[/,end:/\]/,relevance:0,contains:[q]}]},ge={scope:"title",begin:F,relevance:0},se={scope:"title",begin:ee,relevance:0},pe={begin:"\\.\\s*"+ee,relevance:0};var Le=Object.freeze({__proto__:null,APOS_STRING_MODE:Q,BACKSLASH_ESCAPE:q,BINARY_NUMBER_MODE:le,BINARY_NUMBER_RE:V,COMMENT:Z,C_BLOCK_COMMENT_MODE:j,C_LINE_COMMENT_MODE:$,C_NUMBER_MODE:U,C_NUMBER_RE:I,END_SAME_AS_BEGIN:function(ae){return Object.assign(ae,{"on:begin":(Ee,ze)=>{ze.data._beginMatch=Ee[1]},"on:end":(Ee,ze)=>{ze.data._beginMatch!==Ee[1]&&ze.ignoreMatch()}})},HASH_COMMENT_MODE:K,IDENT_RE:F,MATCH_NOTHING_RE:z,METHOD_GUARD:pe,NUMBER_MODE:te,NUMBER_RE:P,PHRASAL_WORDS_MODE:Y,QUOTE_STRING_MODE:B,REGEXP_MODE:de,RE_STARTERS_RE:X,SHEBANG:ne,TITLE_MODE:ge,UNDERSCORE_IDENT_RE:ee,UNDERSCORE_TITLE_MODE:se});function Ge(ae,Ee){ae.input[ae.index-1]==="."&&Ee.ignoreMatch()}function Pe(ae,Ee){ae.className!==void 0&&(ae.scope=ae.className,delete ae.className)}function Ie(ae,Ee){Ee&&ae.beginKeywords&&(ae.begin="\\b("+ae.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",ae.__beforeBegin=Ge,ae.keywords=ae.keywords||ae.beginKeywords,delete ae.beginKeywords,ae.relevance===void 0&&(ae.relevance=0))}function We(ae,Ee){Array.isArray(ae.illegal)&&(ae.illegal=w(...ae.illegal))}function ut(ae,Ee){if(ae.match){if(ae.begin||ae.end)throw new Error("begin & end are not supported with match");ae.begin=ae.match,delete ae.match}}function Ue(ae,Ee){ae.relevance===void 0&&(ae.relevance=1)}const At=(ae,Ee)=>{if(!ae.beforeMatch)return;if(ae.starts)throw new Error("beforeMatch cannot be used with starts");const ze=Object.assign({},ae);Object.keys(ae).forEach(et=>{delete ae[et]}),ae.keywords=ze.keywords,ae.begin=A(ze.beforeMatch,x(ze.begin)),ae.starts={relevance:0,contains:[Object.assign(ze,{endsParent:!0})]},ae.relevance=0,delete ze.beforeMatch},zn=["of","and","for","in","not","or","if","then","parent","list","value"],Bn="keyword";function bn(ae,Ee,ze=Bn){const et=Object.create(null);return typeof ae=="string"?Jt(ze,ae.split(" ")):Array.isArray(ae)?Jt(ze,ae):Object.keys(ae).forEach(function(en){Object.assign(et,bn(ae[en],Ee,en))}),et;function Jt(en,Fe){Ee&&(Fe=Fe.map(He=>He.toLowerCase())),Fe.forEach(function(He){const tt=He.split("|");et[tt[0]]=[en,wi(tt[0],tt[1])]})}}function wi(ae,Ee){return Ee?Number(Ee):ka(ae)?0:1}function ka(ae){return zn.includes(ae.toLowerCase())}const Lr={},hn=ae=>{console.error(ae)},ua=(ae,...Ee)=>{console.log(`WARN: ${ae}`,...Ee)},_e=(ae,Ee)=>{Lr[`${ae}/${Ee}`]||(console.log(`Deprecated as of ${ae}. ${Ee}`),Lr[`${ae}/${Ee}`]=!0)},Re=new Error;function Je(ae,Ee,{key:ze}){let et=0;const Jt=ae[ze],en={},Fe={};for(let He=1;He<=Ee.length;He++)Fe[He+et]=Jt[He],en[He+et]=!0,et+=k(Ee[He-1]);ae[ze]=Fe,ae[ze]._emit=en,ae[ze]._multi=!0}function bt(ae){if(Array.isArray(ae.begin)){if(ae.skip||ae.excludeBegin||ae.returnBegin)throw hn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Re;if(typeof ae.beginScope!="object"||ae.beginScope===null)throw hn("beginScope must be object"),Re;Je(ae,ae.begin,{key:"beginScope"}),ae.begin=H(ae.begin,{joinWith:""})}}function kt(ae){if(Array.isArray(ae.end)){if(ae.skip||ae.excludeEnd||ae.returnEnd)throw hn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Re;if(typeof ae.endScope!="object"||ae.endScope===null)throw hn("endScope must be object"),Re;Je(ae,ae.end,{key:"endScope"}),ae.end=H(ae.end,{joinWith:""})}}function yi(ae){ae.scope&&typeof ae.scope=="object"&&ae.scope!==null&&(ae.beginScope=ae.scope,delete ae.scope)}function rr(ae){yi(ae),typeof ae.beginScope=="string"&&(ae.beginScope={_wrap:ae.beginScope}),typeof ae.endScope=="string"&&(ae.endScope={_wrap:ae.endScope}),bt(ae),kt(ae)}function xn(ae){function Ee(Fe,He){return new RegExp(g(Fe),"m"+(ae.case_insensitive?"i":"")+(ae.unicodeRegex?"u":"")+(He?"g":""))}class ze{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(He,tt){tt.position=this.position++,this.matchIndexes[this.matchAt]=tt,this.regexes.push([tt,He]),this.matchAt+=k(He)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const He=this.regexes.map(tt=>tt[1]);this.matcherRe=Ee(H(He,{joinWith:"|"}),!0),this.lastIndex=0}exec(He){this.matcherRe.lastIndex=this.lastIndex;const tt=this.matcherRe.exec(He);if(!tt)return null;const Cn=tt.findIndex((fa,ar)=>ar>0&&fa!==void 0),Gt=this.matchIndexes[Cn];return tt.splice(0,Cn),Object.assign(tt,Gt)}}class et{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(He){if(this.multiRegexes[He])return this.multiRegexes[He];const tt=new ze;return this.rules.slice(He).forEach(([Cn,Gt])=>tt.addRule(Cn,Gt)),tt.compile(),this.multiRegexes[He]=tt,tt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(He,tt){this.rules.push([He,tt]),tt.type==="begin"&&this.count++}exec(He){const tt=this.getMatcher(this.regexIndex);tt.lastIndex=this.lastIndex;let Cn=tt.exec(He);if(this.resumingScanAtSamePosition()&&!(Cn&&Cn.index===this.lastIndex)){const Gt=this.getMatcher(0);Gt.lastIndex=this.lastIndex+1,Cn=Gt.exec(He)}return Cn&&(this.regexIndex+=Cn.position+1,this.regexIndex===this.count&&this.considerAll()),Cn}}function Jt(Fe){const He=new et;return Fe.contains.forEach(tt=>He.addRule(tt.begin,{rule:tt,type:"begin"})),Fe.terminatorEnd&&He.addRule(Fe.terminatorEnd,{type:"end"}),Fe.illegal&&He.addRule(Fe.illegal,{type:"illegal"}),He}function en(Fe,He){const tt=Fe;if(Fe.isCompiled)return tt;[Pe,ut,rr,At].forEach(Gt=>Gt(Fe,He)),ae.compilerExtensions.forEach(Gt=>Gt(Fe,He)),Fe.__beforeBegin=null,[Ie,We,Ue].forEach(Gt=>Gt(Fe,He)),Fe.isCompiled=!0;let Cn=null;return typeof Fe.keywords=="object"&&Fe.keywords.$pattern&&(Fe.keywords=Object.assign({},Fe.keywords),Cn=Fe.keywords.$pattern,delete Fe.keywords.$pattern),Cn=Cn||/\w+/,Fe.keywords&&(Fe.keywords=bn(Fe.keywords,ae.case_insensitive)),tt.keywordPatternRe=Ee(Cn,!0),He&&(Fe.begin||(Fe.begin=/\B|\b/),tt.beginRe=Ee(tt.begin),!Fe.end&&!Fe.endsWithParent&&(Fe.end=/\B|\b/),Fe.end&&(tt.endRe=Ee(tt.end)),tt.terminatorEnd=g(tt.end)||"",Fe.endsWithParent&&He.terminatorEnd&&(tt.terminatorEnd+=(Fe.end?"|":"")+He.terminatorEnd)),Fe.illegal&&(tt.illegalRe=Ee(Fe.illegal)),Fe.contains||(Fe.contains=[]),Fe.contains=[].concat(...Fe.contains.map(function(Gt){return Gn(Gt==="self"?Fe:Gt)})),Fe.contains.forEach(function(Gt){en(Gt,tt)}),Fe.starts&&en(Fe.starts,He),tt.matcher=Jt(tt),tt}if(ae.compilerExtensions||(ae.compilerExtensions=[]),ae.contains&&ae.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return ae.classNameAliases=i(ae.classNameAliases||{}),en(ae)}function Zt(ae){return ae?ae.endsWithParent||Zt(ae.starts):!1}function Gn(ae){return ae.variants&&!ae.cachedVariants&&(ae.cachedVariants=ae.variants.map(function(Ee){return i(ae,{variants:null},Ee)})),ae.cachedVariants?ae.cachedVariants:Zt(ae)?i(ae,{starts:ae.starts?i(ae.starts):null}):Object.isFrozen(ae)?i(ae):ae}var Pt="11.11.1";class Fi extends Error{constructor(Ee,ze){super(Ee),this.name="HTMLInjectionError",this.html=ze}}const Qn=n,go=i,is=Symbol("nomatch"),Oa=7,rs=function(ae){const Ee=Object.create(null),ze=Object.create(null),et=[];let Jt=!0;const en="Could not find the language '{}', did you forget to load/include a language module?",Fe={disableAutodetect:!0,name:"Plain text",contains:[]};let He={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:m};function tt(Me){return He.noHighlightRe.test(Me)}function Cn(Me){let Ve=Me.className+" ";Ve+=Me.parentNode?Me.parentNode.className:"";const xt=He.languageDetectRe.exec(Ve);if(xt){const Xt=tn(xt[1]);return Xt||(ua(en.replace("{}",xt[1])),ua("Falling back to no-highlight mode for this block.",Me)),Xt?xt[1]:"no-highlight"}return Ve.split(/\s+/).find(Xt=>tt(Xt)||tn(Xt))}function Gt(Me,Ve,xt){let Xt="",Un="";typeof Ve=="object"?(Xt=Me,xt=Ve.ignoreIllegals,Un=Ve.language):(_e("10.7.0","highlight(lang, code, ...args) has been deprecated."),_e("10.7.0",`Please use highlight(code, options) instead.
377
- https://github.com/highlightjs/highlight.js/issues/2277`),Un=Me,Xt=Ve),xt===void 0&&(xt=!0);const xi={code:Xt,language:Un};da("before:highlight",xi);const Yi=xi.result?xi.result:fa(xi.language,xi.code,xt);return Yi.code=xi.code,da("after:highlight",Yi),Yi}function fa(Me,Ve,xt,Xt){const Un=Object.create(null);function xi(De,qe){return De.keywords[qe]}function Yi(){if(!it.keywords){Hn.addText(rn);return}let De=0;it.keywordPatternRe.lastIndex=0;let qe=it.keywordPatternRe.exec(rn),mt="";for(;qe;){mt+=rn.substring(De,qe.index);const Rt=oi.case_insensitive?qe[0].toLowerCase():qe[0],An=xi(it,Rt);if(An){const[jr,uc]=An;if(Hn.addText(mt),mt="",Un[Rt]=(Un[Rt]||0)+1,Un[Rt]<=Oa&&(ls+=uc),jr.startsWith("_"))mt+=qe[0];else{const uu=oi.classNameAliases[jr]||jr;or(qe[0],uu)}}else mt+=qe[0];De=it.keywordPatternRe.lastIndex,qe=it.keywordPatternRe.exec(rn)}mt+=rn.substring(De),Hn.addText(mt)}function Ti(){if(rn==="")return;let De=null;if(typeof it.subLanguage=="string"){if(!Ee[it.subLanguage]){Hn.addText(rn);return}De=fa(it.subLanguage,rn,!0,bo[it.subLanguage]),bo[it.subLanguage]=De._top}else De=qi(rn,it.subLanguage.length?it.subLanguage:null);it.relevance>0&&(ls+=De.relevance),Hn.__addSublanguage(De._emitter,De.language)}function un(){it.subLanguage!=null?Ti():Yi(),rn=""}function or(De,qe){De!==""&&(Hn.startScope(qe),Hn.addText(De),Hn.endScope())}function yo(De,qe){let mt=1;const Rt=qe.length-1;for(;mt<=Rt;){if(!De._emit[mt]){mt++;continue}const An=oi.classNameAliases[De[mt]]||De[mt],jr=qe[mt];An?or(jr,An):(rn=jr,Yi(),rn=""),mt++}}function ha(De,qe){return De.scope&&typeof De.scope=="string"&&Hn.openNode(oi.classNameAliases[De.scope]||De.scope),De.beginScope&&(De.beginScope._wrap?(or(rn,oi.classNameAliases[De.beginScope._wrap]||De.beginScope._wrap),rn=""):De.beginScope._multi&&(yo(De.beginScope,qe),rn="")),it=Object.create(De,{parent:{value:it}}),it}function wl(De,qe,mt){let Rt=N(De.endRe,mt);if(Rt){if(De["on:end"]){const An=new e(De);De["on:end"](qe,An),An.isMatchIgnored&&(Rt=!1)}if(Rt){for(;De.endsParent&&De.parent;)De=De.parent;return De}}if(De.endsWithParent)return wl(De.parent,qe,mt)}function za(De){return it.matcher.regexIndex===0?(rn+=De[0],1):(Is=!0,0)}function oc(De){const qe=De[0],mt=De.rule,Rt=new e(mt),An=[mt.__beforeBegin,mt["on:begin"]];for(const jr of An)if(jr&&(jr(De,Rt),Rt.isMatchIgnored))return za(qe);return mt.skip?rn+=qe:(mt.excludeBegin&&(rn+=qe),un(),!mt.returnBegin&&!mt.excludeBegin&&(rn=qe)),ha(mt,De),mt.returnBegin?0:qe.length}function Di(De){const qe=De[0],mt=Ve.substring(De.index),Rt=wl(it,De,mt);if(!Rt)return is;const An=it;it.endScope&&it.endScope._wrap?(un(),or(qe,it.endScope._wrap)):it.endScope&&it.endScope._multi?(un(),yo(it.endScope,De)):An.skip?rn+=qe:(An.returnEnd||An.excludeEnd||(rn+=qe),un(),An.excludeEnd&&(rn=qe));do it.scope&&Hn.closeNode(),!it.skip&&!it.subLanguage&&(ls+=it.relevance),it=it.parent;while(it!==Rt.parent);return Rt.starts&&ha(Rt.starts,De),An.returnEnd?0:qe.length}function as(){const De=[];for(let qe=it;qe!==oi;qe=qe.parent)qe.scope&&De.unshift(qe.scope);De.forEach(qe=>Hn.openNode(qe))}let ss={};function Us(De,qe){const mt=qe&&qe[0];if(rn+=De,mt==null)return un(),0;if(ss.type==="begin"&&qe.type==="end"&&ss.index===qe.index&&mt===""){if(rn+=Ve.slice(qe.index,qe.index+1),!Jt){const Rt=new Error(`0 width match regex (${Me})`);throw Rt.languageName=Me,Rt.badRule=ss.rule,Rt}return 1}if(ss=qe,qe.type==="begin")return oc(qe);if(qe.type==="illegal"&&!xt){const Rt=new Error('Illegal lexeme "'+mt+'" for mode "'+(it.scope||"<unnamed>")+'"');throw Rt.mode=it,Rt}else if(qe.type==="end"){const Rt=Di(qe);if(Rt!==is)return Rt}if(qe.type==="illegal"&&mt==="")return rn+=`
378
- `,1;if(cc>1e5&&cc>qe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return rn+=mt,mt.length}const oi=tn(Me);if(!oi)throw hn(en.replace("{}",Me)),new Error('Unknown language: "'+Me+'"');const cu=xn(oi);let Ba="",it=Xt||cu;const bo={},Hn=new He.__emitter(He);as();let rn="",ls=0,os=0,cc=0,Is=!1;try{if(oi.__emitTokens)oi.__emitTokens(Ve,Hn);else{for(it.matcher.considerAll();;){cc++,Is?Is=!1:it.matcher.considerAll(),it.matcher.lastIndex=os;const De=it.matcher.exec(Ve);if(!De)break;const qe=Ve.substring(os,De.index),mt=Us(qe,De);os=De.index+mt}Us(Ve.substring(os))}return Hn.finalize(),Ba=Hn.toHTML(),{language:Me,value:Ba,relevance:ls,illegal:!1,_emitter:Hn,_top:it}}catch(De){if(De.message&&De.message.includes("Illegal"))return{language:Me,value:Qn(Ve),illegal:!0,relevance:0,_illegalBy:{message:De.message,index:os,context:Ve.slice(os-100,os+100),mode:De.mode,resultSoFar:Ba},_emitter:Hn};if(Jt)return{language:Me,value:Qn(Ve),illegal:!1,relevance:0,errorRaised:De,_emitter:Hn,_top:it};throw De}}function ar(Me){const Ve={value:Qn(Me),illegal:!1,relevance:0,_top:Fe,_emitter:new He.__emitter(He)};return Ve._emitter.addText(Me),Ve}function qi(Me,Ve){Ve=Ve||He.languages||Object.keys(Ee);const xt=ar(Me),Xt=Ve.filter(tn).filter(lr).map(un=>fa(un,Me,!1));Xt.unshift(xt);const Un=Xt.sort((un,or)=>{if(un.relevance!==or.relevance)return or.relevance-un.relevance;if(un.language&&or.language){if(tn(un.language).supersetOf===or.language)return 1;if(tn(or.language).supersetOf===un.language)return-1}return 0}),[xi,Yi]=Un,Ti=xi;return Ti.secondBest=Yi,Ti}function sr(Me,Ve,xt){const Xt=Ve&&ze[Ve]||xt;Me.classList.add("hljs"),Me.classList.add(`language-${Xt}`)}function yt(Me){let Ve=null;const xt=Cn(Me);if(tt(xt))return;if(da("before:highlightElement",{el:Me,language:xt}),Me.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Me);return}if(Me.children.length>0&&(He.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Me)),He.throwUnescapedHTML))throw new Fi("One of your code blocks includes unescaped HTML.",Me.innerHTML);Ve=Me;const Xt=Ve.textContent,Un=xt?Gt(Xt,{language:xt,ignoreIllegals:!0}):qi(Xt);Me.innerHTML=Un.value,Me.dataset.highlighted="yes",sr(Me,xt,Un.language),Me.result={language:Un.language,re:Un.relevance,relevance:Un.relevance},Un.secondBest&&(Me.secondBest={language:Un.secondBest.language,relevance:Un.secondBest.relevance}),da("after:highlightElement",{el:Me,result:Un,text:Xt})}function li(Me){He=go(He,Me)}const Ur=()=>{Sl(),_e("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Bs(){Sl(),_e("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let _l=!1;function Sl(){function Me(){Sl()}if(document.readyState==="loading"){_l||window.addEventListener("DOMContentLoaded",Me,!1),_l=!0;return}document.querySelectorAll(He.cssSelector).forEach(yt)}function El(Me,Ve){let xt=null;try{xt=Ve(ae)}catch(Xt){if(hn("Language definition for '{}' could not be registered.".replace("{}",Me)),Jt)hn(Xt);else throw Xt;xt=Fe}xt.name||(xt.name=Me),Ee[Me]=xt,xt.rawDefinition=Ve.bind(null,ae),xt.aliases&&nn(xt.aliases,{languageName:Me})}function Da(Me){delete Ee[Me];for(const Ve of Object.keys(ze))ze[Ve]===Me&&delete ze[Ve]}function Ls(){return Object.keys(Ee)}function tn(Me){return Me=(Me||"").toLowerCase(),Ee[Me]||Ee[ze[Me]]}function nn(Me,{languageName:Ve}){typeof Me=="string"&&(Me=[Me]),Me.forEach(xt=>{ze[xt.toLowerCase()]=Ve})}function lr(Me){const Ve=tn(Me);return Ve&&!Ve.disableAutodetect}function Ir(Me){Me["before:highlightBlock"]&&!Me["before:highlightElement"]&&(Me["before:highlightElement"]=Ve=>{Me["before:highlightBlock"](Object.assign({block:Ve.el},Ve))}),Me["after:highlightBlock"]&&!Me["after:highlightElement"]&&(Me["after:highlightElement"]=Ve=>{Me["after:highlightBlock"](Object.assign({block:Ve.el},Ve))})}function Ln(Me){Ir(Me),et.push(Me)}function xr(Me){const Ve=et.indexOf(Me);Ve!==-1&&et.splice(Ve,1)}function da(Me,Ve){const xt=Me;et.forEach(function(Xt){Xt[xt]&&Xt[xt](Ve)})}function Hr(Me){return _e("10.7.0","highlightBlock will be removed entirely in v12.0"),_e("10.7.0","Please use highlightElement now."),yt(Me)}Object.assign(ae,{highlight:Gt,highlightAuto:qi,highlightAll:Sl,highlightElement:yt,highlightBlock:Hr,configure:li,initHighlighting:Ur,initHighlightingOnLoad:Bs,registerLanguage:El,unregisterLanguage:Da,listLanguages:Ls,getLanguage:tn,registerAliases:nn,autoDetection:lr,inherit:go,addPlugin:Ln,removePlugin:xr}),ae.debugMode=function(){Jt=!1},ae.safeMode=function(){Jt=!0},ae.versionString=Pt,ae.regex={concat:A,lookahead:x,either:w,optional:E,anyNumberOfTimes:v};for(const Me in Le)typeof Le[Me]=="object"&&t(Le[Me]);return Object.assign(ae,Le),ae},bi=rs({});return bi.newInstance=()=>rs({}),uv=bi,bi.HighlightJS=bi,bi.default=bi,uv}var xG=bG();const vG=lu(xG),Y2={},_G="hljs-";function SG(t){const e=vG.newInstance();return t&&s(t),{highlight:n,highlightAuto:i,listLanguages:r,register:s,registerAlias:l,registered:c};function n(d,p,m){const g=m||Y2,x=typeof g.prefix=="string"?g.prefix:_G;if(!e.getLanguage(d))throw new Error("Unknown language: `"+d+"` is not registered");e.configure({__emitter:EG,classPrefix:x});const v=e.highlight(p,{ignoreIllegals:!0,language:d});if(v.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:v.errorRaised});const E=v._emitter.root,A=E.data;return A.language=v.language,A.relevance=v.relevance,E}function i(d,p){const g=(p||Y2).subset||r();let x=-1,v=0,E;for(;++x<g.length;){const A=g[x];if(!e.getLanguage(A))continue;const C=n(A,d,p);C.data&&C.data.relevance!==void 0&&C.data.relevance>v&&(v=C.data.relevance,E=C)}return E||{type:"root",children:[],data:{language:void 0,relevance:v}}}function r(){return e.listLanguages()}function s(d,p){if(typeof d=="string")e.registerLanguage(d,p);else{let m;for(m in d)Object.hasOwn(d,m)&&e.registerLanguage(m,d[m])}}function l(d,p){if(typeof d=="string")e.registerAliases(typeof p=="string"?p:[...p],{languageName:d});else{let m;for(m in d)if(Object.hasOwn(d,m)){const g=d[m];e.registerAliases(typeof g=="string"?g:[...g],{languageName:m})}}}function c(d){return!!e.getLanguage(d)}}class EG{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const i=this.stack[this.stack.length-1],r=e.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):i.children.push(...r)}openNode(e){const n=this,i=e.split(".").map(function(l,c){return c?l+"_".repeat(c):n.options.classPrefix+l}),r=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};r.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const wG={};function TG(t){const e=t||wG,n=e.aliases,i=e.detect||!1,r=e.languages||yG,s=e.plainText,l=e.prefix,c=e.subset;let d="hljs";const p=SG(r);if(n&&p.registerAlias(n),l){const m=l.indexOf("-");d=m===-1?l:l.slice(0,m)}return function(m,g){ib(m,"element",function(x,v,E){if(x.tagName!=="code"||!E||E.type!=="element"||E.tagName!=="pre")return;const A=CG(x);if(A===!1||!A&&!i||A&&s&&s.includes(A))return;Array.isArray(x.properties.className)||(x.properties.className=[]),x.properties.className.includes(d)||x.properties.className.unshift(d);const C=q9(x,{whitespace:"pre"});let w;try{w=A?p.highlight(A,C,{prefix:l}):p.highlightAuto(C,{prefix:l,subset:c})}catch(k){const N=k;if(A&&/Unknown language/.test(N.message)){g.message("Cannot highlight as `"+A+"`, it’s not registered",{ancestors:[E,x],cause:N,place:x.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw N}!A&&w.data&&w.data.language&&x.properties.className.push("language-"+w.data.language),w.children.length>0&&(x.children=w.children)})}}function CG(t){const e=t.properties.className;let n=-1;if(!Array.isArray(e))return;let i;for(;++n<e.length;){const r=String(e[n]);if(r==="no-highlight"||r==="nohighlight")return!1;!i&&r.slice(0,5)==="lang-"&&(i=r.slice(5)),!i&&r.slice(0,9)==="language-"&&(i=r.slice(9))}return i}function AG({text:t}){const[e,n]=G.useState(!1),i=()=>{navigator.clipboard.writeText(t).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})};return R.jsx("button",{onClick:i,style:{position:"absolute",top:6,right:6,background:"var(--surface-4)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:e?"var(--status-active)":"var(--text-muted)",fontSize:"0.65rem",fontFamily:"var(--font-mono)",padding:"2px 8px",cursor:"pointer",transition:"color var(--duration-fast) var(--ease-out)"},children:e?"Copied!":"Copy"})}function h_({content:t}){return R.jsx("div",{className:"markdown-message",children:R.jsx(w7,{remarkPlugins:[U9],rehypePlugins:[TG],components:{pre({children:e,...n}){const i=Array.isArray(e)?e.find(s=>{var l,c;return(s==null?void 0:s.type)==="code"||((c=(l=s==null?void 0:s.props)==null?void 0:l.node)==null?void 0:c.tagName)==="code"}):e,r=typeof i=="object"&&i!==null&&"props"in i?p_(i.props.children):"";return R.jsxs("div",{style:{position:"relative"},children:[R.jsx(AG,{text:r}),R.jsx("pre",{...n,style:{background:"var(--surface-0)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",padding:"12px 14px",paddingTop:28,margin:"8px 0",overflowX:"auto",fontSize:"0.78rem",lineHeight:1.6,fontFamily:"var(--font-mono)"},children:e})]})},code({className:e,children:n,...i}){return e?R.jsx("code",{className:e,...i,children:n}):R.jsx("code",{...i,style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",padding:"1px 5px",fontSize:"0.82em",fontFamily:"var(--font-mono)",color:"var(--accent)"},children:n})},a({href:e,children:n,...i}){return R.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)",textDecoration:"none"},...i,children:n})},table({children:e,...n}){return R.jsx("div",{style:{overflowX:"auto",margin:"8px 0"},children:R.jsx("table",{...n,style:{borderCollapse:"collapse",width:"100%",fontSize:"0.82rem"},children:e})})},th({children:e,...n}){return R.jsx("th",{...n,style:{borderBottom:"2px solid var(--border-default)",padding:"6px 10px",textAlign:"left",fontWeight:600,color:"var(--text-primary)"},children:e})},td({children:e,...n}){return R.jsx("td",{...n,style:{borderBottom:"1px solid var(--border-subtle)",padding:"5px 10px",color:"var(--text-secondary)"},children:e})},blockquote({children:e,...n}){return R.jsx("blockquote",{...n,style:{borderLeft:"3px solid var(--accent-dim)",margin:"8px 0",padding:"4px 12px",color:"var(--text-secondary)",background:"rgba(0, 200, 255, 0.04)",borderRadius:"0 var(--radius-xs) var(--radius-xs) 0"},children:e})},hr(){return R.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--border-default)",margin:"12px 0"}})},ul({children:e,...n}){return R.jsx("ul",{...n,style:{paddingLeft:20,margin:"4px 0"},children:e})},ol({children:e,...n}){return R.jsx("ol",{...n,style:{paddingLeft:20,margin:"4px 0"},children:e})},li({children:e,...n}){return R.jsx("li",{...n,style:{marginBottom:2},children:e})},h1({children:e,...n}){return R.jsx("h1",{...n,style:{fontSize:"1.3em",fontWeight:700,margin:"12px 0 6px"},children:e})},h2({children:e,...n}){return R.jsx("h2",{...n,style:{fontSize:"1.15em",fontWeight:600,margin:"10px 0 4px"},children:e})},h3({children:e,...n}){return R.jsx("h3",{...n,style:{fontSize:"1.05em",fontWeight:600,margin:"8px 0 4px"},children:e})},p({children:e,...n}){return R.jsx("p",{...n,style:{margin:"4px 0",lineHeight:1.6},children:e})}},children:t})})}function p_(t){var e;return typeof t=="string"?t:Array.isArray(t)?t.map(p_).join(""):(e=t==null?void 0:t.props)!=null&&e.children?p_(t.props.children):""}function MG({commands:t,filter:e,selectedIndex:n,onSelect:i,visible:r}){const s=G.useRef(null),l=G.useRef(null),c=t.filter(d=>d.command.toLowerCase().includes(e.toLowerCase())||d.description.toLowerCase().includes(e.toLowerCase()));return G.useEffect(()=>{var d;(d=l.current)==null||d.scrollIntoView({block:"nearest"})},[n]),!r||c.length===0?null:R.jsxs("div",{ref:s,style:{position:"absolute",bottom:"100%",left:0,right:0,marginBottom:4,background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",boxShadow:"var(--shadow-lg)",maxHeight:280,overflowY:"auto",zIndex:100,animation:"fadeInUp 0.15s var(--ease-out) both"},children:[R.jsx("div",{style:{padding:"8px 12px 4px",fontSize:"0.65rem",fontFamily:"var(--font-mono)",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Commands"}),c.map((d,p)=>{const m=p===n;return R.jsxs("div",{ref:m?l:void 0,onClick:()=>i(d),style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",cursor:"pointer",background:m?"var(--accent-glow)":"transparent",borderLeft:m?"2px solid var(--accent)":"2px solid transparent",transition:"background var(--duration-fast) var(--ease-out)"},onMouseEnter:g=>{m||(g.currentTarget.style.background="var(--surface-3)")},onMouseLeave:g=>{m||(g.currentTarget.style.background="transparent")},children:[R.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.8rem",fontWeight:600,color:m?"var(--accent)":"var(--text-primary)",whiteSpace:"nowrap"},children:["/",d.command,d.args&&R.jsxs("span",{style:{color:"var(--text-muted)",fontWeight:400},children:[" ",d.args]})]}),R.jsx("span",{style:{fontSize:"0.75rem",color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.description})]},d.command)})]})}const V2=[{command:"expxagents",description:"Show main menu"},{command:"expxagents create",args:"[description]",description:"Design a new squad"},{command:"expxagents run",args:"<name>",description:"Execute a squad pipeline"},{command:"expxagents list",description:"List all squads"},{command:"expxagents edit",args:"<name>",description:"Modify a squad"},{command:"expxagents delete",args:"<name>",description:"Delete a squad"},{command:"expxagents skills",description:"Browse skills"},{command:"expxagents install",args:"<name>",description:"Install a skill"},{command:"expxagents uninstall",args:"<name>",description:"Remove a skill"},{command:"expxagents dashboard",description:"Open virtual office"},{command:"expxagents virtual-office",description:"Open virtual office in browser"},{command:"expxagents jarvis",description:"Open Jarvis voice assistant"},{command:"expxagents help",description:"Show help text"}],Wy="_expxagents",Zc=[.72,.78,.85,.95,1.08,1.2],NG=2;function RG({file:t,onRemove:e}){return R.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:4,background:"var(--surface-3)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",padding:"2px 8px",fontSize:"0.72rem",fontFamily:"var(--font-mono)",color:"var(--accent)",maxWidth:180},children:[R.jsx("span",{style:{opacity:.6},children:"📎"}),R.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.name}),R.jsx("button",{onClick:e,style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",padding:0,fontSize:"0.8rem",lineHeight:1},"aria-label":`Remove ${t.name}`,children:"×"})]})}function kG({message:t,fontSize:e}){if(t.role==="agent_dm")return R.jsxs("div",{"data-role":"agent_dm",style:{alignSelf:"flex-start",background:"var(--surface-3)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:"85%",marginBottom:"var(--sp-2)",animation:"fadeInUp 0.3s var(--ease-out) both"},children:[R.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--accent)",fontWeight:600,marginBottom:4,letterSpacing:"0.02em"},children:t.agentName}),R.jsx("div",{style:{color:"var(--text-primary)",fontSize:`${e}rem`,lineHeight:1.55},children:R.jsx(h_,{content:t.content})})]});const n=t.role==="user";return R.jsx("div",{"data-role":t.role,style:{alignSelf:n?"flex-end":"flex-start",background:n?"var(--user-bubble)":"var(--agent-bubble)",border:n?"1px solid rgba(100, 160, 255, 0.15)":"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:n?"75%":"85%",marginBottom:"var(--sp-2)",animation:"fadeInUp 0.3s var(--ease-out) both"},children:R.jsx("div",{style:{color:"var(--text-primary)",fontSize:`${e}rem`,lineHeight:1.55},children:n?R.jsx("span",{style:{whiteSpace:"pre-wrap"},children:t.content}):R.jsx(h_,{content:t.content})})})}function OG({conv:t,isActive:e,onSelect:n,onDelete:i}){const[r,s]=G.useState(!1),l=new Date(t.createdAt),c=l.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),d=l.toLocaleDateString([],{day:"2-digit",month:"2-digit"});return R.jsxs("div",{onClick:n,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{padding:"8px 10px",borderRadius:"var(--radius-sm)",cursor:"pointer",background:e?"var(--accent-glow)":r?"var(--surface-3)":"transparent",border:e?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)",display:"flex",alignItems:"center",gap:8},children:[R.jsxs("div",{style:{flex:1,minWidth:0},children:[R.jsx("div",{style:{fontSize:"0.72rem",fontFamily:"var(--font-mono)",color:e?"var(--accent)":"var(--text-secondary)",fontWeight:e?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.preview||"New conversation"}),R.jsxs("div",{style:{fontSize:"0.6rem",fontFamily:"var(--font-mono)",color:"var(--text-muted)",marginTop:2},children:[d," ",c]})]}),r&&R.jsx("button",{onClick:p=>{p.stopPropagation(),i()},title:"Delete conversation","aria-label":"Delete conversation",style:{background:"none",border:"none",color:"var(--status-error)",cursor:"pointer",padding:"2px 4px",fontSize:"0.75rem",lineHeight:1,opacity:.7,flexShrink:0},children:"×"})]})}function DG(){const[t,e]=G.useState(""),[n,i]=G.useState([]),[r,s]=G.useState(NG),[l,c]=G.useState(!1),[d,p]=G.useState(""),[m,g]=G.useState(0),x=G.useRef(null),v=G.useRef(null),E=G.useRef(null),A=G.useRef(null),C=nr(se=>se.conversations),w=nr(se=>se.conversationId),k=nr(se=>se.messages),N=nr(se=>se.streaming),D=nr(se=>se.streamingText),H=nr(se=>se.activity),z=nr(se=>se.error),F=nr(se=>se.addUserMessage),ee=nr(se=>se.startStreaming),P=nr(se=>se.loadHistory),I=nr(se=>se.selectConversation),V=nr(se=>se.deleteConversation);G.useEffect(()=>{P(Wy)},[P]),G.useEffect(()=>{var se,pe;(pe=(se=x.current)==null?void 0:se.scrollIntoView)==null||pe.call(se,{behavior:"smooth"})},[k,D]);const X=G.useCallback(()=>{const se=v.current;se&&(se.style.height="auto",se.style.height=Math.min(se.scrollHeight,200)+"px")},[]);G.useEffect(()=>{X()},[t,X]);const ne=G.useCallback(se=>{if(se.startsWith("/")){const pe=se.slice(1);p(pe),c(!0),g(0)}else c(!1)},[]),q=G.useCallback(()=>V2.filter(se=>se.command.toLowerCase().includes(d.toLowerCase())||se.description.toLowerCase().includes(d.toLowerCase())),[d]),Q=G.useCallback(se=>{var pe;e("/"+se.command+(se.args?" ":"")),c(!1),(pe=v.current)==null||pe.focus()},[]),B=G.useCallback(()=>{N||_D(Wy)},[N]),Y=G.useCallback(se=>{N||V(se,Wy)},[N,V]),Z=G.useCallback(se=>{N||se===w||I(se)},[N,w,I]),$=G.useCallback(()=>{const se=t.trim();!se||N||(F(se),ee(),xD(Wy,se,n.length>0?n:void 0),e(""),i([]),c(!1),v.current&&(v.current.style.height="auto"))},[t,N,n,F,ee]),j=G.useCallback(se=>{if(l){const pe=q();if(se.key==="ArrowDown"){se.preventDefault(),g(Ae=>Math.min(Ae+1,pe.length-1));return}if(se.key==="ArrowUp"){se.preventDefault(),g(Ae=>Math.max(Ae-1,0));return}if(se.key==="Enter"&&!se.shiftKey){se.preventDefault(),pe[m]&&Q(pe[m]);return}if(se.key==="Escape"){se.preventDefault(),c(!1);return}if(se.key==="Tab"){se.preventDefault(),pe[m]&&Q(pe[m]);return}}se.key==="Enter"&&!se.shiftKey&&(se.preventDefault(),$())},[l,q,m,Q,$]),K=G.useCallback(se=>{const pe=se.target.value;e(pe),ne(pe)},[ne]),te=G.useCallback(async se=>{var Ae;if(!se)return;const pe=[];for(const Le of Array.from(se))if(!(Le.size>512e3))try{const Ge=await Le.text();pe.push({name:Le.name,content:Ge})}catch{}i(Le=>[...Le,...pe]),(Ae=v.current)==null||Ae.focus()},[]),U=G.useCallback(se=>{se.preventDefault(),se.stopPropagation(),te(se.dataTransfer.files)},[te]),le=G.useCallback(se=>{se.preventDefault(),se.stopPropagation()},[]),de=G.useCallback(se=>{i(pe=>pe.filter((Ae,Le)=>Le!==se))},[]),ge=t.trim()&&!N;return R.jsxs("div",{style:{display:"flex",height:"100%"},onDrop:U,onDragOver:le,children:[R.jsxs("div",{style:{width:220,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",flexShrink:0},children:[R.jsx("div",{style:{padding:"var(--sp-2)"},children:R.jsx("button",{onClick:B,disabled:N,"aria-label":"New conversation",style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",background:"var(--accent-glow)",border:"1px solid rgba(0, 200, 255, 0.15)",borderRadius:"var(--radius-sm)",color:"var(--accent)",cursor:N?"not-allowed":"pointer",fontFamily:"var(--font-mono)",fontSize:"0.72rem",fontWeight:600,letterSpacing:"0.02em",opacity:N?.5:1,transition:"all var(--duration-fast) var(--ease-out)"},children:"+ New Chat"})}),R.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"0 var(--sp-2) var(--sp-2)",display:"flex",flexDirection:"column",gap:2},children:[C.length===0&&R.jsx("div",{style:{padding:"var(--sp-4) var(--sp-2)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)"},children:"No conversations yet"}),C.map(se=>R.jsx(OG,{conv:se,isActive:se.id===w,onSelect:()=>Z(se.id),onDelete:()=>Y(se.id)},se.id))]})]}),R.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[R.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:"4px var(--sp-4)",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",gap:2},children:[R.jsx("button",{onClick:()=>s(se=>Math.max(se-1,0)),disabled:r===0,title:"Decrease font size","aria-label":"Decrease font size",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:r===0?"var(--text-muted)":"var(--text-secondary)",cursor:r===0?"not-allowed":"pointer",padding:"2px 7px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:700,lineHeight:1.4,opacity:r===0?.35:.7},children:"A-"}),R.jsx("button",{onClick:()=>s(se=>Math.min(se+1,Zc.length-1)),disabled:r===Zc.length-1,title:"Increase font size","aria-label":"Increase font size",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:r===Zc.length-1?"var(--text-muted)":"var(--text-secondary)",cursor:r===Zc.length-1?"not-allowed":"pointer",padding:"2px 7px",fontFamily:"var(--font-mono)",fontSize:"0.8rem",fontWeight:700,lineHeight:1.4,opacity:r===Zc.length-1?.35:.7},children:"A+"})]}),R.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"var(--sp-4)",display:"flex",flexDirection:"column"},children:[k.length===0&&!N&&R.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,gap:"var(--sp-3)",opacity:.6},children:[R.jsx("div",{style:{width:48,height:48,borderRadius:"var(--radius-md)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.2rem",color:"var(--accent)"},children:"EX"}),R.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.82rem",fontFamily:"var(--font-display)"},children:"ExpxAgents Terminal"}),R.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.7rem",fontFamily:"var(--font-mono)"},children:"Type / to see available commands"})]}),k.map(se=>R.jsx(kG,{message:se,fontSize:Zc[r]},se.id)),N&&D&&R.jsx("div",{"data-role":"assistant",style:{alignSelf:"flex-start",background:"var(--agent-bubble)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:"85%",marginBottom:"var(--sp-2)"},children:R.jsxs("div",{style:{color:"var(--text-primary)",fontSize:`${Zc[r]}rem`,lineHeight:1.55},children:[R.jsx(h_,{content:D}),R.jsx("span",{style:{display:"inline-block",width:6,height:14,background:"var(--accent)",marginLeft:2,animation:"pulse 1s ease-in-out infinite",borderRadius:1,verticalAlign:"text-bottom"}})]})}),N&&!D&&R.jsx("div",{style:{alignSelf:"flex-start",display:"flex",flexDirection:"column",gap:4,padding:"10px 14px",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[R.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"pulse 1s ease-in-out infinite"}}),H||"Thinking..."]})}),z&&R.jsx("div",{style:{alignSelf:"center",background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.25)",borderRadius:"var(--radius-sm)",padding:"8px 14px",color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",marginBottom:"var(--sp-2)"},children:z}),R.jsx("div",{ref:x})]}),R.jsxs("div",{ref:A,style:{borderTop:"1px solid var(--border-subtle)",background:"var(--surface-1)",position:"relative"},children:[R.jsx("div",{style:{position:"relative",padding:"0 var(--sp-4)"},children:R.jsx(MG,{commands:V2,filter:d,selectedIndex:m,onSelect:Q,visible:l})}),n.length>0&&R.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,padding:"var(--sp-2) var(--sp-4) 0"},children:n.map((se,pe)=>R.jsx(RG,{file:se,onRemove:()=>de(pe)},`${se.name}-${pe}`))}),R.jsxs("div",{style:{display:"flex",padding:"var(--sp-3) var(--sp-4)",gap:"var(--sp-2)",alignItems:"flex-end"},children:[R.jsx("button",{onClick:()=>{var se;return(se=E.current)==null?void 0:se.click()},disabled:N,title:"Attach files (text only, max 500KB)",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-muted)",cursor:N?"not-allowed":"pointer",padding:"6px 8px",fontSize:"1rem",lineHeight:1,opacity:N?.4:.7,transition:"opacity var(--duration-fast) var(--ease-out)",flexShrink:0},"aria-label":"Attach file",children:"📎"}),R.jsx("input",{ref:E,type:"file",multiple:!0,style:{display:"none"},onChange:se=>te(se.target.files)}),R.jsx("textarea",{ref:v,className:"input",value:t,onChange:K,onKeyDown:j,placeholder:"Type a message... (/ for commands)",disabled:N,rows:1,style:{flex:1,resize:"none",overflow:"hidden",minHeight:36,maxHeight:200,lineHeight:1.5,fontFamily:"var(--font-mono)",fontSize:`${Zc[r]}rem`}}),R.jsx("button",{onClick:$,disabled:!ge,"aria-label":"Send",className:ge?"btn btn-accent":"btn",style:{padding:"0 var(--sp-5)",cursor:ge?"pointer":"not-allowed",opacity:ge?1:.4,flexShrink:0,height:36},children:"Send"})]})]})]})]})}const zG={planned:"var(--status-idle)",executing:"var(--accent)",done:"var(--status-active)"},BG={planned:"planejado",executing:"executando",done:"finalizado"},X2={idle:"var(--status-idle)",working:"var(--accent)",delivering:"var(--accent-dim)",done:"var(--status-active)",checkpoint:"var(--status-warning)"};function LG({step:t}){const e=zG[t.status],n=t.status==="executing";return R.jsxs("div",{style:{background:"var(--surface-3)",borderRadius:"var(--radius-sm)",padding:"12px 14px",marginBottom:"var(--sp-2)",border:"1px solid",borderColor:n?e:"var(--border-subtle)",transition:"border-color var(--duration-fast) var(--ease-out)"},children:[R.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[R.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",fontWeight:700,color:"var(--text-muted)",letterSpacing:"0.04em"},children:["STEP ",t.stepIndex]}),R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",fontWeight:600,color:e,padding:"2px 8px",borderRadius:"var(--radius-full)",border:`1px solid ${e}`,letterSpacing:"0.02em"},children:BG[t.status]})]}),R.jsx("div",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)",marginBottom:8,lineHeight:1.4},children:t.label}),R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)"},children:t.agentName}),t.agentStatus&&t.status==="executing"&&R.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:X2[t.agentStatus],boxShadow:`0 0 4px ${X2[t.agentStatus]}`,display:"inline-block"}})]})]})}const UG=[{key:"planned",label:"Planejado",color:"var(--status-idle)",glow:"none"},{key:"executing",label:"Executando",color:"var(--accent)",glow:"var(--accent-glow)"},{key:"done",label:"Finalizado",color:"var(--status-active)",glow:"var(--status-active-glow)"}];function IG(t){return!t||t==="idle"?"planned":t==="done"?"done":"executing"}function HG(){const t=Ta(c=>c.selectedSquad),e=Ta(c=>c.activeStates),n=Ta(c=>c.squads),i=t?e[t]:null,r=t?n.find(c=>c.code===t):null,s=G.useMemo(()=>{var c,d;if(i)return i.agents.filter(p=>p.stepIndex>0).sort((p,m)=>p.stepIndex-m.stepIndex).map(p=>({stepIndex:p.stepIndex,stepId:`step-${p.stepIndex}`,label:p.stepLabel,agentId:p.id,agentName:p.name,agentIcon:p.icon,agentStatus:p.status,status:IG(p.status)}));if((d=(c=r==null?void 0:r.pipeline)==null?void 0:c.steps)!=null&&d.length){const p=r.agents||[];return r.pipeline.steps.map((m,g)=>{const x=p.find(v=>v.id===m.agent);return{stepIndex:g+1,stepId:m.id,label:m.label,agentId:m.agent,agentName:(x==null?void 0:x.name)||m.agent,agentIcon:(x==null?void 0:x.icon)||"robot",agentStatus:null,status:"planned"}})}return[]},[i,r]),l=G.useMemo(()=>UG.map(c=>({...c,steps:s.filter(d=>d.status===c.key)})),[s]);return t?s.length===0?R.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:"var(--sp-3)",animation:"fadeIn 0.5s var(--ease-out) both"},children:[R.jsx("span",{style:{fontSize:"1.2rem",color:"var(--text-muted)"},children:"▦"}),R.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.85rem"},children:"No pipeline configured for this squad"})]}):R.jsx("div",{style:{display:"flex",gap:"var(--sp-4)",padding:"var(--sp-5)",height:"100%",overflow:"auto"},children:l.map((c,d)=>R.jsxs("div",{"data-testid":`column-${c.key}`,style:{flex:1,background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)",display:"flex",flexDirection:"column",minWidth:220,animation:`fadeInUp 0.4s var(--ease-out) ${d*80}ms both`},children:[R.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)",paddingBottom:"var(--sp-3)",borderBottom:`2px solid ${c.color}`},children:[R.jsx("span",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)"},children:c.label}),R.jsx("span",{"data-testid":`count-${c.key}`,style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,color:c.color,background:c.glow,width:22,height:22,borderRadius:"var(--radius-full)",display:"flex",alignItems:"center",justifyContent:"center",border:`1px solid ${c.color}`},children:c.steps.length})]}),R.jsx("div",{style:{flex:1,overflowY:"auto"},children:c.steps.map(p=>R.jsx(LG,{step:p},p.stepId))})]},c.key))}):R.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:"var(--sp-3)",animation:"fadeIn 0.5s var(--ease-out) both"},children:[R.jsx("span",{style:{fontSize:"1.2rem",color:"var(--text-muted)"},children:"▦"}),R.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.85rem"},children:"Select a squad to view the kanban board"})]})}function jG(){const t=dl(N=>N.user),[e,n]=G.useState([]),[i,r]=G.useState(!0),[s,l]=G.useState(""),[c,d]=G.useState(""),[p,m]=G.useState("viewer"),[g,x]=G.useState(null),[v,E]=G.useState(null),A=G.useCallback(async()=>{try{const N=await fetch("/api/users",{credentials:"include"});if(N.ok){const D=await N.json();n(D.users)}}catch{x("Failed to load users")}finally{r(!1)}},[]);G.useEffect(()=>{A()},[A]);const C=async()=>{if(!(!s.trim()||!c.trim())){x(null);try{const N=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:s,password:c,role:p}),credentials:"include"});if(!N.ok){const D=await N.json();x(D.error||"Failed to create user");return}l(""),d(""),m("viewer"),await A()}catch{x("Network error")}}},w=async(N,D)=>{try{(await fetch(`/api/users/${N}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:D}),credentials:"include"})).ok&&await A()}catch{x("Failed to update role")}},k=async N=>{try{(await fetch(`/api/users/${N}`,{method:"DELETE",credentials:"include"})).ok&&(E(null),await A())}catch{x("Failed to delete user")}};return i?R.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading users..."}):R.jsxs("div",{children:[R.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"User Management"}),g&&R.jsx("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:g}),R.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-5)",flexWrap:"wrap",alignItems:"center"},children:[R.jsx("input",{className:"input",placeholder:"Username",value:s,onChange:N=>l(N.target.value),style:{flex:1,minWidth:120}}),R.jsx("input",{className:"input",placeholder:"Password",type:"password",value:c,onChange:N=>d(N.target.value),style:{flex:1,minWidth:120}}),R.jsxs("select",{className:"input",value:p,onChange:N=>m(N.target.value),style:{minWidth:100},children:[R.jsx("option",{value:"viewer",children:"viewer"}),R.jsx("option",{value:"operator",children:"operator"}),R.jsx("option",{value:"admin",children:"admin"})]}),R.jsx("button",{onClick:C,className:"btn btn-accent",children:"Create User"})]}),R.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[R.jsx("thead",{children:R.jsx("tr",{style:{borderBottom:"1px solid var(--border-default)"},children:["Username","Email","Role","Last Login","Actions"].map((N,D)=>R.jsx("th",{style:{textAlign:D===4?"right":"left",padding:"8px 12px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"},children:N},N))})}),R.jsx("tbody",{children:e.map(N=>R.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[R.jsx("td",{style:{padding:"10px 12px",color:"var(--text-primary)",fontSize:"0.82rem"},children:N.username}),R.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:N.email||"—"}),R.jsx("td",{style:{padding:"10px 12px"},children:N.id===(t==null?void 0:t.id)?R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:N.role}):R.jsxs("select",{className:"input",value:N.role,onChange:D=>w(N.id,D.target.value),style:{padding:"4px 8px",fontSize:"0.75rem"},children:[R.jsx("option",{value:"viewer",children:"viewer"}),R.jsx("option",{value:"operator",children:"operator"}),R.jsx("option",{value:"admin",children:"admin"})]})}),R.jsx("td",{style:{padding:"10px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:N.last_login?new Date(N.last_login).toLocaleDateString():"—"}),R.jsx("td",{style:{padding:"10px 12px",textAlign:"right"},children:N.id!==(t==null?void 0:t.id)&&(v===N.id?R.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)",alignItems:"center"},children:[R.jsx("span",{style:{color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:"Confirm?"}),R.jsx("button",{onClick:()=>k(N.id),className:"btn btn-sm btn-danger",children:"Yes"}),R.jsx("button",{onClick:()=>E(null),className:"btn btn-sm",children:"No"})]}):R.jsx("button",{onClick:()=>E(N.id),className:"btn btn-sm btn-danger",children:"Delete"}))})]},N.id))})]})]})}function PG(){const t=Ta(d=>d.selectedSquad),e=Ta(d=>d.activeStates),[n,i]=G.useState(null),[r,s]=G.useState(!1),l=t?e[t]:null;if(G.useEffect(()=>{if(!t){i(null);return}s(!0),fetch(`/api/squads/${t}`,{credentials:"include"}).then(d=>d.ok?d.json():null).then(d=>{d&&i(d.data)}).finally(()=>s(!1))},[t]),!t)return R.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontSize:"0.85rem"},children:"Select a squad to view details"});if(r)return R.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading squad details..."});const c={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,marginBottom:"var(--sp-2)",textTransform:"uppercase",letterSpacing:"0.08em"};return R.jsxs("div",{children:[R.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"Squad Info"}),n&&R.jsxs(R.Fragment,{children:[R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:c,children:"Name"}),R.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.9rem",fontWeight:600},children:n.name})]}),R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:c,children:"Description"}),R.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.5},children:n.description})]}),R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:c,children:"Agents"}),R.jsx("div",{style:{display:"flex",gap:"var(--sp-2)",flexWrap:"wrap"},children:n.agents.map(d=>R.jsx("span",{style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"4px 10px",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-primary)"},children:d.name},d.id))})]}),R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:c,children:"Pipeline Steps"}),R.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:n.pipeline.steps.map((d,p)=>R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"8px 12px",fontSize:"0.82rem"},children:[R.jsx("span",{style:{background:"var(--accent)",color:"var(--text-inverse)",width:22,height:22,borderRadius:"var(--radius-full)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,flexShrink:0},children:p+1}),R.jsx("span",{style:{color:"var(--text-primary)"},children:d.label}),R.jsx("span",{style:{fontFamily:"var(--font-mono)",color:"var(--text-muted)",fontSize:"0.68rem",marginLeft:"auto"},children:d.agent})]},d.id))})]})]}),l&&R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:c,children:"Current State"}),R.jsx("pre",{"data-testid":"state-json",style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--accent)",overflow:"auto",maxHeight:400,lineHeight:1.5},children:JSON.stringify(l,null,2)})]})]})}function GG(){const[t,e]=G.useState(null),[n,i]=G.useState(null),[r,s]=G.useState(!0),[l,c]=G.useState(null),d=G.useCallback(async()=>{s(!0);try{const g=await fetch("/api/health",{credentials:"include"});if(g.ok){const x=await g.json();e(x),i(x.status==="ok")}else i(!1)}catch{i(!1)}finally{s(!1),c(new Date().toLocaleTimeString())}},[]);G.useEffect(()=>{d()},[d]);const p={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,marginBottom:"var(--sp-2)",textTransform:"uppercase",letterSpacing:"0.08em"},m={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 12px",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-2)",fontSize:"0.82rem"};return R.jsxs("div",{children:[R.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)"},children:[R.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)"},children:"Server Info"}),R.jsx("button",{onClick:d,className:"btn btn-sm",children:"Refresh"})]}),R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:p,children:"Health Status"}),R.jsxs("div",{style:m,children:[R.jsx("span",{style:{color:"var(--text-primary)"},children:"API Server"}),r?R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)",animation:"pulse 1.5s ease-in-out infinite"},children:"Checking..."}):R.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--sp-1)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,color:n?"var(--status-active)":"var(--status-error)"},children:[R.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:n?"var(--status-active)":"var(--status-error)",display:"inline-block",boxShadow:n?"0 0 8px var(--status-active-glow)":"0 0 8px var(--status-error-glow)"}}),n?"Healthy":"Unhealthy"]})]})]}),R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:p,children:"Environment"}),R.jsxs("div",{style:m,children:[R.jsx("span",{style:{color:"var(--text-primary)"},children:"API Port"}),R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"3001"})]}),R.jsxs("div",{style:m,children:[R.jsx("span",{style:{color:"var(--text-primary)"},children:"Dashboard Port (dev)"}),R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"5173"})]})]}),l&&R.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textAlign:"right"},children:["Last checked: ",l]})]})}const FG=[{key:"AWS_ACCESS_KEY_ID",label:"AWS Access Key ID",type:"password",hint:"Your AWS IAM access key"},{key:"AWS_SECRET_ACCESS_KEY",label:"AWS Secret Access Key",type:"password",hint:"Your AWS IAM secret key"},{key:"AWS_REGION",label:"AWS Region",type:"text",hint:"e.g. us-east-1, eu-west-1"},{key:"SES_FROM_EMAIL",label:"SES From Email",type:"text",hint:"Verified sender email in SES"},{key:"SES_RATE_LIMIT",label:"SES Rate Limit",type:"text",hint:"Max emails per second (default: 14)"},{key:"SERVER_URL",label:"Server URL",type:"text",hint:"Public URL for unsubscribe links"},{key:"PORT",label:"Port",type:"text",hint:"Server port (requires restart)"},{key:"CORS_ORIGIN",label:"CORS Origin",type:"text",hint:"Allowed origin for CORS"},{key:"NODE_ENV",label:"Node Environment",type:"text",hint:"development or production"}];function qG(){const[t,e]=G.useState({}),[n,i]=G.useState(!0),[r,s]=G.useState(!1),[l,c]=G.useState(null),[d,p]=G.useState(new Set);G.useEffect(()=>{fetch("/api/settings/env").then(x=>x.json()).then(x=>{e(x.settings||{}),i(!1)}).catch(()=>i(!1))},[]);const m=(x,v)=>{e(E=>({...E,[x]:v})),p(E=>new Set(E).add(x)),c(null)},g=async()=>{if(d.size===0)return;s(!0),c(null);const x={};for(const v of d)x[v]=t[v]||"";try{const v=await fetch("/api/settings/env",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)});if(v.ok){const E=await v.json();e(E.settings),p(new Set),c({type:"success",text:"Settings saved successfully"})}else{const E=await v.json();c({type:"error",text:E.error||"Failed to save"})}}catch{c({type:"error",text:"Network error"})}finally{s(!1)}};return n?R.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):R.jsxs("div",{style:{maxWidth:640},children:[R.jsx("div",{style:{marginBottom:"var(--sp-4)"},children:R.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",lineHeight:1.6},children:"Server environment variables. Secret values are masked. Changes to PORT or NODE_ENV require a server restart."})}),R.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:FG.map(x=>R.jsxs("div",{children:[R.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-secondary)",fontWeight:600,letterSpacing:"0.04em",marginBottom:4},children:x.label}),R.jsx("input",{type:x.type,value:t[x.key]||"",onChange:v=>m(x.key,v.target.value),placeholder:x.hint,style:{width:"100%",padding:"8px 12px",background:"var(--surface-2)",border:d.has(x.key)?"1px solid var(--accent)":"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",boxSizing:"border-box"}}),R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:x.hint})]},x.key))}),R.jsxs("div",{style:{marginTop:"var(--sp-4)",display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[R.jsx("button",{onClick:g,disabled:d.size===0||r,style:{padding:"8px 24px",background:d.size>0?"var(--accent)":"var(--surface-3)",border:"none",borderRadius:"var(--radius-sm)",color:d.size>0?"var(--text-inverse)":"var(--text-muted)",cursor:d.size>0?"pointer":"default",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:600,opacity:r?.6:1},children:r?"Saving...":`Save ${d.size>0?`(${d.size})`:""}`}),l&&R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:l.type==="success"?"var(--status-active)":"var(--status-error)"},children:l.text})]})]})}function YG(){const[t,e]=G.useState([]),[n,i]=G.useState(!0),[r,s]=G.useState(null),[l,c]=G.useState(null),[d,p]=G.useState(""),[m,g]=G.useState(""),[x,v]=G.useState(""),[E,A]=G.useState(""),[C,w]=G.useState(null),[k,N]=G.useState(""),[D,H]=G.useState(""),[z,F]=G.useState(""),[ee,P]=G.useState(""),I=G.useCallback(async()=>{try{const B=await fetch("/api/team",{credentials:"include"});if(B.ok){const Y=await B.json();e(Y.members)}}catch{s("Failed to load team members")}finally{i(!1)}},[]);G.useEffect(()=>{I()},[I]);const V=async()=>{if(!(!d.trim()||!m.trim())){s(null);try{const B=await fetch("/api/team",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.trim(),role:m.trim(),email:x.trim()||void 0,phone:E.trim()||void 0}),credentials:"include"});if(!B.ok){const Y=await B.json();s(Y.error||"Failed to create team member");return}p(""),g(""),v(""),A(""),await I()}catch{s("Network error")}}},X=B=>{w(B.id),N(B.name),H(B.role),F(B.email||""),P(B.phone||"")},ne=()=>{w(null)},q=async()=>{if(!(!C||!k.trim()||!D.trim())){s(null);try{(await fetch(`/api/team/${C}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k.trim(),role:D.trim(),email:z.trim()||void 0,phone:ee.trim()||void 0}),credentials:"include"})).ok&&(w(null),await I())}catch{s("Failed to update member")}}},Q=async B=>{try{(await fetch(`/api/team/${B}`,{method:"DELETE",credentials:"include"})).ok&&(c(null),await I())}catch{s("Failed to delete member")}};return n?R.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading team..."}):R.jsxs("div",{children:[R.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"Team Members"}),r&&R.jsx("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:r}),R.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-5)",flexWrap:"wrap",alignItems:"center"},children:[R.jsx("input",{className:"input",placeholder:"Name *",value:d,onChange:B=>p(B.target.value),style:{flex:1,minWidth:120}}),R.jsx("input",{className:"input",placeholder:"Role *",value:m,onChange:B=>g(B.target.value),style:{flex:1,minWidth:120}}),R.jsx("input",{className:"input",placeholder:"Email",type:"email",value:x,onChange:B=>v(B.target.value),style:{flex:1,minWidth:150}}),R.jsx("input",{className:"input",placeholder:"Phone",type:"tel",value:E,onChange:B=>A(B.target.value),style:{flex:1,minWidth:130}}),R.jsx("button",{onClick:V,className:"btn btn-accent",children:"Add Member"})]}),R.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[R.jsx("thead",{children:R.jsx("tr",{style:{borderBottom:"1px solid var(--border-default)"},children:["Name","Role","Email","Phone","Actions"].map((B,Y)=>R.jsx("th",{style:{textAlign:Y===4?"right":"left",padding:"8px 12px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"},children:B},B))})}),R.jsxs("tbody",{children:[t.length===0&&R.jsx("tr",{children:R.jsx("td",{colSpan:5,style:{padding:"var(--sp-5)",textAlign:"center",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:"No team members yet"})}),t.map(B=>C===B.id?R.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-3)"},children:[R.jsx("td",{style:{padding:"6px 12px"},children:R.jsx("input",{className:"input",value:k,onChange:Y=>N(Y.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),R.jsx("td",{style:{padding:"6px 12px"},children:R.jsx("input",{className:"input",value:D,onChange:Y=>H(Y.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),R.jsx("td",{style:{padding:"6px 12px"},children:R.jsx("input",{className:"input",value:z,onChange:Y=>F(Y.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),R.jsx("td",{style:{padding:"6px 12px"},children:R.jsx("input",{className:"input",value:ee,onChange:Y=>P(Y.target.value),style:{width:"100%",fontSize:"0.82rem"}})}),R.jsx("td",{style:{padding:"6px 12px",textAlign:"right"},children:R.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)"},children:[R.jsx("button",{onClick:q,className:"btn btn-sm btn-accent",children:"Save"}),R.jsx("button",{onClick:ne,className:"btn btn-sm",children:"Cancel"})]})})]},B.id):R.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[R.jsx("td",{style:{padding:"10px 12px",color:"var(--text-primary)",fontSize:"0.82rem"},children:B.name}),R.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:B.role}),R.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:B.email||"—"}),R.jsx("td",{style:{padding:"10px 12px",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:B.phone||"—"}),R.jsx("td",{style:{padding:"10px 12px",textAlign:"right"},children:l===B.id?R.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)",alignItems:"center"},children:[R.jsx("span",{style:{color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:"Confirm?"}),R.jsx("button",{onClick:()=>Q(B.id),className:"btn btn-sm btn-danger",children:"Yes"}),R.jsx("button",{onClick:()=>c(null),className:"btn btn-sm",children:"No"})]}):R.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)"},children:[R.jsx("button",{onClick:()=>X(B),className:"btn btn-sm",children:"Edit"}),R.jsx("button",{onClick:()=>c(B.id),className:"btn btn-sm btn-danger",children:"Delete"})]})})]},B.id))]})]})]})}const VG={dev:"Development",messaging:"Messaging",ads:"Advertising",crm:"CRM",support:"Support",email:"Email Marketing",sales:"Sales & Payments",pm:"Project Management",monitoring:"Monitoring",cloud:"Cloud & Deploy",design:"Design"},XG={dev:"⌨",messaging:"💬",ads:"📢",crm:"📊",support:"🎧",email:"✉",sales:"💰",pm:"📋",monitoring:"🔍",cloud:"☁",design:"🎨"};function KG(){const[t,e]=G.useState([]),[n,i]=G.useState([]),[r,s]=G.useState(!0),[l,c]=G.useState(null),[d,p]=G.useState(null),[m,g]=G.useState(!1),[x,v]=G.useState({}),[E,A]=G.useState(!1),[C,w]=G.useState(null),[k,N]=G.useState(""),D=G.useCallback(async()=>{try{const[X,ne]=await Promise.all([fetch("/api/integrations/catalog",{credentials:"include"}),fetch("/api/integrations",{credentials:"include"})]);if(X.ok){const q=await X.json();e(q.providers)}if(ne.ok){const q=await ne.json();i(q.integrations)}}catch{c("Failed to load integrations")}finally{s(!1)}},[]);G.useEffect(()=>{D()},[D]);const H=X=>n.find(ne=>ne.provider===X),z=X=>{const ne=H(X.key),q={};for(const Q of X.fields)q[Q.key]=(ne==null?void 0:ne.config[Q.key])||"";v(q),A((ne==null?void 0:ne.enabled)??!1),p(X.key),c(null)},F=async()=>{if(d){g(!0),c(null);try{const X=await fetch(`/api/integrations/${d}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:E,config:x}),credentials:"include"});if(!X.ok){const ne=await X.json();c(ne.error||"Failed to save");return}await D(),p(null)}catch{c("Network error")}finally{g(!1)}}},ee=async X=>{try{(await fetch(`/api/integrations/${X}`,{method:"DELETE",credentials:"include"})).ok&&(await D(),d===X&&p(null))}catch{c("Failed to disconnect")}},P=Array.from(new Set(t.map(X=>X.category))),I=k.toLowerCase(),V=t.filter(X=>!(C&&X.category!==C||k&&!X.name.toLowerCase().includes(I)&&!X.description.toLowerCase().includes(I)));return r?R.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading integrations..."}):R.jsxs("div",{children:[R.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-2)"},children:"Integrations"}),R.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)",marginBottom:"var(--sp-4)"},children:"Configure third-party services for your squads and agents"}),R.jsx("input",{className:"input",type:"text",placeholder:"Search integrations...",value:k,onChange:X=>N(X.target.value),style:{width:"100%",fontSize:"0.8rem",marginBottom:"var(--sp-3)"}}),l&&R.jsx("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:l}),R.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[R.jsx("button",{onClick:()=>w(null),style:{padding:"4px 12px",border:"1px solid",borderColor:C?"var(--border-subtle)":"var(--accent)",borderRadius:"var(--radius-sm)",background:C?"transparent":"var(--accent)",color:C?"var(--text-secondary)":"#fff",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer"},children:"All"}),P.map(X=>R.jsxs("button",{onClick:()=>w(X),style:{padding:"4px 12px",border:"1px solid",borderColor:C===X?"var(--accent)":"var(--border-subtle)",borderRadius:"var(--radius-sm)",background:C===X?"var(--accent)":"transparent",color:C===X?"#fff":"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer"},children:[XG[X]||""," ",VG[X]||X]},X))]}),R.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:"var(--sp-3)"},children:V.map(X=>{const ne=H(X.key),q=d===X.key;return R.jsxs("div",{style:{background:"var(--surface-3)",border:"1px solid",borderColor:ne!=null&&ne.enabled?"var(--status-running)":"var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)",transition:"all var(--duration-fast) var(--ease-out)",gridColumn:q?"1 / -1":void 0},children:[R.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:q?"var(--sp-3)":0},children:[R.jsxs("div",{children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[R.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:600,fontSize:"0.85rem",color:"var(--text-primary)"},children:X.name}),(ne==null?void 0:ne.enabled)&&R.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--status-running)",boxShadow:"0 0 4px var(--status-running)",display:"inline-block"}})]}),R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:"var(--text-muted)"},children:X.description})]}),R.jsx("button",{onClick:()=>q?p(null):z(X),className:"btn btn-sm",style:{flexShrink:0},children:q?"Close":ne?"Edit":"Configure"})]}),q&&R.jsxs("div",{style:{borderTop:"1px solid var(--border-subtle)",paddingTop:"var(--sp-3)"},children:[R.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",cursor:"pointer"},children:[R.jsx("input",{type:"checkbox",checked:E,onChange:Q=>A(Q.target.checked)}),"Enabled"]}),R.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:X.fields.map(Q=>R.jsxs("div",{children:[R.jsxs("label",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:2,display:"block"},children:[Q.label," ",Q.required&&"*"]}),R.jsx("input",{className:"input",type:Q.type==="password"?"password":"text",placeholder:Q.placeholder||"",value:x[Q.key]||"",onChange:B=>v(Y=>({...Y,[Q.key]:B.target.value})),style:{width:"100%",fontSize:"0.8rem"}})]},Q.key))}),R.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginTop:"var(--sp-3)",justifyContent:"flex-end"},children:[ne&&R.jsx("button",{onClick:()=>ee(X.key),className:"btn btn-sm btn-danger",children:"Disconnect"}),R.jsx("button",{onClick:()=>p(null),className:"btn btn-sm",children:"Cancel"}),R.jsx("button",{onClick:F,className:"btn btn-sm btn-accent",disabled:m,children:m?"Saving...":"Save"})]})]})]},X.key)})})]})}function WG(){const t=dl(l=>l.user),e=(t==null?void 0:t.role)==="admin",[n,i]=G.useState(e?"users":"squad"),s=[{key:"users",label:"Users",icon:"◉",adminOnly:!0},{key:"team",label:"Team",icon:"◎"},{key:"integrations",label:"Integrations",icon:"⬡"},{key:"squad",label:"Squad",icon:"⬢"},{key:"server",label:"Server",icon:"⚙"},{key:"env",label:"Environment",icon:"◆",adminOnly:!0}].filter(l=>!l.adminOnly||e);return R.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",padding:"var(--sp-5)",animation:"fadeIn 0.4s var(--ease-out) both"},children:[R.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[R.jsx("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Settings"}),R.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Configuration and management"})]}),R.jsx("div",{style:{display:"flex",gap:"var(--sp-1)",marginBottom:"var(--sp-5)",borderBottom:"1px solid var(--border-subtle)"},children:s.map(l=>R.jsxs("button",{onClick:()=>i(l.key),style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"10px 16px",border:"none",borderBottom:n===l.key?"2px solid var(--accent)":"2px solid transparent",background:"transparent",color:n===l.key?"var(--text-primary)":"var(--text-muted)",fontFamily:"var(--font-display)",fontWeight:n===l.key?600:400,fontSize:"0.82rem",cursor:"pointer",transition:"all var(--duration-fast) var(--ease-out)"},children:[R.jsx("span",{style:{fontSize:"0.75rem",opacity:.7},children:l.icon}),l.label]},l.key))}),R.jsxs("div",{style:{flex:1,overflow:"auto"},children:[n==="users"&&e&&R.jsx(jG,{}),n==="team"&&R.jsx(YG,{}),n==="integrations"&&R.jsx(KG,{}),n==="squad"&&R.jsx(PG,{}),n==="server"&&R.jsx(GG,{}),n==="env"&&e&&R.jsx(qG,{})]})]})}function ZG(){const t=lo(d=>d.jobs),e=lo(d=>d.loading),n=lo(d=>d.fetchJobs),i=lo(d=>d.pauseJob),r=lo(d=>d.resumeJob),s=lo(d=>d.triggerJob);G.useEffect(()=>{n()},[n]);const l=d=>d==="active"?"var(--status-active)":d==="paused"?"var(--status-warning)":"var(--status-error)",c=d=>d==="active"?"var(--status-active-glow)":d==="paused"?"var(--status-warning-glow)":"var(--status-error-glow)";return R.jsxs("div",{style:{padding:"var(--sp-6)",animation:"fadeIn 0.4s var(--ease-out) both"},children:[R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Scheduler"}),R.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Autonomous job execution and monitoring"})]}),e&&R.jsx("p",{style:{color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading jobs..."}),!e&&t.length===0&&R.jsxs("div",{style:{padding:"var(--sp-8)",textAlign:"center",color:"var(--text-muted)"},children:[R.jsx("div",{style:{fontSize:"1.5rem",marginBottom:"var(--sp-3)"},children:"⏣"}),R.jsx("p",{style:{fontSize:"0.85rem",marginBottom:"var(--sp-2)"},children:"No scheduled jobs"}),R.jsxs("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:["Add ",R.jsx("code",{style:{background:"var(--surface-3)",padding:"2px 6px",borderRadius:"var(--radius-xs)"},children:"schedule.enabled: true"})," to a squad.yaml to get started."]})]}),R.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:t.map((d,p)=>R.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)",display:"flex",justifyContent:"space-between",alignItems:"center",transition:"border-color var(--duration-fast) var(--ease-out)",animation:`fadeInUp 0.4s var(--ease-out) ${p*60}ms both`},children:[R.jsxs("div",{style:{flex:1,minWidth:0},children:[R.jsx("div",{style:{fontWeight:600,fontSize:"0.9rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:d.squad_name}),R.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:"var(--sp-3)",flexWrap:"wrap"},children:[R.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,color:l(d.status)},children:[R.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:l(d.status),boxShadow:`0 0 8px ${c(d.status)}`,display:"inline-block",animation:d.status==="active"?"statusPulse 2s ease-in-out infinite":"none"}}),d.status]}),R.jsx("span",{style:{color:"var(--border-strong)"},children:"│"}),R.jsx("code",{style:{background:"var(--surface-3)",padding:"1px 5px",borderRadius:"var(--radius-xs)",fontSize:"0.65rem"},children:d.cron_expression}),d.last_run_at&&R.jsxs(R.Fragment,{children:[R.jsx("span",{style:{color:"var(--border-strong)"},children:"│"}),R.jsxs("span",{children:["Last: ",new Date(d.last_run_at).toLocaleString()]})]}),d.last_result&&R.jsxs(R.Fragment,{children:[R.jsx("span",{style:{color:"var(--border-strong)"},children:"│"}),R.jsx("span",{children:d.last_result})]})]})]}),R.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginLeft:"var(--sp-3)"},children:[d.status==="active"?R.jsx("button",{onClick:()=>i(d.squad_name),className:"btn btn-sm",children:"Pause"}):R.jsx("button",{onClick:()=>r(d.squad_name),className:"btn btn-sm",children:"Resume"}),R.jsx("button",{onClick:()=>s(d.squad_name),className:"btn btn-sm btn-accent",children:"Trigger"})]})]},d.squad_name))})]})}const cl=Sf(t=>({leads:[],campaigns:[],lists:[],tags:[],total:0,loading:!1,fetchLeads:async(e={})=>{t({loading:!0});try{const n=new URLSearchParams(e),i=await fetch(`/api/email/leads?${n}`);if(i.ok){const r=await i.json();t({leads:r.data,total:r.total})}}finally{t({loading:!1})}},fetchCampaigns:async(e={})=>{t({loading:!0});try{const n=new URLSearchParams(e),i=await fetch(`/api/email/campaigns?${n}`);if(i.ok){const r=await i.json();t({campaigns:r.data})}}finally{t({loading:!1})}},fetchLists:async()=>{const e=await fetch("/api/email/leads/lists");if(e.ok){const n=await e.json();t({lists:n.lists})}},fetchTags:async()=>{const e=await fetch("/api/email/leads/tags");if(e.ok){const n=await e.json();t({tags:n.tags})}}}));function $G(){const t=cl(g=>g.leads),e=cl(g=>g.total),n=cl(g=>g.lists),i=cl(g=>g.tags),r=cl(g=>g.loading),s=cl(g=>g.fetchLeads),l=cl(g=>g.fetchLists),c=cl(g=>g.fetchTags),[d,p]=G.useState("");G.useEffect(()=>{s(),l(),c()},[s,l,c]);const m=()=>{s(d?{search:d}:{})};return R.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[R.jsxs("div",{style:{display:"flex",gap:"var(--sp-3)"},children:[R.jsx(fv,{label:"Total Leads",value:e}),R.jsx(fv,{label:"Lists",value:n.length}),R.jsx(fv,{label:"Tags",value:i.length})]}),R.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[R.jsx("input",{type:"text",placeholder:"Search leads...",value:d,onChange:g=>p(g.target.value),onKeyDown:g=>g.key==="Enter"&&m(),style:{flex:1,padding:"8px 12px",background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-primary)",fontFamily:"var(--font-body)",fontSize:"0.82rem"}}),R.jsx("button",{onClick:m,className:"btn-ghost",style:{padding:"8px 16px",background:"var(--accent-glow)",border:"1px solid rgba(0, 200, 255, 0.2)",borderRadius:"var(--radius-sm)",color:"var(--accent)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Search"})]}),r?R.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):R.jsx("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:R.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[R.jsx("thead",{children:R.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Email","Name","Company","Status","Source","Created"].map(g=>R.jsx("th",{style:{textAlign:"left",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:g},g))})}),R.jsxs("tbody",{children:[t.map(g=>R.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[R.jsx("td",{style:sa,children:g.email}),R.jsx("td",{style:sa,children:g.name||"—"}),R.jsx("td",{style:sa,children:g.company||"—"}),R.jsx("td",{style:sa,children:R.jsx(HN,{status:g.status})}),R.jsx("td",{style:sa,children:g.source||"—"}),R.jsx("td",{style:{...sa,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(g.created_at).toLocaleDateString()})]},g.id)),t.length===0&&R.jsx("tr",{children:R.jsx("td",{colSpan:6,style:{...sa,textAlign:"center",color:"var(--text-muted)"},children:"No leads found"})})]})]})})]})}function QG(){const t=cl(i=>i.campaigns),e=cl(i=>i.loading),n=cl(i=>i.fetchCampaigns);return G.useEffect(()=>{n()},[n]),R.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:e?R.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):R.jsx("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:R.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[R.jsx("thead",{children:R.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Name","Subject","Status","Recipients","Sent","Bounced","Created"].map(i=>R.jsx("th",{style:{textAlign:"left",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:i},i))})}),R.jsxs("tbody",{children:[t.map(i=>R.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[R.jsx("td",{style:sa,children:i.name}),R.jsx("td",{style:sa,children:i.subject}),R.jsx("td",{style:sa,children:R.jsx(HN,{status:i.status})}),R.jsx("td",{style:{...sa,fontFamily:"var(--font-mono)"},children:i.total_recipients}),R.jsx("td",{style:{...sa,fontFamily:"var(--font-mono)"},children:i.sent_count}),R.jsx("td",{style:{...sa,fontFamily:"var(--font-mono)"},children:i.bounce_count}),R.jsx("td",{style:{...sa,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(i.created_at).toLocaleDateString()})]},i.id)),t.length===0&&R.jsx("tr",{children:R.jsx("td",{colSpan:7,style:{...sa,textAlign:"center",color:"var(--text-muted)"},children:"No campaigns yet"})})]})]})})})}function JG(){return R.jsxs("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)"},children:[R.jsx("h3",{style:{fontFamily:"var(--font-display)",fontSize:"0.9rem",color:"var(--text-primary)",marginBottom:"var(--sp-3)"},children:"Amazon SES Configuration"}),R.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",lineHeight:1.8},children:[R.jsx("p",{children:"Configure these environment variables on the server:"}),R.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",padding:"var(--sp-3)",marginTop:"var(--sp-2)"},children:[R.jsx("code",{children:"AWS_ACCESS_KEY_ID=..."}),R.jsx("br",{}),R.jsx("code",{children:"AWS_SECRET_ACCESS_KEY=..."}),R.jsx("br",{}),R.jsx("code",{children:"AWS_REGION=us-east-1"}),R.jsx("br",{}),R.jsx("code",{children:"SES_FROM_EMAIL=noreply@yourdomain.com"}),R.jsx("br",{}),R.jsx("code",{children:"SES_RATE_LIMIT=14"}),R.jsx("br",{}),R.jsx("code",{children:"SERVER_URL=https://yourdomain.com"})]})]})]})}function fv({label:t,value:e}){return R.jsxs("div",{style:{flex:1,background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)"},children:[R.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:t}),R.jsx("div",{style:{fontFamily:"var(--font-display)",fontSize:"1.4rem",fontWeight:700,color:"var(--accent)"},children:e})]})}function HN({status:t}){const n={active:{bg:"rgba(0, 230, 138, 0.1)",text:"var(--status-active)"},unsubscribed:{bg:"rgba(255, 100, 100, 0.1)",text:"var(--status-error)"},draft:{bg:"rgba(150, 150, 150, 0.1)",text:"var(--text-muted)"},queued:{bg:"rgba(0, 200, 255, 0.1)",text:"var(--accent)"},sending:{bg:"rgba(255, 180, 0, 0.1)",text:"var(--status-warning)"},sent:{bg:"rgba(0, 230, 138, 0.1)",text:"var(--status-active)"},paused:{bg:"rgba(255, 180, 0, 0.1)",text:"var(--status-warning)"},cancelled:{bg:"rgba(255, 100, 100, 0.1)",text:"var(--status-error)"}}[t]||{bg:"rgba(150, 150, 150, 0.1)",text:"var(--text-muted)"};return R.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"var(--radius-xs)",background:n.bg,color:n.text,fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"},children:t})}const sa={padding:"10px 14px",fontSize:"0.82rem",color:"var(--text-secondary)"};function eF(){const[t,e]=G.useState("leads"),n=[{key:"leads",label:"Leads"},{key:"campaigns",label:"Campaigns"},{key:"settings",label:"Settings"}];return R.jsxs("div",{style:{padding:"var(--sp-4)",maxWidth:1100,margin:"0 auto"},children:[R.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[R.jsx("h2",{style:{fontFamily:"var(--font-display)",fontSize:"1.1rem",fontWeight:700,color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Email Engine"}),R.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Lead management, campaigns, and Amazon SES integration"})]}),R.jsx("div",{style:{display:"flex",gap:"var(--sp-1)",marginBottom:"var(--sp-4)",borderBottom:"1px solid var(--border-subtle)",paddingBottom:"var(--sp-1)"},children:n.map(i=>R.jsx("button",{onClick:()=>e(i.key),style:{padding:"8px 16px",background:t===i.key?"var(--accent-glow)":"transparent",border:t===i.key?"1px solid rgba(0, 200, 255, 0.15)":"1px solid transparent",borderRadius:"var(--radius-sm)",color:t===i.key?"var(--accent)":"var(--text-secondary)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:t===i.key?600:400,transition:"all var(--duration-fast) var(--ease-out)"},children:i.label},i.key))}),t==="leads"&&R.jsx($G,{}),t==="campaigns"&&R.jsx(QG,{}),t==="settings"&&R.jsx(JG,{})]})}function Oi(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,i;n<t.length;n++)(i=Oi(t[n]))!==""&&(e+=(e&&" ")+i);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}var tF={value:()=>{}};function rb(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new f0(n)}function f0(t){this._=t}function nF(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}f0.prototype=rb.prototype={constructor:f0,on:function(t,e){var n=this._,i=nF(t+"",n),r,s=-1,l=i.length;if(arguments.length<2){for(;++s<l;)if((r=(t=i[s]).type)&&(r=iF(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<l;)if(r=(t=i[s]).type)n[r]=K2(n[r],t.name,e);else if(e==null)for(r in n)n[r]=K2(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new f0(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],i=0,r=s.length;i<r;++i)s[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,s=i.length;r<s;++r)i[r].value.apply(e,n)}};function iF(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function K2(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=tF,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var m_="http://www.w3.org/1999/xhtml";const W2={svg:"http://www.w3.org/2000/svg",xhtml:m_,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ab(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),W2.hasOwnProperty(e)?{space:W2[e],local:t}:t}function rF(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===m_&&e.documentElement.namespaceURI===m_?e.createElement(t):e.createElementNS(n,t)}}function aF(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function jN(t){var e=ab(t);return(e.local?aF:rF)(e)}function sF(){}function _1(t){return t==null?sF:function(){return this.querySelector(t)}}function lF(t){typeof t!="function"&&(t=_1(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],l=s.length,c=i[r]=new Array(l),d,p,m=0;m<l;++m)(d=s[m])&&(p=t.call(d,d.__data__,m,s))&&("__data__"in d&&(p.__data__=d.__data__),c[m]=p);return new ts(i,this._parents)}function oF(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function cF(){return[]}function PN(t){return t==null?cF:function(){return this.querySelectorAll(t)}}function uF(t){return function(){return oF(t.apply(this,arguments))}}function fF(t){typeof t=="function"?t=uF(t):t=PN(t);for(var e=this._groups,n=e.length,i=[],r=[],s=0;s<n;++s)for(var l=e[s],c=l.length,d,p=0;p<c;++p)(d=l[p])&&(i.push(t.call(d,d.__data__,p,l)),r.push(d));return new ts(i,r)}function GN(t){return function(){return this.matches(t)}}function FN(t){return function(e){return e.matches(t)}}var dF=Array.prototype.find;function hF(t){return function(){return dF.call(this.children,t)}}function pF(){return this.firstElementChild}function mF(t){return this.select(t==null?pF:hF(typeof t=="function"?t:FN(t)))}var gF=Array.prototype.filter;function yF(){return Array.from(this.children)}function bF(t){return function(){return gF.call(this.children,t)}}function xF(t){return this.selectAll(t==null?yF:bF(typeof t=="function"?t:FN(t)))}function vF(t){typeof t!="function"&&(t=GN(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],l=s.length,c=i[r]=[],d,p=0;p<l;++p)(d=s[p])&&t.call(d,d.__data__,p,s)&&c.push(d);return new ts(i,this._parents)}function qN(t){return new Array(t.length)}function _F(){return new ts(this._enter||this._groups.map(qN),this._parents)}function k0(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}k0.prototype={constructor:k0,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function SF(t){return function(){return t}}function EF(t,e,n,i,r,s){for(var l=0,c,d=e.length,p=s.length;l<p;++l)(c=e[l])?(c.__data__=s[l],i[l]=c):n[l]=new k0(t,s[l]);for(;l<d;++l)(c=e[l])&&(r[l]=c)}function wF(t,e,n,i,r,s,l){var c,d,p=new Map,m=e.length,g=s.length,x=new Array(m),v;for(c=0;c<m;++c)(d=e[c])&&(x[c]=v=l.call(d,d.__data__,c,e)+"",p.has(v)?r[c]=d:p.set(v,d));for(c=0;c<g;++c)v=l.call(t,s[c],c,s)+"",(d=p.get(v))?(i[c]=d,d.__data__=s[c],p.delete(v)):n[c]=new k0(t,s[c]);for(c=0;c<m;++c)(d=e[c])&&p.get(x[c])===d&&(r[c]=d)}function TF(t){return t.__data__}function CF(t,e){if(!arguments.length)return Array.from(this,TF);var n=e?wF:EF,i=this._parents,r=this._groups;typeof t!="function"&&(t=SF(t));for(var s=r.length,l=new Array(s),c=new Array(s),d=new Array(s),p=0;p<s;++p){var m=i[p],g=r[p],x=g.length,v=AF(t.call(m,m&&m.__data__,p,i)),E=v.length,A=c[p]=new Array(E),C=l[p]=new Array(E),w=d[p]=new Array(x);n(m,g,A,C,w,v,e);for(var k=0,N=0,D,H;k<E;++k)if(D=A[k]){for(k>=N&&(N=k+1);!(H=C[N])&&++N<E;);D._next=H||null}}return l=new ts(l,i),l._enter=c,l._exit=d,l}function AF(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function MF(){return new ts(this._exit||this._groups.map(qN),this._parents)}function NF(t,e,n){var i=this.enter(),r=this,s=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?s.remove():n(s),i&&r?i.merge(r).order():r}function RF(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,s=i.length,l=Math.min(r,s),c=new Array(r),d=0;d<l;++d)for(var p=n[d],m=i[d],g=p.length,x=c[d]=new Array(g),v,E=0;E<g;++E)(v=p[E]||m[E])&&(x[E]=v);for(;d<r;++d)c[d]=n[d];return new ts(c,this._parents)}function kF(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i=t[e],r=i.length-1,s=i[r],l;--r>=0;)(l=i[r])&&(s&&l.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(l,s),s=l);return this}function OF(t){t||(t=DF);function e(g,x){return g&&x?t(g.__data__,x.__data__):!g-!x}for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var l=n[s],c=l.length,d=r[s]=new Array(c),p,m=0;m<c;++m)(p=l[m])&&(d[m]=p);d.sort(e)}return new ts(r,this._parents).order()}function DF(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function zF(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function BF(){return Array.from(this)}function LF(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length;r<s;++r){var l=i[r];if(l)return l}return null}function UF(){let t=0;for(const e of this)++t;return t}function IF(){return!this.node()}function HF(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r=e[n],s=0,l=r.length,c;s<l;++s)(c=r[s])&&t.call(c,c.__data__,s,r);return this}function jF(t){return function(){this.removeAttribute(t)}}function PF(t){return function(){this.removeAttributeNS(t.space,t.local)}}function GF(t,e){return function(){this.setAttribute(t,e)}}function FF(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function qF(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function YF(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function VF(t,e){var n=ab(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((e==null?n.local?PF:jF:typeof e=="function"?n.local?YF:qF:n.local?FF:GF)(n,e))}function YN(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function XF(t){return function(){this.style.removeProperty(t)}}function KF(t,e,n){return function(){this.style.setProperty(t,e,n)}}function WF(t,e,n){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function ZF(t,e,n){return arguments.length>1?this.each((e==null?XF:typeof e=="function"?WF:KF)(t,e,n??"")):lh(this.node(),t)}function lh(t,e){return t.style.getPropertyValue(e)||YN(t).getComputedStyle(t,null).getPropertyValue(e)}function $F(t){return function(){delete this[t]}}function QF(t,e){return function(){this[t]=e}}function JF(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function eq(t,e){return arguments.length>1?this.each((e==null?$F:typeof e=="function"?JF:QF)(t,e)):this.node()[t]}function VN(t){return t.trim().split(/^|\s+/)}function S1(t){return t.classList||new XN(t)}function XN(t){this._node=t,this._names=VN(t.getAttribute("class")||"")}XN.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function KN(t,e){for(var n=S1(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function WN(t,e){for(var n=S1(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function tq(t){return function(){KN(this,t)}}function nq(t){return function(){WN(this,t)}}function iq(t,e){return function(){(e.apply(this,arguments)?KN:WN)(this,t)}}function rq(t,e){var n=VN(t+"");if(arguments.length<2){for(var i=S1(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?iq:e?tq:nq)(n,e))}function aq(){this.textContent=""}function sq(t){return function(){this.textContent=t}}function lq(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function oq(t){return arguments.length?this.each(t==null?aq:(typeof t=="function"?lq:sq)(t)):this.node().textContent}function cq(){this.innerHTML=""}function uq(t){return function(){this.innerHTML=t}}function fq(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function dq(t){return arguments.length?this.each(t==null?cq:(typeof t=="function"?fq:uq)(t)):this.node().innerHTML}function hq(){this.nextSibling&&this.parentNode.appendChild(this)}function pq(){return this.each(hq)}function mq(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gq(){return this.each(mq)}function yq(t){var e=typeof t=="function"?t:jN(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function bq(){return null}function xq(t,e){var n=typeof t=="function"?t:jN(t),i=e==null?bq:typeof e=="function"?e:_1(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function vq(){var t=this.parentNode;t&&t.removeChild(this)}function _q(){return this.each(vq)}function Sq(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Eq(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function wq(t){return this.select(t?Eq:Sq)}function Tq(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Cq(t){return function(e){t.call(this,e,this.__data__)}}function Aq(t){return t.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function Mq(t){return function(){var e=this.__on;if(e){for(var n=0,i=-1,r=e.length,s;n<r;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++i]=s;++i?e.length=i:delete this.__on}}}function Nq(t,e,n){return function(){var i=this.__on,r,s=Cq(e);if(i){for(var l=0,c=i.length;l<c;++l)if((r=i[l]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),r.value=e;return}}this.addEventListener(t.type,s,n),r={type:t.type,name:t.name,value:e,listener:s,options:n},i?i.push(r):this.__on=[r]}}function Rq(t,e,n){var i=Aq(t+""),r,s=i.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var d=0,p=c.length,m;d<p;++d)for(r=0,m=c[d];r<s;++r)if((l=i[r]).type===m.type&&l.name===m.name)return m.value}return}for(c=e?Nq:Mq,r=0;r<s;++r)this.each(c(i[r],e,n));return this}function ZN(t,e,n){var i=YN(t),r=i.CustomEvent;typeof r=="function"?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function kq(t,e){return function(){return ZN(this,t,e)}}function Oq(t,e){return function(){return ZN(this,t,e.apply(this,arguments))}}function Dq(t,e){return this.each((typeof e=="function"?Oq:kq)(t,e))}function*zq(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length,l;r<s;++r)(l=i[r])&&(yield l)}var $N=[null];function ts(t,e){this._groups=t,this._parents=e}function Zm(){return new ts([[document.documentElement]],$N)}function Bq(){return this}ts.prototype=Zm.prototype={constructor:ts,select:lF,selectAll:fF,selectChild:mF,selectChildren:xF,filter:vF,data:CF,enter:_F,exit:MF,join:NF,merge:RF,selection:Bq,order:kF,sort:OF,call:zF,nodes:BF,node:LF,size:UF,empty:IF,each:HF,attr:VF,style:ZF,property:eq,classed:rq,text:oq,html:dq,raise:pq,lower:gq,append:yq,insert:xq,remove:_q,clone:wq,datum:Tq,on:Rq,dispatch:Dq,[Symbol.iterator]:zq};function Qa(t){return typeof t=="string"?new ts([[document.querySelector(t)]],[document.documentElement]):new ts([[t]],$N)}function Lq(t){let e;for(;e=t.sourceEvent;)t=e;return t}function ul(t,e){if(t=Lq(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,i=i.matrixTransform(e.getScreenCTM().inverse()),[i.x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const Uq={passive:!1},Om={capture:!0,passive:!1};function dv(t){t.stopImmediatePropagation()}function $d(t){t.preventDefault(),t.stopImmediatePropagation()}function QN(t){var e=t.document.documentElement,n=Qa(t).on("dragstart.drag",$d,Om);"onselectstart"in e?n.on("selectstart.drag",$d,Om):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function JN(t,e){var n=t.document.documentElement,i=Qa(t).on("dragstart.drag",null);e&&(i.on("click.drag",$d,Om),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Zy=t=>()=>t;function g_(t,{sourceEvent:e,subject:n,target:i,identifier:r,active:s,x:l,y:c,dx:d,dy:p,dispatch:m}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:m}})}g_.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Iq(t){return!t.ctrlKey&&!t.button}function Hq(){return this.parentNode}function jq(t,e){return e??{x:t.x,y:t.y}}function Pq(){return navigator.maxTouchPoints||"ontouchstart"in this}function eR(){var t=Iq,e=Hq,n=jq,i=Pq,r={},s=rb("start","drag","end"),l=0,c,d,p,m,g=0;function x(D){D.on("mousedown.drag",v).filter(i).on("touchstart.drag",C).on("touchmove.drag",w,Uq).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(D,H){if(!(m||!t.call(this,D,H))){var z=N(this,e.call(this,D,H),D,H,"mouse");z&&(Qa(D.view).on("mousemove.drag",E,Om).on("mouseup.drag",A,Om),QN(D.view),dv(D),p=!1,c=D.clientX,d=D.clientY,z("start",D))}}function E(D){if($d(D),!p){var H=D.clientX-c,z=D.clientY-d;p=H*H+z*z>g}r.mouse("drag",D)}function A(D){Qa(D.view).on("mousemove.drag mouseup.drag",null),JN(D.view,p),$d(D),r.mouse("end",D)}function C(D,H){if(t.call(this,D,H)){var z=D.changedTouches,F=e.call(this,D,H),ee=z.length,P,I;for(P=0;P<ee;++P)(I=N(this,F,D,H,z[P].identifier,z[P]))&&(dv(D),I("start",D,z[P]))}}function w(D){var H=D.changedTouches,z=H.length,F,ee;for(F=0;F<z;++F)(ee=r[H[F].identifier])&&($d(D),ee("drag",D,H[F]))}function k(D){var H=D.changedTouches,z=H.length,F,ee;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),F=0;F<z;++F)(ee=r[H[F].identifier])&&(dv(D),ee("end",D,H[F]))}function N(D,H,z,F,ee,P){var I=s.copy(),V=ul(P||z,H),X,ne,q;if((q=n.call(D,new g_("beforestart",{sourceEvent:z,target:x,identifier:ee,active:l,x:V[0],y:V[1],dx:0,dy:0,dispatch:I}),F))!=null)return X=q.x-V[0]||0,ne=q.y-V[1]||0,function Q(B,Y,Z){var $=V,j;switch(B){case"start":r[ee]=Q,j=l++;break;case"end":delete r[ee],--l;case"drag":V=ul(Z||Y,H),j=l;break}I.call(B,D,new g_(B,{sourceEvent:Y,subject:q,target:x,identifier:ee,active:j,x:V[0]+X,y:V[1]+ne,dx:V[0]-$[0],dy:V[1]-$[1],dispatch:I}),F)}}return x.filter=function(D){return arguments.length?(t=typeof D=="function"?D:Zy(!!D),x):t},x.container=function(D){return arguments.length?(e=typeof D=="function"?D:Zy(D),x):e},x.subject=function(D){return arguments.length?(n=typeof D=="function"?D:Zy(D),x):n},x.touchable=function(D){return arguments.length?(i=typeof D=="function"?D:Zy(!!D),x):i},x.on=function(){var D=s.on.apply(s,arguments);return D===s?x:D},x.clickDistance=function(D){return arguments.length?(g=(D=+D)*D,x):Math.sqrt(g)},x}function E1(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function tR(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function $m(){}var Dm=.7,O0=1/Dm,Qd="\\s*([+-]?\\d+)\\s*",zm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",uo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Gq=/^#([0-9a-f]{3,8})$/,Fq=new RegExp(`^rgb\\(${Qd},${Qd},${Qd}\\)$`),qq=new RegExp(`^rgb\\(${uo},${uo},${uo}\\)$`),Yq=new RegExp(`^rgba\\(${Qd},${Qd},${Qd},${zm}\\)$`),Vq=new RegExp(`^rgba\\(${uo},${uo},${uo},${zm}\\)$`),Xq=new RegExp(`^hsl\\(${zm},${uo},${uo}\\)$`),Kq=new RegExp(`^hsla\\(${zm},${uo},${uo},${zm}\\)$`),Z2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};E1($m,bf,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:$2,formatHex:$2,formatHex8:Wq,formatHsl:Zq,formatRgb:Q2,toString:Q2});function $2(){return this.rgb().formatHex()}function Wq(){return this.rgb().formatHex8()}function Zq(){return nR(this).formatHsl()}function Q2(){return this.rgb().formatRgb()}function bf(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Gq.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?J2(e):n===3?new Ma(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?$y(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?$y(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Fq.exec(t))?new Ma(e[1],e[2],e[3],1):(e=qq.exec(t))?new Ma(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Yq.exec(t))?$y(e[1],e[2],e[3],e[4]):(e=Vq.exec(t))?$y(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Xq.exec(t))?nT(e[1],e[2]/100,e[3]/100,1):(e=Kq.exec(t))?nT(e[1],e[2]/100,e[3]/100,e[4]):Z2.hasOwnProperty(t)?J2(Z2[t]):t==="transparent"?new Ma(NaN,NaN,NaN,0):null}function J2(t){return new Ma(t>>16&255,t>>8&255,t&255,1)}function $y(t,e,n,i){return i<=0&&(t=e=n=NaN),new Ma(t,e,n,i)}function $q(t){return t instanceof $m||(t=bf(t)),t?(t=t.rgb(),new Ma(t.r,t.g,t.b,t.opacity)):new Ma}function y_(t,e,n,i){return arguments.length===1?$q(t):new Ma(t,e,n,i??1)}function Ma(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}E1(Ma,y_,tR($m,{brighter(t){return t=t==null?O0:Math.pow(O0,t),new Ma(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Dm:Math.pow(Dm,t),new Ma(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ma(hf(this.r),hf(this.g),hf(this.b),D0(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:eT,formatHex:eT,formatHex8:Qq,formatRgb:tT,toString:tT}));function eT(){return`#${df(this.r)}${df(this.g)}${df(this.b)}`}function Qq(){return`#${df(this.r)}${df(this.g)}${df(this.b)}${df((isNaN(this.opacity)?1:this.opacity)*255)}`}function tT(){const t=D0(this.opacity);return`${t===1?"rgb(":"rgba("}${hf(this.r)}, ${hf(this.g)}, ${hf(this.b)}${t===1?")":`, ${t})`}`}function D0(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function hf(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function df(t){return t=hf(t),(t<16?"0":"")+t.toString(16)}function nT(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new hl(t,e,n,i)}function nR(t){if(t instanceof hl)return new hl(t.h,t.s,t.l,t.opacity);if(t instanceof $m||(t=bf(t)),!t)return new hl;if(t instanceof hl)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),l=NaN,c=s-r,d=(s+r)/2;return c?(e===s?l=(n-i)/c+(n<i)*6:n===s?l=(i-e)/c+2:l=(e-n)/c+4,c/=d<.5?s+r:2-s-r,l*=60):c=d>0&&d<1?0:l,new hl(l,c,d,t.opacity)}function Jq(t,e,n,i){return arguments.length===1?nR(t):new hl(t,e,n,i??1)}function hl(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}E1(hl,Jq,tR($m,{brighter(t){return t=t==null?O0:Math.pow(O0,t),new hl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Dm:Math.pow(Dm,t),new hl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Ma(hv(t>=240?t-240:t+120,r,i),hv(t,r,i),hv(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new hl(iT(this.h),Qy(this.s),Qy(this.l),D0(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=D0(this.opacity);return`${t===1?"hsl(":"hsla("}${iT(this.h)}, ${Qy(this.s)*100}%, ${Qy(this.l)*100}%${t===1?")":`, ${t})`}`}}));function iT(t){return t=(t||0)%360,t<0?t+360:t}function Qy(t){return Math.max(0,Math.min(1,t||0))}function hv(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const w1=t=>()=>t;function eY(t,e){return function(n){return t+n*e}}function tY(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function nY(t){return(t=+t)==1?iR:function(e,n){return n-e?tY(e,n,t):w1(isNaN(e)?n:e)}}function iR(t,e){var n=e-t;return n?eY(t,n):w1(isNaN(t)?e:t)}const z0=(function t(e){var n=nY(e);function i(r,s){var l=n((r=y_(r)).r,(s=y_(s)).r),c=n(r.g,s.g),d=n(r.b,s.b),p=iR(r.opacity,s.opacity);return function(m){return r.r=l(m),r.g=c(m),r.b=d(m),r.opacity=p(m),r+""}}return i.gamma=t,i})(1);function iY(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),r;return function(s){for(r=0;r<n;++r)i[r]=t[r]*(1-s)+e[r]*s;return i}}function rY(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function aY(t,e){var n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),s=new Array(n),l;for(l=0;l<i;++l)r[l]=_m(t[l],e[l]);for(;l<n;++l)s[l]=e[l];return function(c){for(l=0;l<i;++l)s[l]=r[l](c);return s}}function sY(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function oo(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function lY(t,e){var n={},i={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?n[r]=_m(t[r],e[r]):i[r]=e[r];return function(s){for(r in n)i[r]=n[r](s);return i}}var b_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pv=new RegExp(b_.source,"g");function oY(t){return function(){return t}}function cY(t){return function(e){return t(e)+""}}function rR(t,e){var n=b_.lastIndex=pv.lastIndex=0,i,r,s,l=-1,c=[],d=[];for(t=t+"",e=e+"";(i=b_.exec(t))&&(r=pv.exec(e));)(s=r.index)>n&&(s=e.slice(n,s),c[l]?c[l]+=s:c[++l]=s),(i=i[0])===(r=r[0])?c[l]?c[l]+=r:c[++l]=r:(c[++l]=null,d.push({i:l,x:oo(i,r)})),n=pv.lastIndex;return n<e.length&&(s=e.slice(n),c[l]?c[l]+=s:c[++l]=s),c.length<2?d[0]?cY(d[0].x):oY(e):(e=d.length,function(p){for(var m=0,g;m<e;++m)c[(g=d[m]).i]=g.x(p);return c.join("")})}function _m(t,e){var n=typeof e,i;return e==null||n==="boolean"?w1(e):(n==="number"?oo:n==="string"?(i=bf(e))?(e=i,z0):rR:e instanceof bf?z0:e instanceof Date?sY:rY(e)?iY:Array.isArray(e)?aY:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?lY:oo)(t,e)}var rT=180/Math.PI,x_={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function aR(t,e,n,i,r,s){var l,c,d;return(l=Math.sqrt(t*t+e*e))&&(t/=l,e/=l),(d=t*n+e*i)&&(n-=t*d,i-=e*d),(c=Math.sqrt(n*n+i*i))&&(n/=c,i/=c,d/=c),t*i<e*n&&(t=-t,e=-e,d=-d,l=-l),{translateX:r,translateY:s,rotate:Math.atan2(e,t)*rT,skewX:Math.atan(d)*rT,scaleX:l,scaleY:c}}var Jy;function uY(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?x_:aR(e.a,e.b,e.c,e.d,e.e,e.f)}function fY(t){return t==null||(Jy||(Jy=document.createElementNS("http://www.w3.org/2000/svg","g")),Jy.setAttribute("transform",t),!(t=Jy.transform.baseVal.consolidate()))?x_:(t=t.matrix,aR(t.a,t.b,t.c,t.d,t.e,t.f))}function sR(t,e,n,i){function r(p){return p.length?p.pop()+" ":""}function s(p,m,g,x,v,E){if(p!==g||m!==x){var A=v.push("translate(",null,e,null,n);E.push({i:A-4,x:oo(p,g)},{i:A-2,x:oo(m,x)})}else(g||x)&&v.push("translate("+g+e+x+n)}function l(p,m,g,x){p!==m?(p-m>180?m+=360:m-p>180&&(p+=360),x.push({i:g.push(r(g)+"rotate(",null,i)-2,x:oo(p,m)})):m&&g.push(r(g)+"rotate("+m+i)}function c(p,m,g,x){p!==m?x.push({i:g.push(r(g)+"skewX(",null,i)-2,x:oo(p,m)}):m&&g.push(r(g)+"skewX("+m+i)}function d(p,m,g,x,v,E){if(p!==g||m!==x){var A=v.push(r(v)+"scale(",null,",",null,")");E.push({i:A-4,x:oo(p,g)},{i:A-2,x:oo(m,x)})}else(g!==1||x!==1)&&v.push(r(v)+"scale("+g+","+x+")")}return function(p,m){var g=[],x=[];return p=t(p),m=t(m),s(p.translateX,p.translateY,m.translateX,m.translateY,g,x),l(p.rotate,m.rotate,g,x),c(p.skewX,m.skewX,g,x),d(p.scaleX,p.scaleY,m.scaleX,m.scaleY,g,x),p=m=null,function(v){for(var E=-1,A=x.length,C;++E<A;)g[(C=x[E]).i]=C.x(v);return g.join("")}}}var dY=sR(uY,"px, ","px)","deg)"),hY=sR(fY,", ",")",")"),pY=1e-12;function aT(t){return((t=Math.exp(t))+1/t)/2}function mY(t){return((t=Math.exp(t))-1/t)/2}function gY(t){return((t=Math.exp(2*t))-1)/(t+1)}const d0=(function t(e,n,i){function r(s,l){var c=s[0],d=s[1],p=s[2],m=l[0],g=l[1],x=l[2],v=m-c,E=g-d,A=v*v+E*E,C,w;if(A<pY)w=Math.log(x/p)/e,C=function(F){return[c+F*v,d+F*E,p*Math.exp(e*F*w)]};else{var k=Math.sqrt(A),N=(x*x-p*p+i*A)/(2*p*n*k),D=(x*x-p*p-i*A)/(2*x*n*k),H=Math.log(Math.sqrt(N*N+1)-N),z=Math.log(Math.sqrt(D*D+1)-D);w=(z-H)/e,C=function(F){var ee=F*w,P=aT(H),I=p/(n*k)*(P*gY(e*ee+H)-mY(H));return[c+I*v,d+I*E,p*P/aT(e*ee+H)]}}return C.duration=w*1e3*e/Math.SQRT2,C}return r.rho=function(s){var l=Math.max(.001,+s),c=l*l,d=c*c;return t(l,c,d)},r})(Math.SQRT2,2,4);var oh=0,um=0,rm=0,lR=1e3,B0,fm,L0=0,xf=0,sb=0,Bm=typeof performance=="object"&&performance.now?performance:Date,oR=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function T1(){return xf||(oR(yY),xf=Bm.now()+sb)}function yY(){xf=0}function U0(){this._call=this._time=this._next=null}U0.prototype=cR.prototype={constructor:U0,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?T1():+n)+(e==null?0:+e),!this._next&&fm!==this&&(fm?fm._next=this:B0=this,fm=this),this._call=t,this._time=n,v_()},stop:function(){this._call&&(this._call=null,this._time=1/0,v_())}};function cR(t,e,n){var i=new U0;return i.restart(t,e,n),i}function bY(){T1(),++oh;for(var t=B0,e;t;)(e=xf-t._time)>=0&&t._call.call(void 0,e),t=t._next;--oh}function sT(){xf=(L0=Bm.now())+sb,oh=um=0;try{bY()}finally{oh=0,vY(),xf=0}}function xY(){var t=Bm.now(),e=t-L0;e>lR&&(sb-=e,L0=t)}function vY(){for(var t,e=B0,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:B0=n);fm=t,v_(i)}function v_(t){if(!oh){um&&(um=clearTimeout(um));var e=t-xf;e>24?(t<1/0&&(um=setTimeout(sT,t-Bm.now()-sb)),rm&&(rm=clearInterval(rm))):(rm||(L0=Bm.now(),rm=setInterval(xY,lR)),oh=1,oR(sT))}}function lT(t,e,n){var i=new U0;return e=e==null?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,n),i}var _Y=rb("start","end","cancel","interrupt"),SY=[],uR=0,oT=1,__=2,h0=3,cT=4,S_=5,p0=6;function lb(t,e,n,i,r,s){var l=t.__transition;if(!l)t.__transition={};else if(n in l)return;EY(t,n,{name:e,index:i,group:r,on:_Y,tween:SY,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:uR})}function C1(t,e){var n=vl(t,e);if(n.state>uR)throw new Error("too late; already scheduled");return n}function mo(t,e){var n=vl(t,e);if(n.state>h0)throw new Error("too late; already running");return n}function vl(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function EY(t,e,n){var i=t.__transition,r;i[e]=n,n.timer=cR(s,0,n.time);function s(p){n.state=oT,n.timer.restart(l,n.delay,n.time),n.delay<=p&&l(p-n.delay)}function l(p){var m,g,x,v;if(n.state!==oT)return d();for(m in i)if(v=i[m],v.name===n.name){if(v.state===h0)return lT(l);v.state===cT?(v.state=p0,v.timer.stop(),v.on.call("interrupt",t,t.__data__,v.index,v.group),delete i[m]):+m<e&&(v.state=p0,v.timer.stop(),v.on.call("cancel",t,t.__data__,v.index,v.group),delete i[m])}if(lT(function(){n.state===h0&&(n.state=cT,n.timer.restart(c,n.delay,n.time),c(p))}),n.state=__,n.on.call("start",t,t.__data__,n.index,n.group),n.state===__){for(n.state=h0,r=new Array(x=n.tween.length),m=0,g=-1;m<x;++m)(v=n.tween[m].value.call(t,t.__data__,n.index,n.group))&&(r[++g]=v);r.length=g+1}}function c(p){for(var m=p<n.duration?n.ease.call(null,p/n.duration):(n.timer.restart(d),n.state=S_,1),g=-1,x=r.length;++g<x;)r[g].call(t,m);n.state===S_&&(n.on.call("end",t,t.__data__,n.index,n.group),d())}function d(){n.state=p0,n.timer.stop(),delete i[e];for(var p in i)return;delete t.__transition}}function m0(t,e){var n=t.__transition,i,r,s=!0,l;if(n){e=e==null?null:e+"";for(l in n){if((i=n[l]).name!==e){s=!1;continue}r=i.state>__&&i.state<S_,i.state=p0,i.timer.stop(),i.on.call(r?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete n[l]}s&&delete t.__transition}}function wY(t){return this.each(function(){m0(this,t)})}function TY(t,e){var n,i;return function(){var r=mo(this,t),s=r.tween;if(s!==n){i=n=s;for(var l=0,c=i.length;l<c;++l)if(i[l].name===e){i=i.slice(),i.splice(l,1);break}}r.tween=i}}function CY(t,e,n){var i,r;if(typeof n!="function")throw new Error;return function(){var s=mo(this,t),l=s.tween;if(l!==i){r=(i=l).slice();for(var c={name:e,value:n},d=0,p=r.length;d<p;++d)if(r[d].name===e){r[d]=c;break}d===p&&r.push(c)}s.tween=r}}function AY(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i=vl(this.node(),n).tween,r=0,s=i.length,l;r<s;++r)if((l=i[r]).name===t)return l.value;return null}return this.each((e==null?TY:CY)(n,t,e))}function A1(t,e,n){var i=t._id;return t.each(function(){var r=mo(this,i);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return vl(r,i).value[e]}}function fR(t,e){var n;return(typeof e=="number"?oo:e instanceof bf?z0:(n=bf(e))?(e=n,z0):rR)(t,e)}function MY(t){return function(){this.removeAttribute(t)}}function NY(t){return function(){this.removeAttributeNS(t.space,t.local)}}function RY(t,e,n){var i,r=n+"",s;return function(){var l=this.getAttribute(t);return l===r?null:l===i?s:s=e(i=l,n)}}function kY(t,e,n){var i,r=n+"",s;return function(){var l=this.getAttributeNS(t.space,t.local);return l===r?null:l===i?s:s=e(i=l,n)}}function OY(t,e,n){var i,r,s;return function(){var l,c=n(this),d;return c==null?void this.removeAttribute(t):(l=this.getAttribute(t),d=c+"",l===d?null:l===i&&d===r?s:(r=d,s=e(i=l,c)))}}function DY(t,e,n){var i,r,s;return function(){var l,c=n(this),d;return c==null?void this.removeAttributeNS(t.space,t.local):(l=this.getAttributeNS(t.space,t.local),d=c+"",l===d?null:l===i&&d===r?s:(r=d,s=e(i=l,c)))}}function zY(t,e){var n=ab(t),i=n==="transform"?hY:fR;return this.attrTween(t,typeof e=="function"?(n.local?DY:OY)(n,i,A1(this,"attr."+t,e)):e==null?(n.local?NY:MY)(n):(n.local?kY:RY)(n,i,e))}function BY(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function LY(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function UY(t,e){var n,i;function r(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&LY(t,s)),n}return r._value=e,r}function IY(t,e){var n,i;function r(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&BY(t,s)),n}return r._value=e,r}function HY(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var i=ab(t);return this.tween(n,(i.local?UY:IY)(i,e))}function jY(t,e){return function(){C1(this,t).delay=+e.apply(this,arguments)}}function PY(t,e){return e=+e,function(){C1(this,t).delay=e}}function GY(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?jY:PY)(e,t)):vl(this.node(),e).delay}function FY(t,e){return function(){mo(this,t).duration=+e.apply(this,arguments)}}function qY(t,e){return e=+e,function(){mo(this,t).duration=e}}function YY(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?FY:qY)(e,t)):vl(this.node(),e).duration}function VY(t,e){if(typeof e!="function")throw new Error;return function(){mo(this,t).ease=e}}function XY(t){var e=this._id;return arguments.length?this.each(VY(e,t)):vl(this.node(),e).ease}function KY(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;mo(this,t).ease=n}}function WY(t){if(typeof t!="function")throw new Error;return this.each(KY(this._id,t))}function ZY(t){typeof t!="function"&&(t=GN(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],l=s.length,c=i[r]=[],d,p=0;p<l;++p)(d=s[p])&&t.call(d,d.__data__,p,s)&&c.push(d);return new rc(i,this._parents,this._name,this._id)}function $Y(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,s=Math.min(i,r),l=new Array(i),c=0;c<s;++c)for(var d=e[c],p=n[c],m=d.length,g=l[c]=new Array(m),x,v=0;v<m;++v)(x=d[v]||p[v])&&(g[v]=x);for(;c<i;++c)l[c]=e[c];return new rc(l,this._parents,this._name,this._id)}function QY(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function JY(t,e,n){var i,r,s=QY(e)?C1:mo;return function(){var l=s(this,t),c=l.on;c!==i&&(r=(i=c).copy()).on(e,n),l.on=r}}function eV(t,e){var n=this._id;return arguments.length<2?vl(this.node(),n).on.on(t):this.each(JY(n,t,e))}function tV(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function nV(){return this.on("end.remove",tV(this._id))}function iV(t){var e=this._name,n=this._id;typeof t!="function"&&(t=_1(t));for(var i=this._groups,r=i.length,s=new Array(r),l=0;l<r;++l)for(var c=i[l],d=c.length,p=s[l]=new Array(d),m,g,x=0;x<d;++x)(m=c[x])&&(g=t.call(m,m.__data__,x,c))&&("__data__"in m&&(g.__data__=m.__data__),p[x]=g,lb(p[x],e,n,x,p,vl(m,n)));return new rc(s,this._parents,e,n)}function rV(t){var e=this._name,n=this._id;typeof t!="function"&&(t=PN(t));for(var i=this._groups,r=i.length,s=[],l=[],c=0;c<r;++c)for(var d=i[c],p=d.length,m,g=0;g<p;++g)if(m=d[g]){for(var x=t.call(m,m.__data__,g,d),v,E=vl(m,n),A=0,C=x.length;A<C;++A)(v=x[A])&&lb(v,e,n,A,x,E);s.push(x),l.push(m)}return new rc(s,l,e,n)}var aV=Zm.prototype.constructor;function sV(){return new aV(this._groups,this._parents)}function lV(t,e){var n,i,r;return function(){var s=lh(this,t),l=(this.style.removeProperty(t),lh(this,t));return s===l?null:s===n&&l===i?r:r=e(n=s,i=l)}}function dR(t){return function(){this.style.removeProperty(t)}}function oV(t,e,n){var i,r=n+"",s;return function(){var l=lh(this,t);return l===r?null:l===i?s:s=e(i=l,n)}}function cV(t,e,n){var i,r,s;return function(){var l=lh(this,t),c=n(this),d=c+"";return c==null&&(d=c=(this.style.removeProperty(t),lh(this,t))),l===d?null:l===i&&d===r?s:(r=d,s=e(i=l,c))}}function uV(t,e){var n,i,r,s="style."+e,l="end."+s,c;return function(){var d=mo(this,t),p=d.on,m=d.value[s]==null?c||(c=dR(e)):void 0;(p!==n||r!==m)&&(i=(n=p).copy()).on(l,r=m),d.on=i}}function fV(t,e,n){var i=(t+="")=="transform"?dY:fR;return e==null?this.styleTween(t,lV(t,i)).on("end.style."+t,dR(t)):typeof e=="function"?this.styleTween(t,cV(t,i,A1(this,"style."+t,e))).each(uV(this._id,t)):this.styleTween(t,oV(t,i,e),n).on("end.style."+t,null)}function dV(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function hV(t,e,n){var i,r;function s(){var l=e.apply(this,arguments);return l!==r&&(i=(r=l)&&dV(t,l,n)),i}return s._value=e,s}function pV(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;return this.tween(i,hV(t,e,n??""))}function mV(t){return function(){this.textContent=t}}function gV(t){return function(){var e=t(this);this.textContent=e??""}}function yV(t){return this.tween("text",typeof t=="function"?gV(A1(this,"text",t)):mV(t==null?"":t+""))}function bV(t){return function(e){this.textContent=t.call(this,e)}}function xV(t){var e,n;function i(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&bV(r)),e}return i._value=t,i}function vV(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,xV(t))}function _V(){for(var t=this._name,e=this._id,n=hR(),i=this._groups,r=i.length,s=0;s<r;++s)for(var l=i[s],c=l.length,d,p=0;p<c;++p)if(d=l[p]){var m=vl(d,e);lb(d,t,n,p,l,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new rc(i,this._parents,t,n)}function SV(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(s,l){var c={value:l},d={value:function(){--r===0&&s()}};n.each(function(){var p=mo(this,i),m=p.on;m!==t&&(e=(t=m).copy(),e._.cancel.push(c),e._.interrupt.push(c),e._.end.push(d)),p.on=e}),r===0&&s()})}var EV=0;function rc(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function hR(){return++EV}var Wo=Zm.prototype;rc.prototype={constructor:rc,select:iV,selectAll:rV,selectChild:Wo.selectChild,selectChildren:Wo.selectChildren,filter:ZY,merge:$Y,selection:sV,transition:_V,call:Wo.call,nodes:Wo.nodes,node:Wo.node,size:Wo.size,empty:Wo.empty,each:Wo.each,on:eV,attr:zY,attrTween:HY,style:fV,styleTween:pV,text:yV,textTween:vV,remove:nV,tween:AY,delay:GY,duration:YY,ease:XY,easeVarying:WY,end:SV,[Symbol.iterator]:Wo[Symbol.iterator]};function wV(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var TV={time:null,delay:0,duration:250,ease:wV};function CV(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function AV(t){var e,n;t instanceof rc?(e=t._id,t=t._name):(e=hR(),(n=TV).time=T1(),t=t==null?null:t+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var l=i[s],c=l.length,d,p=0;p<c;++p)(d=l[p])&&lb(d,t,e,p,l,n||CV(d,e));return new rc(i,this._parents,t,e)}Zm.prototype.interrupt=wY;Zm.prototype.transition=AV;const e0=t=>()=>t;function MV(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function Jo(t,e,n){this.k=t,this.x=e,this.y=n}Jo.prototype={constructor:Jo,scale:function(t){return t===1?this:new Jo(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Jo(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ob=new Jo(1,0,0);pR.prototype=Jo.prototype;function pR(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ob;return t.__zoom}function mv(t){t.stopImmediatePropagation()}function am(t){t.preventDefault(),t.stopImmediatePropagation()}function NV(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function RV(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function uT(){return this.__zoom||ob}function kV(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function OV(){return navigator.maxTouchPoints||"ontouchstart"in this}function DV(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],l=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),l>s?(s+l)/2:Math.min(0,s)||Math.max(0,l))}function mR(){var t=NV,e=RV,n=DV,i=kV,r=OV,s=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,d=d0,p=rb("start","zoom","end"),m,g,x,v=500,E=150,A=0,C=10;function w(q){q.property("__zoom",uT).on("wheel.zoom",ee,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",I).filter(r).on("touchstart.zoom",V).on("touchmove.zoom",X).on("touchend.zoom touchcancel.zoom",ne).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(q,Q,B,Y){var Z=q.selection?q.selection():q;Z.property("__zoom",uT),q!==Z?H(q,Q,B,Y):Z.interrupt().each(function(){z(this,arguments).event(Y).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},w.scaleBy=function(q,Q,B,Y){w.scaleTo(q,function(){var Z=this.__zoom.k,$=typeof Q=="function"?Q.apply(this,arguments):Q;return Z*$},B,Y)},w.scaleTo=function(q,Q,B,Y){w.transform(q,function(){var Z=e.apply(this,arguments),$=this.__zoom,j=B==null?D(Z):typeof B=="function"?B.apply(this,arguments):B,K=$.invert(j),te=typeof Q=="function"?Q.apply(this,arguments):Q;return n(N(k($,te),j,K),Z,l)},B,Y)},w.translateBy=function(q,Q,B,Y){w.transform(q,function(){return n(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof B=="function"?B.apply(this,arguments):B),e.apply(this,arguments),l)},null,Y)},w.translateTo=function(q,Q,B,Y,Z){w.transform(q,function(){var $=e.apply(this,arguments),j=this.__zoom,K=Y==null?D($):typeof Y=="function"?Y.apply(this,arguments):Y;return n(ob.translate(K[0],K[1]).scale(j.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof B=="function"?-B.apply(this,arguments):-B),$,l)},Y,Z)};function k(q,Q){return Q=Math.max(s[0],Math.min(s[1],Q)),Q===q.k?q:new Jo(Q,q.x,q.y)}function N(q,Q,B){var Y=Q[0]-B[0]*q.k,Z=Q[1]-B[1]*q.k;return Y===q.x&&Z===q.y?q:new Jo(q.k,Y,Z)}function D(q){return[(+q[0][0]+ +q[1][0])/2,(+q[0][1]+ +q[1][1])/2]}function H(q,Q,B,Y){q.on("start.zoom",function(){z(this,arguments).event(Y).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(Y).end()}).tween("zoom",function(){var Z=this,$=arguments,j=z(Z,$).event(Y),K=e.apply(Z,$),te=B==null?D(K):typeof B=="function"?B.apply(Z,$):B,U=Math.max(K[1][0]-K[0][0],K[1][1]-K[0][1]),le=Z.__zoom,de=typeof Q=="function"?Q.apply(Z,$):Q,ge=d(le.invert(te).concat(U/le.k),de.invert(te).concat(U/de.k));return function(se){if(se===1)se=de;else{var pe=ge(se),Ae=U/pe[2];se=new Jo(Ae,te[0]-pe[0]*Ae,te[1]-pe[1]*Ae)}j.zoom(null,se)}})}function z(q,Q,B){return!B&&q.__zooming||new F(q,Q)}function F(q,Q){this.that=q,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=e.apply(q,Q),this.taps=0}F.prototype={event:function(q){return q&&(this.sourceEvent=q),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(q,Q){return this.mouse&&q!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&q!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&q!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(q){var Q=Qa(this.that).datum();p.call(q,this.that,new MV(q,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:p}),Q)}};function ee(q,...Q){if(!t.apply(this,arguments))return;var B=z(this,Q).event(q),Y=this.__zoom,Z=Math.max(s[0],Math.min(s[1],Y.k*Math.pow(2,i.apply(this,arguments)))),$=ul(q);if(B.wheel)(B.mouse[0][0]!==$[0]||B.mouse[0][1]!==$[1])&&(B.mouse[1]=Y.invert(B.mouse[0]=$)),clearTimeout(B.wheel);else{if(Y.k===Z)return;B.mouse=[$,Y.invert($)],m0(this),B.start()}am(q),B.wheel=setTimeout(j,E),B.zoom("mouse",n(N(k(Y,Z),B.mouse[0],B.mouse[1]),B.extent,l));function j(){B.wheel=null,B.end()}}function P(q,...Q){if(x||!t.apply(this,arguments))return;var B=q.currentTarget,Y=z(this,Q,!0).event(q),Z=Qa(q.view).on("mousemove.zoom",te,!0).on("mouseup.zoom",U,!0),$=ul(q,B),j=q.clientX,K=q.clientY;QN(q.view),mv(q),Y.mouse=[$,this.__zoom.invert($)],m0(this),Y.start();function te(le){if(am(le),!Y.moved){var de=le.clientX-j,ge=le.clientY-K;Y.moved=de*de+ge*ge>A}Y.event(le).zoom("mouse",n(N(Y.that.__zoom,Y.mouse[0]=ul(le,B),Y.mouse[1]),Y.extent,l))}function U(le){Z.on("mousemove.zoom mouseup.zoom",null),JN(le.view,Y.moved),am(le),Y.event(le).end()}}function I(q,...Q){if(t.apply(this,arguments)){var B=this.__zoom,Y=ul(q.changedTouches?q.changedTouches[0]:q,this),Z=B.invert(Y),$=B.k*(q.shiftKey?.5:2),j=n(N(k(B,$),Y,Z),e.apply(this,Q),l);am(q),c>0?Qa(this).transition().duration(c).call(H,j,Y,q):Qa(this).call(w.transform,j,Y,q)}}function V(q,...Q){if(t.apply(this,arguments)){var B=q.touches,Y=B.length,Z=z(this,Q,q.changedTouches.length===Y).event(q),$,j,K,te;for(mv(q),j=0;j<Y;++j)K=B[j],te=ul(K,this),te=[te,this.__zoom.invert(te),K.identifier],Z.touch0?!Z.touch1&&Z.touch0[2]!==te[2]&&(Z.touch1=te,Z.taps=0):(Z.touch0=te,$=!0,Z.taps=1+!!m);m&&(m=clearTimeout(m)),$&&(Z.taps<2&&(g=te[0],m=setTimeout(function(){m=null},v)),m0(this),Z.start())}}function X(q,...Q){if(this.__zooming){var B=z(this,Q).event(q),Y=q.changedTouches,Z=Y.length,$,j,K,te;for(am(q),$=0;$<Z;++$)j=Y[$],K=ul(j,this),B.touch0&&B.touch0[2]===j.identifier?B.touch0[0]=K:B.touch1&&B.touch1[2]===j.identifier&&(B.touch1[0]=K);if(j=B.that.__zoom,B.touch1){var U=B.touch0[0],le=B.touch0[1],de=B.touch1[0],ge=B.touch1[1],se=(se=de[0]-U[0])*se+(se=de[1]-U[1])*se,pe=(pe=ge[0]-le[0])*pe+(pe=ge[1]-le[1])*pe;j=k(j,Math.sqrt(se/pe)),K=[(U[0]+de[0])/2,(U[1]+de[1])/2],te=[(le[0]+ge[0])/2,(le[1]+ge[1])/2]}else if(B.touch0)K=B.touch0[0],te=B.touch0[1];else return;B.zoom("touch",n(N(j,K,te),B.extent,l))}}function ne(q,...Q){if(this.__zooming){var B=z(this,Q).event(q),Y=q.changedTouches,Z=Y.length,$,j;for(mv(q),x&&clearTimeout(x),x=setTimeout(function(){x=null},v),$=0;$<Z;++$)j=Y[$],B.touch0&&B.touch0[2]===j.identifier?delete B.touch0:B.touch1&&B.touch1[2]===j.identifier&&delete B.touch1;if(B.touch1&&!B.touch0&&(B.touch0=B.touch1,delete B.touch1),B.touch0)B.touch0[1]=this.__zoom.invert(B.touch0[0]);else if(B.end(),B.taps===2&&(j=ul(j,this),Math.hypot(g[0]-j[0],g[1]-j[1])<C)){var K=Qa(this).on("dblclick.zoom");K&&K.apply(this,arguments)}}}return w.wheelDelta=function(q){return arguments.length?(i=typeof q=="function"?q:e0(+q),w):i},w.filter=function(q){return arguments.length?(t=typeof q=="function"?q:e0(!!q),w):t},w.touchable=function(q){return arguments.length?(r=typeof q=="function"?q:e0(!!q),w):r},w.extent=function(q){return arguments.length?(e=typeof q=="function"?q:e0([[+q[0][0],+q[0][1]],[+q[1][0],+q[1][1]]]),w):e},w.scaleExtent=function(q){return arguments.length?(s[0]=+q[0],s[1]=+q[1],w):[s[0],s[1]]},w.translateExtent=function(q){return arguments.length?(l[0][0]=+q[0][0],l[1][0]=+q[1][0],l[0][1]=+q[0][1],l[1][1]=+q[1][1],w):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},w.constrain=function(q){return arguments.length?(n=q,w):n},w.duration=function(q){return arguments.length?(c=+q,w):c},w.interpolate=function(q){return arguments.length?(d=q,w):d},w.on=function(){var q=p.on.apply(p,arguments);return q===p?w:q},w.clickDistance=function(q){return arguments.length?(A=(q=+q)*q,w):Math.sqrt(A)},w.tapDistance=function(q){return arguments.length?(C=+q,w):C},w}const fo={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:i})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:i}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Lm=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],gR=["Enter"," ","Escape"],yR={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ch;(function(t){t.Strict="strict",t.Loose="loose"})(ch||(ch={}));var pf;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(pf||(pf={}));var Um;(function(t){t.Partial="partial",t.Full="full"})(Um||(Um={}));const bR={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var nu;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(nu||(nu={}));var I0;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(I0||(I0={}));var Qe;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Qe||(Qe={}));const fT={[Qe.Left]:Qe.Right,[Qe.Right]:Qe.Left,[Qe.Top]:Qe.Bottom,[Qe.Bottom]:Qe.Top};function xR(t){return t===null?null:t?"valid":"invalid"}const vR=t=>"id"in t&&"source"in t&&"target"in t,zV=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),M1=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Qm=(t,e=[0,0])=>{const{width:n,height:i}=lc(t),r=t.origin??e,s=n*r[0],l=i*r[1];return{x:t.position.x-s,y:t.position.y-l}},BV=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((i,r)=>{const s=typeof r=="string";let l=!e.nodeLookup&&!s?r:void 0;e.nodeLookup&&(l=s?e.nodeLookup.get(r):M1(r)?r:e.nodeLookup.get(r.id));const c=l?H0(l,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return cb(i,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ub(n)},Jm=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return t.forEach(r=>{(e.filter===void 0||e.filter(r))&&(n=cb(n,H0(r)),i=!0)}),i?ub(n):{x:0,y:0,width:0,height:0}},N1=(t,e,[n,i,r]=[0,0,1],s=!1,l=!1)=>{const c={...tg(e,[n,i,r]),width:e.width/r,height:e.height/r},d=[];for(const p of t.values()){const{measured:m,selectable:g=!0,hidden:x=!1}=p;if(l&&!g||x)continue;const v=m.width??p.width??p.initialWidth??null,E=m.height??p.height??p.initialHeight??null,A=Im(c,fh(p)),C=(v??0)*(E??0),w=s&&A>0;(!p.internals.handleBounds||w||A>=C||p.dragging)&&d.push(p)}return d},LV=(t,e)=>{const n=new Set;return t.forEach(i=>{n.add(i.id)}),e.filter(i=>n.has(i.source)||n.has(i.target))};function UV(t,e){const n=new Map,i=e!=null&&e.nodes?new Set(e.nodes.map(r=>r.id)):null;return t.forEach(r=>{r.measured.width&&r.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!r.hidden)&&(!i||i.has(r.id))&&n.set(r.id,r)}),n}async function IV({nodes:t,width:e,height:n,panZoom:i,minZoom:r,maxZoom:s},l){if(t.size===0)return Promise.resolve(!0);const c=UV(t,l),d=Jm(c),p=R1(d,e,n,(l==null?void 0:l.minZoom)??r,(l==null?void 0:l.maxZoom)??s,(l==null?void 0:l.padding)??.1);return await i.setViewport(p,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),Promise.resolve(!0)}function _R({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:i=[0,0],nodeExtent:r,onError:s}){const l=n.get(t),c=l.parentId?n.get(l.parentId):void 0,{x:d,y:p}=c?c.internals.positionAbsolute:{x:0,y:0},m=l.origin??i;let g=l.extent||r;if(l.extent==="parent"&&!l.expandParent)if(!c)s==null||s("005",fo.error005());else{const v=c.measured.width,E=c.measured.height;v&&E&&(g=[[d,p],[d+v,p+E]])}else c&&dh(l.extent)&&(g=[[l.extent[0][0]+d,l.extent[0][1]+p],[l.extent[1][0]+d,l.extent[1][1]+p]]);const x=dh(g)?vf(e,g,l.measured):e;return(l.measured.width===void 0||l.measured.height===void 0)&&(s==null||s("015",fo.error015())),{position:{x:x.x-d+(l.measured.width??0)*m[0],y:x.y-p+(l.measured.height??0)*m[1]},positionAbsolute:x}}async function HV({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:i,onBeforeDelete:r}){const s=new Set(t.map(x=>x.id)),l=[];for(const x of n){if(x.deletable===!1)continue;const v=s.has(x.id),E=!v&&x.parentId&&l.find(A=>A.id===x.parentId);(v||E)&&l.push(x)}const c=new Set(e.map(x=>x.id)),d=i.filter(x=>x.deletable!==!1),m=LV(l,d);for(const x of d)c.has(x.id)&&!m.find(E=>E.id===x.id)&&m.push(x);if(!r)return{edges:m,nodes:l};const g=await r({nodes:l,edges:m});return typeof g=="boolean"?g?{edges:m,nodes:l}:{edges:[],nodes:[]}:g}const uh=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),vf=(t={x:0,y:0},e,n)=>({x:uh(t.x,e[0][0],e[1][0]-((n==null?void 0:n.width)??0)),y:uh(t.y,e[0][1],e[1][1]-((n==null?void 0:n.height)??0))});function SR(t,e,n){const{width:i,height:r}=lc(n),{x:s,y:l}=n.internals.positionAbsolute;return vf(t,[[s,l],[s+i,l+r]],e)}const dT=(t,e,n)=>t<e?uh(Math.abs(t-e),1,e)/e:t>n?-uh(Math.abs(t-n),1,e)/e:0,ER=(t,e,n=15,i=40)=>{const r=dT(t.x,i,e.width-i)*n,s=dT(t.y,i,e.height-i)*n;return[r,s]},cb=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),E_=({x:t,y:e,width:n,height:i})=>({x:t,y:e,x2:t+n,y2:e+i}),ub=({x:t,y:e,x2:n,y2:i})=>({x:t,y:e,width:n-t,height:i-e}),fh=(t,e=[0,0])=>{var r,s;const{x:n,y:i}=M1(t)?t.internals.positionAbsolute:Qm(t,e);return{x:n,y:i,width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0}},H0=(t,e=[0,0])=>{var r,s;const{x:n,y:i}=M1(t)?t.internals.positionAbsolute:Qm(t,e);return{x:n,y:i,x2:n+(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0),y2:i+(((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0)}},wR=(t,e)=>ub(cb(E_(t),E_(e))),Im=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),i=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*i)},hT=t=>pl(t.width)&&pl(t.height)&&pl(t.x)&&pl(t.y),pl=t=>!isNaN(t)&&isFinite(t),jV=(t,e)=>{},eg=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),tg=({x:t,y:e},[n,i,r],s=!1,l=[1,1])=>{const c={x:(t-n)/r,y:(e-i)/r};return s?eg(c,l):c},j0=({x:t,y:e},[n,i,r])=>({x:t*r+n,y:e*r+i});function Ld(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function PV(t,e,n){if(typeof t=="string"||typeof t=="number"){const i=Ld(t,n),r=Ld(t,e);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof t=="object"){const i=Ld(t.top??t.y??0,n),r=Ld(t.bottom??t.y??0,n),s=Ld(t.left??t.x??0,e),l=Ld(t.right??t.x??0,e);return{top:i,right:l,bottom:r,left:s,x:s+l,y:i+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function GV(t,e,n,i,r,s){const{x:l,y:c}=j0(t,[e,n,i]),{x:d,y:p}=j0({x:t.x+t.width,y:t.y+t.height},[e,n,i]),m=r-d,g=s-p;return{left:Math.floor(l),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(g)}}const R1=(t,e,n,i,r,s)=>{const l=PV(s,e,n),c=(e-l.x)/t.width,d=(n-l.y)/t.height,p=Math.min(c,d),m=uh(p,i,r),g=t.x+t.width/2,x=t.y+t.height/2,v=e/2-g*m,E=n/2-x*m,A=GV(t,v,E,m,e,n),C={left:Math.min(A.left-l.left,0),top:Math.min(A.top-l.top,0),right:Math.min(A.right-l.right,0),bottom:Math.min(A.bottom-l.bottom,0)};return{x:v-C.left+C.right,y:E-C.top+C.bottom,zoom:m}},Hm=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function dh(t){return t!=null&&t!=="parent"}function lc(t){var e,n;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight??0}}function TR(t){var e,n;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight)!==void 0}function CR(t,e={width:0,height:0},n,i,r){const s={...t},l=i.get(n);if(l){const c=l.origin||r;s.x+=l.internals.positionAbsolute.x-(e.width??0)*c[0],s.y+=l.internals.positionAbsolute.y-(e.height??0)*c[1]}return s}function pT(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function FV(){let t,e;return{promise:new Promise((i,r)=>{t=i,e=r}),resolve:t,reject:e}}function qV(t){return{...yR,...t||{}}}function Sm(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:l}=ml(t),c=tg({x:s-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)},i),{x:d,y:p}=n?eg(c,e):c;return{xSnapped:d,ySnapped:p,...c}}const k1=t=>({width:t.offsetWidth,height:t.offsetHeight}),AR=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},YV=["INPUT","SELECT","TEXTAREA"];function MR(t){var i,r;const e=((r=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:r[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:YV.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const NR=t=>"clientX"in t,ml=(t,e)=>{var s,l;const n=NR(t),i=n?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,r=n?t.clientY:(l=t.touches)==null?void 0:l[0].clientY;return{x:i-((e==null?void 0:e.left)??0),y:r-((e==null?void 0:e.top)??0)}},mT=(t,e,n,i,r)=>{const s=e.querySelectorAll(`.${t}`);return!s||!s.length?null:Array.from(s).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:t,nodeId:r,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/i,y:(c.top-n.top)/i,...k1(l)}})};function RR({sourceX:t,sourceY:e,targetX:n,targetY:i,sourceControlX:r,sourceControlY:s,targetControlX:l,targetControlY:c}){const d=t*.125+r*.375+l*.375+n*.125,p=e*.125+s*.375+c*.375+i*.125,m=Math.abs(d-t),g=Math.abs(p-e);return[d,p,m,g]}function t0(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function gT({pos:t,x1:e,y1:n,x2:i,y2:r,c:s}){switch(t){case Qe.Left:return[e-t0(e-i,s),n];case Qe.Right:return[e+t0(i-e,s),n];case Qe.Top:return[e,n-t0(n-r,s)];case Qe.Bottom:return[e,n+t0(r-n,s)]}}function kR({sourceX:t,sourceY:e,sourcePosition:n=Qe.Bottom,targetX:i,targetY:r,targetPosition:s=Qe.Top,curvature:l=.25}){const[c,d]=gT({pos:n,x1:t,y1:e,x2:i,y2:r,c:l}),[p,m]=gT({pos:s,x1:i,y1:r,x2:t,y2:e,c:l}),[g,x,v,E]=RR({sourceX:t,sourceY:e,targetX:i,targetY:r,sourceControlX:c,sourceControlY:d,targetControlX:p,targetControlY:m});return[`M${t},${e} C${c},${d} ${p},${m} ${i},${r}`,g,x,v,E]}function OR({sourceX:t,sourceY:e,targetX:n,targetY:i}){const r=Math.abs(n-t)/2,s=n<t?n+r:n-r,l=Math.abs(i-e)/2,c=i<e?i+l:i-l;return[s,c,r,l]}function VV({sourceNode:t,targetNode:e,selected:n=!1,zIndex:i=0,elevateOnSelect:r=!1,zIndexMode:s="basic"}){if(s==="manual")return i;const l=r&&n?i+1e3:i,c=Math.max(t.parentId||r&&t.selected?t.internals.z:0,e.parentId||r&&e.selected?e.internals.z:0);return l+c}function XV({sourceNode:t,targetNode:e,width:n,height:i,transform:r}){const s=cb(H0(t),H0(e));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const l={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:i/r[2]};return Im(l,ub(s))>0}const KV=({source:t,sourceHandle:e,target:n,targetHandle:i})=>`xy-edge__${t}${e||""}-${n}${i||""}`,WV=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),ZV=(t,e,n={})=>{if(!t.source||!t.target)return e;const i=n.getEdgeId||KV;let r;return vR(t)?r={...t}:r={...t,id:i(t)},WV(r,e)?e:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,e.concat(r))};function DR({sourceX:t,sourceY:e,targetX:n,targetY:i}){const[r,s,l,c]=OR({sourceX:t,sourceY:e,targetX:n,targetY:i});return[`M ${t},${e}L ${n},${i}`,r,s,l,c]}const yT={[Qe.Left]:{x:-1,y:0},[Qe.Right]:{x:1,y:0},[Qe.Top]:{x:0,y:-1},[Qe.Bottom]:{x:0,y:1}},$V=({source:t,sourcePosition:e=Qe.Bottom,target:n})=>e===Qe.Left||e===Qe.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},bT=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function QV({source:t,sourcePosition:e=Qe.Bottom,target:n,targetPosition:i=Qe.Top,center:r,offset:s,stepPosition:l}){const c=yT[e],d=yT[i],p={x:t.x+c.x*s,y:t.y+c.y*s},m={x:n.x+d.x*s,y:n.y+d.y*s},g=$V({source:p,sourcePosition:e,target:m}),x=g.x!==0?"x":"y",v=g[x];let E=[],A,C;const w={x:0,y:0},k={x:0,y:0},[,,N,D]=OR({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(c[x]*d[x]===-1){x==="x"?(A=r.x??p.x+(m.x-p.x)*l,C=r.y??(p.y+m.y)/2):(A=r.x??(p.x+m.x)/2,C=r.y??p.y+(m.y-p.y)*l);const z=[{x:A,y:p.y},{x:A,y:m.y}],F=[{x:p.x,y:C},{x:m.x,y:C}];c[x]===v?E=x==="x"?z:F:E=x==="x"?F:z}else{const z=[{x:p.x,y:m.y}],F=[{x:m.x,y:p.y}];if(x==="x"?E=c.x===v?F:z:E=c.y===v?z:F,e===i){const X=Math.abs(t[x]-n[x]);if(X<=s){const ne=Math.min(s-1,s-X);c[x]===v?w[x]=(p[x]>t[x]?-1:1)*ne:k[x]=(m[x]>n[x]?-1:1)*ne}}if(e!==i){const X=x==="x"?"y":"x",ne=c[x]===d[X],q=p[X]>m[X],Q=p[X]<m[X];(c[x]===1&&(!ne&&q||ne&&Q)||c[x]!==1&&(!ne&&Q||ne&&q))&&(E=x==="x"?z:F)}const ee={x:p.x+w.x,y:p.y+w.y},P={x:m.x+k.x,y:m.y+k.y},I=Math.max(Math.abs(ee.x-E[0].x),Math.abs(P.x-E[0].x)),V=Math.max(Math.abs(ee.y-E[0].y),Math.abs(P.y-E[0].y));I>=V?(A=(ee.x+P.x)/2,C=E[0].y):(A=E[0].x,C=(ee.y+P.y)/2)}return[[t,{x:p.x+w.x,y:p.y+w.y},...E,{x:m.x+k.x,y:m.y+k.y},n],A,C,N,D]}function JV(t,e,n,i){const r=Math.min(bT(t,e)/2,bT(e,n)/2,i),{x:s,y:l}=e;if(t.x===s&&s===n.x||t.y===l&&l===n.y)return`L${s} ${l}`;if(t.y===l){const p=t.x<n.x?-1:1,m=t.y<n.y?1:-1;return`L ${s+r*p},${l}Q ${s},${l} ${s},${l+r*m}`}const c=t.x<n.x?1:-1,d=t.y<n.y?-1:1;return`L ${s},${l+r*d}Q ${s},${l} ${s+r*c},${l}`}function w_({sourceX:t,sourceY:e,sourcePosition:n=Qe.Bottom,targetX:i,targetY:r,targetPosition:s=Qe.Top,borderRadius:l=5,centerX:c,centerY:d,offset:p=20,stepPosition:m=.5}){const[g,x,v,E,A]=QV({source:{x:t,y:e},sourcePosition:n,target:{x:i,y:r},targetPosition:s,center:{x:c,y:d},offset:p,stepPosition:m});return[g.reduce((w,k,N)=>{let D="";return N>0&&N<g.length-1?D=JV(g[N-1],k,g[N+1],l):D=`${N===0?"M":"L"}${k.x} ${k.y}`,w+=D,w},""),x,v,E,A]}function xT(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function eX(t){var g;const{sourceNode:e,targetNode:n}=t;if(!xT(e)||!xT(n))return null;const i=e.internals.handleBounds||vT(e.handles),r=n.internals.handleBounds||vT(n.handles),s=_T((i==null?void 0:i.source)??[],t.sourceHandle),l=_T(t.connectionMode===ch.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),t.targetHandle);if(!s||!l)return(g=t.onError)==null||g.call(t,"008",fo.error008(s?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const c=(s==null?void 0:s.position)||Qe.Bottom,d=(l==null?void 0:l.position)||Qe.Top,p=_f(e,s,c),m=_f(n,l,d);return{sourceX:p.x,sourceY:p.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:d}}function vT(t){if(!t)return null;const e=[],n=[];for(const i of t)i.width=i.width??1,i.height=i.height??1,i.type==="source"?e.push(i):i.type==="target"&&n.push(i);return{source:e,target:n}}function _f(t,e,n=Qe.Left,i=!1){const r=((e==null?void 0:e.x)??0)+t.internals.positionAbsolute.x,s=((e==null?void 0:e.y)??0)+t.internals.positionAbsolute.y,{width:l,height:c}=e??lc(t);if(i)return{x:r+l/2,y:s+c/2};switch((e==null?void 0:e.position)??n){case Qe.Top:return{x:r+l/2,y:s};case Qe.Right:return{x:r+l,y:s+c/2};case Qe.Bottom:return{x:r+l/2,y:s+c};case Qe.Left:return{x:r,y:s+c/2}}}function _T(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function T_(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("&")}`:""}function tX(t,{id:e,defaultColor:n,defaultMarkerStart:i,defaultMarkerEnd:r}){const s=new Set;return t.reduce((l,c)=>([c.markerStart||i,c.markerEnd||r].forEach(d=>{if(d&&typeof d=="object"){const p=T_(d,e);s.has(p)||(l.push({id:p,color:d.color||n,...d}),s.add(p))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const zR=1e3,nX=10,O1={nodeOrigin:[0,0],nodeExtent:Lm,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},iX={...O1,checkEquality:!0};function D1(t,e){const n={...t};for(const i in e)e[i]!==void 0&&(n[i]=e[i]);return n}function rX(t,e,n){const i=D1(O1,n);for(const r of t.values())if(r.parentId)B1(r,t,e,i);else{const s=Qm(r,i.nodeOrigin),l=dh(r.extent)?r.extent:i.nodeExtent,c=vf(s,l,lc(r));r.internals.positionAbsolute=c}}function aX(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const n=[],i=[];for(const r of t.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:t.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(s):r.type==="target"&&i.push(s)}return{source:n,target:i}}function z1(t){return t==="manual"}function C_(t,e,n,i={}){var p,m;const r=D1(iX,i),s={i:0},l=new Map(e),c=r!=null&&r.elevateNodesOnSelect&&!z1(r.zIndexMode)?zR:0;let d=t.length>0;e.clear(),n.clear();for(const g of t){let x=l.get(g.id);if(r.checkEquality&&g===(x==null?void 0:x.internals.userNode))e.set(g.id,x);else{const v=Qm(g,r.nodeOrigin),E=dh(g.extent)?g.extent:r.nodeExtent,A=vf(v,E,lc(g));x={...r.defaults,...g,measured:{width:(p=g.measured)==null?void 0:p.width,height:(m=g.measured)==null?void 0:m.height},internals:{positionAbsolute:A,handleBounds:aX(g,x),z:BR(g,c,r.zIndexMode),userNode:g}},e.set(g.id,x)}(x.measured===void 0||x.measured.width===void 0||x.measured.height===void 0)&&!x.hidden&&(d=!1),g.parentId&&B1(x,e,n,i,s)}return d}function sX(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function B1(t,e,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:l,nodeExtent:c,zIndexMode:d}=D1(O1,i),p=t.parentId,m=e.get(p);if(!m){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}sX(t,n),r&&!m.parentId&&m.internals.rootParentIndex===void 0&&d==="auto"&&(m.internals.rootParentIndex=++r.i,m.internals.z=m.internals.z+r.i*nX),r&&m.internals.rootParentIndex!==void 0&&(r.i=m.internals.rootParentIndex);const g=s&&!z1(d)?zR:0,{x,y:v,z:E}=lX(t,m,l,c,g,d),{positionAbsolute:A}=t.internals,C=x!==A.x||v!==A.y;(C||E!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:C?{x,y:v}:A,z:E}})}function BR(t,e,n){const i=pl(t.zIndex)?t.zIndex:0;return z1(n)?i:i+(t.selected?e:0)}function lX(t,e,n,i,r,s){const{x:l,y:c}=e.internals.positionAbsolute,d=lc(t),p=Qm(t,n),m=dh(t.extent)?vf(p,t.extent,d):p;let g=vf({x:l+m.x,y:c+m.y},i,d);t.extent==="parent"&&(g=SR(g,d,e));const x=BR(t,r,s),v=e.internals.z??0;return{x:g.x,y:g.y,z:v>=x?v+1:x}}function L1(t,e,n,i=[0,0]){var l;const r=[],s=new Map;for(const c of t){const d=e.get(c.parentId);if(!d)continue;const p=((l=s.get(c.parentId))==null?void 0:l.expandedRect)??fh(d),m=wR(p,c.rect);s.set(c.parentId,{expandedRect:m,parent:d})}return s.size>0&&s.forEach(({expandedRect:c,parent:d},p)=>{var N;const m=d.internals.positionAbsolute,g=lc(d),x=d.origin??i,v=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,E=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,A=Math.max(g.width,Math.round(c.width)),C=Math.max(g.height,Math.round(c.height)),w=(A-g.width)*x[0],k=(C-g.height)*x[1];(v>0||E>0||w||k)&&(r.push({id:p,type:"position",position:{x:d.position.x-v+w,y:d.position.y-E+k}}),(N=n.get(p))==null||N.forEach(D=>{t.some(H=>H.id===D.id)||r.push({id:D.id,type:"position",position:{x:D.position.x+v,y:D.position.y+E}})})),(g.width<c.width||g.height<c.height||v||E)&&r.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:A+(v?x[0]*v-w:0),height:C+(E?x[1]*E-k:0)}})}),r}function oX(t,e,n,i,r,s,l){const c=i==null?void 0:i.querySelector(".xyflow__viewport");let d=!1;if(!c)return{changes:[],updatedInternals:d};const p=[],m=window.getComputedStyle(c),{m22:g}=new window.DOMMatrixReadOnly(m.transform),x=[];for(const v of t.values()){const E=e.get(v.id);if(!E)continue;if(E.hidden){e.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),d=!0;continue}const A=k1(v.nodeElement),C=E.measured.width!==A.width||E.measured.height!==A.height;if(!!(A.width&&A.height&&(C||!E.internals.handleBounds||v.force))){const k=v.nodeElement.getBoundingClientRect(),N=dh(E.extent)?E.extent:s;let{positionAbsolute:D}=E.internals;E.parentId&&E.extent==="parent"?D=SR(D,A,e.get(E.parentId)):N&&(D=vf(D,N,A));const H={...E,measured:A,internals:{...E.internals,positionAbsolute:D,handleBounds:{source:mT("source",v.nodeElement,k,g,E.id),target:mT("target",v.nodeElement,k,g,E.id)}}};e.set(E.id,H),E.parentId&&B1(H,e,n,{nodeOrigin:r,zIndexMode:l}),d=!0,C&&(p.push({id:E.id,type:"dimensions",dimensions:A}),E.expandParent&&E.parentId&&x.push({id:E.id,parentId:E.parentId,rect:fh(H,r)}))}}if(x.length>0){const v=L1(x,e,n,r);p.push(...v)}return{changes:p,updatedInternals:d}}async function cX({delta:t,panZoom:e,transform:n,translateExtent:i,width:r,height:s}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const l=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[r,s]],i),c=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(c)}function ST(t,e,n,i,r,s){let l=r;const c=i.get(l)||new Map;i.set(l,c.set(n,e)),l=`${r}-${t}`;const d=i.get(l)||new Map;if(i.set(l,d.set(n,e)),s){l=`${r}-${t}-${s}`;const p=i.get(l)||new Map;i.set(l,p.set(n,e))}}function LR(t,e,n){t.clear(),e.clear();for(const i of n){const{source:r,target:s,sourceHandle:l=null,targetHandle:c=null}=i,d={edgeId:i.id,source:r,target:s,sourceHandle:l,targetHandle:c},p=`${r}-${l}--${s}-${c}`,m=`${s}-${c}--${r}-${l}`;ST("source",d,m,t,r,l),ST("target",d,p,t,s,c),e.set(i.id,i)}}function UR(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:UR(n,e):!1}function ET(t,e,n){var r;let i=t;do{if((r=i==null?void 0:i.matches)!=null&&r.call(i,e))return!0;if(i===n)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function uX(t,e,n,i){const r=new Map;for(const[s,l]of t)if((l.selected||l.id===i)&&(!l.parentId||!UR(l,t))&&(l.draggable||e&&typeof l.draggable>"u")){const c=t.get(s);c&&r.set(s,{id:s,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return r}function gv({nodeId:t,dragItems:e,nodeLookup:n,dragging:i=!0}){var l,c,d;const r=[];for(const[p,m]of e){const g=(l=n.get(p))==null?void 0:l.internals.userNode;g&&r.push({...g,position:m.position,dragging:i})}if(!t)return[r[0],r];const s=(c=n.get(t))==null?void 0:c.internals.userNode;return[s?{...s,position:((d=e.get(t))==null?void 0:d.position)||s.position,dragging:i}:r[0],r]}function fX({dragItems:t,snapGrid:e,x:n,y:i}){const r=t.values().next().value;if(!r)return null;const s={x:n-r.distance.x,y:i-r.distance.y},l=eg(s,e);return{x:l.x-s.x,y:l.y-s.y}}function dX({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:i,onDragStop:r}){let s={x:null,y:null},l=0,c=new Map,d=!1,p={x:0,y:0},m=null,g=!1,x=null,v=!1,E=!1,A=null;function C({noDragClassName:k,handleSelector:N,domNode:D,isSelectable:H,nodeId:z,nodeClickDistance:F=0}){x=Qa(D);function ee({x:X,y:ne}){const{nodeLookup:q,nodeExtent:Q,snapGrid:B,snapToGrid:Y,nodeOrigin:Z,onNodeDrag:$,onSelectionDrag:j,onError:K,updateNodePositions:te}=e();s={x:X,y:ne};let U=!1;const le=c.size>1,de=le&&Q?E_(Jm(c)):null,ge=le&&Y?fX({dragItems:c,snapGrid:B,x:X,y:ne}):null;for(const[se,pe]of c){if(!q.has(se))continue;let Ae={x:X-pe.distance.x,y:ne-pe.distance.y};Y&&(Ae=ge?{x:Math.round(Ae.x+ge.x),y:Math.round(Ae.y+ge.y)}:eg(Ae,B));let Le=null;if(le&&Q&&!pe.extent&&de){const{positionAbsolute:Ie}=pe.internals,We=Ie.x-de.x+Q[0][0],ut=Ie.x+pe.measured.width-de.x2+Q[1][0],Ue=Ie.y-de.y+Q[0][1],At=Ie.y+pe.measured.height-de.y2+Q[1][1];Le=[[We,Ue],[ut,At]]}const{position:Ge,positionAbsolute:Pe}=_R({nodeId:se,nextPosition:Ae,nodeLookup:q,nodeExtent:Le||Q,nodeOrigin:Z,onError:K});U=U||pe.position.x!==Ge.x||pe.position.y!==Ge.y,pe.position=Ge,pe.internals.positionAbsolute=Pe}if(E=E||U,!!U&&(te(c,!0),A&&(i||$||!z&&j))){const[se,pe]=gv({nodeId:z,dragItems:c,nodeLookup:q});i==null||i(A,c,se,pe),$==null||$(A,se,pe),z||j==null||j(A,pe)}}async function P(){if(!m)return;const{transform:X,panBy:ne,autoPanSpeed:q,autoPanOnNodeDrag:Q}=e();if(!Q){d=!1,cancelAnimationFrame(l);return}const[B,Y]=ER(p,m,q);(B!==0||Y!==0)&&(s.x=(s.x??0)-B/X[2],s.y=(s.y??0)-Y/X[2],await ne({x:B,y:Y})&&ee(s)),l=requestAnimationFrame(P)}function I(X){var le;const{nodeLookup:ne,multiSelectionActive:q,nodesDraggable:Q,transform:B,snapGrid:Y,snapToGrid:Z,selectNodesOnDrag:$,onNodeDragStart:j,onSelectionDragStart:K,unselectNodesAndEdges:te}=e();g=!0,(!$||!H)&&!q&&z&&((le=ne.get(z))!=null&&le.selected||te()),H&&$&&z&&(t==null||t(z));const U=Sm(X.sourceEvent,{transform:B,snapGrid:Y,snapToGrid:Z,containerBounds:m});if(s=U,c=uX(ne,Q,U,z),c.size>0&&(n||j||!z&&K)){const[de,ge]=gv({nodeId:z,dragItems:c,nodeLookup:ne});n==null||n(X.sourceEvent,c,de,ge),j==null||j(X.sourceEvent,de,ge),z||K==null||K(X.sourceEvent,ge)}}const V=eR().clickDistance(F).on("start",X=>{const{domNode:ne,nodeDragThreshold:q,transform:Q,snapGrid:B,snapToGrid:Y}=e();m=(ne==null?void 0:ne.getBoundingClientRect())||null,v=!1,E=!1,A=X.sourceEvent,q===0&&I(X),s=Sm(X.sourceEvent,{transform:Q,snapGrid:B,snapToGrid:Y,containerBounds:m}),p=ml(X.sourceEvent,m)}).on("drag",X=>{const{autoPanOnNodeDrag:ne,transform:q,snapGrid:Q,snapToGrid:B,nodeDragThreshold:Y,nodeLookup:Z}=e(),$=Sm(X.sourceEvent,{transform:q,snapGrid:Q,snapToGrid:B,containerBounds:m});if(A=X.sourceEvent,(X.sourceEvent.type==="touchmove"&&X.sourceEvent.touches.length>1||z&&!Z.has(z))&&(v=!0),!v){if(!d&&ne&&g&&(d=!0,P()),!g){const j=ml(X.sourceEvent,m),K=j.x-p.x,te=j.y-p.y;Math.sqrt(K*K+te*te)>Y&&I(X)}(s.x!==$.xSnapped||s.y!==$.ySnapped)&&c&&g&&(p=ml(X.sourceEvent,m),ee($))}}).on("end",X=>{if(!(!g||v)&&(d=!1,g=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:ne,updateNodePositions:q,onNodeDragStop:Q,onSelectionDragStop:B}=e();if(E&&(q(c,!1),E=!1),r||Q||!z&&B){const[Y,Z]=gv({nodeId:z,dragItems:c,nodeLookup:ne,dragging:!1});r==null||r(X.sourceEvent,c,Y,Z),Q==null||Q(X.sourceEvent,Y,Z),z||B==null||B(X.sourceEvent,Z)}}}).filter(X=>{const ne=X.target;return!X.button&&(!k||!ET(ne,`.${k}`,D))&&(!N||ET(ne,N,D))});x.call(V)}function w(){x==null||x.on(".drag",null)}return{update:C,destroy:w}}function hX(t,e,n){const i=[],r={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const s of e.values())Im(r,fh(s))>0&&i.push(s);return i}const pX=250;function mX(t,e,n,i){var c,d;let r=[],s=1/0;const l=hX(t,n,e+pX);for(const p of l){const m=[...((c=p.internals.handleBounds)==null?void 0:c.source)??[],...((d=p.internals.handleBounds)==null?void 0:d.target)??[]];for(const g of m){if(i.nodeId===g.nodeId&&i.type===g.type&&i.id===g.id)continue;const{x,y:v}=_f(p,g,g.position,!0),E=Math.sqrt(Math.pow(x-t.x,2)+Math.pow(v-t.y,2));E>e||(E<s?(r=[{...g,x,y:v}],s=E):E===s&&r.push({...g,x,y:v}))}}if(!r.length)return null;if(r.length>1){const p=i.type==="source"?"target":"source";return r.find(m=>m.type===p)??r[0]}return r[0]}function IR(t,e,n,i,r,s=!1){var p,m,g;const l=i.get(t);if(!l)return null;const c=r==="strict"?(p=l.internals.handleBounds)==null?void 0:p[e]:[...((m=l.internals.handleBounds)==null?void 0:m.source)??[],...((g=l.internals.handleBounds)==null?void 0:g.target)??[]],d=(n?c==null?void 0:c.find(x=>x.id===n):c==null?void 0:c[0])??null;return d&&s?{...d,..._f(l,d,d.position,!0)}:d}function HR(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function gX(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const jR=()=>!0;function yX(t,{connectionMode:e,connectionRadius:n,handleId:i,nodeId:r,edgeUpdaterType:s,isTarget:l,domNode:c,nodeLookup:d,lib:p,autoPanOnConnect:m,flowId:g,panBy:x,cancelConnection:v,onConnectStart:E,onConnect:A,onConnectEnd:C,isValidConnection:w=jR,onReconnectEnd:k,updateConnection:N,getTransform:D,getFromHandle:H,autoPanSpeed:z,dragThreshold:F=1,handleDomNode:ee}){const P=AR(t.target);let I=0,V;const{x:X,y:ne}=ml(t),q=HR(s,ee),Q=c==null?void 0:c.getBoundingClientRect();let B=!1;if(!Q||!q)return;const Y=IR(r,q,i,d,e);if(!Y)return;let Z=ml(t,Q),$=!1,j=null,K=!1,te=null;function U(){if(!m||!Q)return;const[Ge,Pe]=ER(Z,Q,z);x({x:Ge,y:Pe}),I=requestAnimationFrame(U)}const le={...Y,nodeId:r,type:q,position:Y.position},de=d.get(r);let se={inProgress:!0,isValid:null,from:_f(de,le,Qe.Left,!0),fromHandle:le,fromPosition:le.position,fromNode:de,to:Z,toHandle:null,toPosition:fT[le.position],toNode:null,pointer:Z};function pe(){B=!0,N(se),E==null||E(t,{nodeId:r,handleId:i,handleType:q})}F===0&&pe();function Ae(Ge){if(!B){const{x:At,y:zn}=ml(Ge),Bn=At-X,bn=zn-ne;if(!(Bn*Bn+bn*bn>F*F))return;pe()}if(!H()||!le){Le(Ge);return}const Pe=D();Z=ml(Ge,Q),V=mX(tg(Z,Pe,!1,[1,1]),n,d,le),$||(U(),$=!0);const Ie=PR(Ge,{handle:V,connectionMode:e,fromNodeId:r,fromHandleId:i,fromType:l?"target":"source",isValidConnection:w,doc:P,lib:p,flowId:g,nodeLookup:d});te=Ie.handleDomNode,j=Ie.connection,K=gX(!!V,Ie.isValid);const We=d.get(r),ut=We?_f(We,le,Qe.Left,!0):se.from,Ue={...se,from:ut,isValid:K,to:Ie.toHandle&&K?j0({x:Ie.toHandle.x,y:Ie.toHandle.y},Pe):Z,toHandle:Ie.toHandle,toPosition:K&&Ie.toHandle?Ie.toHandle.position:fT[le.position],toNode:Ie.toHandle?d.get(Ie.toHandle.nodeId):null,pointer:Z};N(Ue),se=Ue}function Le(Ge){if(!("touches"in Ge&&Ge.touches.length>0)){if(B){(V||te)&&j&&K&&(A==null||A(j));const{inProgress:Pe,...Ie}=se,We={...Ie,toPosition:se.toHandle?se.toPosition:null};C==null||C(Ge,We),s&&(k==null||k(Ge,We))}v(),cancelAnimationFrame(I),$=!1,K=!1,j=null,te=null,P.removeEventListener("mousemove",Ae),P.removeEventListener("mouseup",Le),P.removeEventListener("touchmove",Ae),P.removeEventListener("touchend",Le)}}P.addEventListener("mousemove",Ae),P.addEventListener("mouseup",Le),P.addEventListener("touchmove",Ae),P.addEventListener("touchend",Le)}function PR(t,{handle:e,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:l,lib:c,flowId:d,isValidConnection:p=jR,nodeLookup:m}){const g=s==="target",x=e?l.querySelector(`.${c}-flow__handle[data-id="${d}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:v,y:E}=ml(t),A=l.elementFromPoint(v,E),C=A!=null&&A.classList.contains(`${c}-flow__handle`)?A:x,w={handleDomNode:C,isValid:!1,connection:null,toHandle:null};if(C){const k=HR(void 0,C),N=C.getAttribute("data-nodeid"),D=C.getAttribute("data-handleid"),H=C.classList.contains("connectable"),z=C.classList.contains("connectableend");if(!N||!k)return w;const F={source:g?N:i,sourceHandle:g?D:r,target:g?i:N,targetHandle:g?r:D};w.connection=F;const P=H&&z&&(n===ch.Strict?g&&k==="source"||!g&&k==="target":N!==i||D!==r);w.isValid=P&&p(F),w.toHandle=IR(N,k,D,m,n,!0)}return w}const A_={onPointerDown:yX,isValid:PR};function bX({domNode:t,panZoom:e,getTransform:n,getViewScale:i}){const r=Qa(t);function s({translateExtent:c,width:d,height:p,zoomStep:m=1,pannable:g=!0,zoomable:x=!0,inversePan:v=!1}){const E=N=>{if(N.sourceEvent.type!=="wheel"||!e)return;const D=n(),H=N.sourceEvent.ctrlKey&&Hm()?10:1,z=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?.05:N.sourceEvent.deltaMode?1:.002)*m,F=D[2]*Math.pow(2,z*H);e.scaleTo(F)};let A=[0,0];const C=N=>{(N.sourceEvent.type==="mousedown"||N.sourceEvent.type==="touchstart")&&(A=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY])},w=N=>{const D=n();if(N.sourceEvent.type!=="mousemove"&&N.sourceEvent.type!=="touchmove"||!e)return;const H=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY],z=[H[0]-A[0],H[1]-A[1]];A=H;const F=i()*Math.max(D[2],Math.log(D[2]))*(v?-1:1),ee={x:D[0]-z[0]*F,y:D[1]-z[1]*F},P=[[0,0],[d,p]];e.setViewportConstrained({x:ee.x,y:ee.y,zoom:D[2]},P,c)},k=mR().on("start",C).on("zoom",g?w:null).on("zoom.wheel",x?E:null);r.call(k,{})}function l(){r.on("zoom",null)}return{update:s,destroy:l,pointer:ul}}const fb=t=>({x:t.x,y:t.y,zoom:t.k}),yv=({x:t,y:e,zoom:n})=>ob.translate(t,e).scale(n),Vd=(t,e)=>t.target.closest(`.${e}`),GR=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),xX=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,bv=(t,e=0,n=xX,i=()=>{})=>{const r=typeof e=="number"&&e>0;return r||i(),r?t.transition().duration(e).ease(n).on("end",i):t},FR=t=>{const e=t.ctrlKey&&Hm()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function vX({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:d,onPanZoomEnd:p}){return m=>{if(Vd(m,e))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const g=n.property("__zoom").k||1;if(m.ctrlKey&&l){const C=ul(m),w=FR(m),k=g*Math.pow(2,w);i.scaleTo(n,k,C,m);return}const x=m.deltaMode===1?20:1;let v=r===pf.Vertical?0:m.deltaX*x,E=r===pf.Horizontal?0:m.deltaY*x;!Hm()&&m.shiftKey&&r!==pf.Vertical&&(v=m.deltaY*x,E=0),i.translateBy(n,-(v/g)*s,-(E/g)*s,{internal:!0});const A=fb(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(d==null||d(m,A),t.panScrollTimeout=setTimeout(()=>{p==null||p(m,A),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,c==null||c(m,A))}}function _X({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",l=!e&&s&&!i.ctrlKey,c=Vd(i,t);if(i.ctrlKey&&s&&c&&i.preventDefault(),l||c)return null;i.preventDefault(),n.call(this,i,r)}}function SX({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return i=>{var s,l,c;if((s=i.sourceEvent)!=null&&s.internal)return;const r=fb(i.transform);t.mouseButton=((l=i.sourceEvent)==null?void 0:l.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=r,((c=i.sourceEvent)==null?void 0:c.type)==="mousedown"&&e(!0),n&&(n==null||n(i.sourceEvent,r))}}function EX({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var l,c;t.usedRightMouseButton=!!(n&&GR(e,t.mouseButton??0)),(l=s.sourceEvent)!=null&&l.sync||i([s.transform.x,s.transform.y,s.transform.k]),r&&!((c=s.sourceEvent)!=null&&c.internal)&&(r==null||r(s.sourceEvent,fb(s.transform)))}}function wX({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:i,onPanZoomEnd:r,onPaneContextMenu:s}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(t.isZoomingOrPanning=!1,s&&GR(e,t.mouseButton??0)&&!t.usedRightMouseButton&&l.sourceEvent&&s(l.sourceEvent),t.usedRightMouseButton=!1,i(!1),r)){const d=fb(l.transform);t.prevViewport=d,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{r==null||r(l.sourceEvent,d)},n?150:0)}}}function TX({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:i,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:l,noWheelClassName:c,noPanClassName:d,lib:p,connectionInProgress:m}){return g=>{var C;const x=t||e,v=n&&g.ctrlKey,E=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Vd(g,`${p}-flow__node`)||Vd(g,`${p}-flow__edge`)))return!0;if(!i&&!x&&!r&&!s&&!n||l||m&&!E||Vd(g,c)&&E||Vd(g,d)&&(!E||r&&E&&!t)||!n&&g.ctrlKey&&E)return!1;if(!n&&g.type==="touchstart"&&((C=g.touches)==null?void 0:C.length)>1)return g.preventDefault(),!1;if(!x&&!r&&!v&&E||!i&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(i)&&!i.includes(g.button)&&g.type==="mousedown")return!1;const A=Array.isArray(i)&&i.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||E)&&A}}function CX({domNode:t,minZoom:e,maxZoom:n,translateExtent:i,viewport:r,onPanZoom:s,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:d}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=t.getBoundingClientRect(),g=mR().scaleExtent([e,n]).translateExtent(i),x=Qa(t).call(g);k({x:r.x,y:r.y,zoom:uh(r.zoom,e,n)},[[0,0],[m.width,m.height]],i);const v=x.on("wheel.zoom"),E=x.on("dblclick.zoom");g.wheelDelta(FR);function A(V,X){return x?new Promise(ne=>{g==null||g.interpolate((X==null?void 0:X.interpolate)==="linear"?_m:d0).transform(bv(x,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>ne(!0)),V)}):Promise.resolve(!1)}function C({noWheelClassName:V,noPanClassName:X,onPaneContextMenu:ne,userSelectionActive:q,panOnScroll:Q,panOnDrag:B,panOnScrollMode:Y,panOnScrollSpeed:Z,preventScrolling:$,zoomOnPinch:j,zoomOnScroll:K,zoomOnDoubleClick:te,zoomActivationKeyPressed:U,lib:le,onTransformChange:de,connectionInProgress:ge,paneClickDistance:se,selectionOnDrag:pe}){q&&!p.isZoomingOrPanning&&w();const Ae=Q&&!U&&!q;g.clickDistance(pe?1/0:!pl(se)||se<0?0:se);const Le=Ae?vX({zoomPanValues:p,noWheelClassName:V,d3Selection:x,d3Zoom:g,panOnScrollMode:Y,panOnScrollSpeed:Z,zoomOnPinch:j,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:c}):_X({noWheelClassName:V,preventScrolling:$,d3ZoomHandler:v});if(x.on("wheel.zoom",Le,{passive:!1}),!q){const Pe=SX({zoomPanValues:p,onDraggingChange:d,onPanZoomStart:l});g.on("start",Pe);const Ie=EX({zoomPanValues:p,panOnDrag:B,onPaneContextMenu:!!ne,onPanZoom:s,onTransformChange:de});g.on("zoom",Ie);const We=wX({zoomPanValues:p,panOnDrag:B,panOnScroll:Q,onPaneContextMenu:ne,onPanZoomEnd:c,onDraggingChange:d});g.on("end",We)}const Ge=TX({zoomActivationKeyPressed:U,panOnDrag:B,zoomOnScroll:K,panOnScroll:Q,zoomOnDoubleClick:te,zoomOnPinch:j,userSelectionActive:q,noPanClassName:X,noWheelClassName:V,lib:le,connectionInProgress:ge});g.filter(Ge),te?x.on("dblclick.zoom",E):x.on("dblclick.zoom",null)}function w(){g.on("zoom",null)}async function k(V,X,ne){const q=yv(V),Q=g==null?void 0:g.constrain()(q,X,ne);return Q&&await A(Q),new Promise(B=>B(Q))}async function N(V,X){const ne=yv(V);return await A(ne,X),new Promise(q=>q(ne))}function D(V){if(x){const X=yv(V),ne=x.property("__zoom");(ne.k!==V.zoom||ne.x!==V.x||ne.y!==V.y)&&(g==null||g.transform(x,X,null,{sync:!0}))}}function H(){const V=x?pR(x.node()):{x:0,y:0,k:1};return{x:V.x,y:V.y,zoom:V.k}}function z(V,X){return x?new Promise(ne=>{g==null||g.interpolate((X==null?void 0:X.interpolate)==="linear"?_m:d0).scaleTo(bv(x,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>ne(!0)),V)}):Promise.resolve(!1)}function F(V,X){return x?new Promise(ne=>{g==null||g.interpolate((X==null?void 0:X.interpolate)==="linear"?_m:d0).scaleBy(bv(x,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>ne(!0)),V)}):Promise.resolve(!1)}function ee(V){g==null||g.scaleExtent(V)}function P(V){g==null||g.translateExtent(V)}function I(V){const X=!pl(V)||V<0?0:V;g==null||g.clickDistance(X)}return{update:C,destroy:w,setViewport:N,setViewportConstrained:k,getViewport:H,scaleTo:z,scaleBy:F,setScaleExtent:ee,setTranslateExtent:P,syncViewport:D,setClickDistance:I}}var hh;(function(t){t.Line="line",t.Handle="handle"})(hh||(hh={}));function AX({width:t,prevWidth:e,height:n,prevHeight:i,affectsX:r,affectsY:s}){const l=t-e,c=n-i,d=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&r&&(d[0]=d[0]*-1),c&&s&&(d[1]=d[1]*-1),d}function wT(t){const e=t.includes("right")||t.includes("left"),n=t.includes("bottom")||t.includes("top"),i=t.includes("left"),r=t.includes("top");return{isHorizontal:e,isVertical:n,affectsX:i,affectsY:r}}function $c(t,e){return Math.max(0,e-t)}function Qc(t,e){return Math.max(0,t-e)}function n0(t,e,n){return Math.max(0,e-t,t-n)}function TT(t,e){return t?!e:e}function MX(t,e,n,i,r,s,l,c){let{affectsX:d,affectsY:p}=e;const{isHorizontal:m,isVertical:g}=e,x=m&&g,{xSnapped:v,ySnapped:E}=n,{minWidth:A,maxWidth:C,minHeight:w,maxHeight:k}=i,{x:N,y:D,width:H,height:z,aspectRatio:F}=t;let ee=Math.floor(m?v-t.pointerX:0),P=Math.floor(g?E-t.pointerY:0);const I=H+(d?-ee:ee),V=z+(p?-P:P),X=-s[0]*H,ne=-s[1]*z;let q=n0(I,A,C),Q=n0(V,w,k);if(l){let Z=0,$=0;d&&ee<0?Z=$c(N+ee+X,l[0][0]):!d&&ee>0&&(Z=Qc(N+I+X,l[1][0])),p&&P<0?$=$c(D+P+ne,l[0][1]):!p&&P>0&&($=Qc(D+V+ne,l[1][1])),q=Math.max(q,Z),Q=Math.max(Q,$)}if(c){let Z=0,$=0;d&&ee>0?Z=Qc(N+ee,c[0][0]):!d&&ee<0&&(Z=$c(N+I,c[1][0])),p&&P>0?$=Qc(D+P,c[0][1]):!p&&P<0&&($=$c(D+V,c[1][1])),q=Math.max(q,Z),Q=Math.max(Q,$)}if(r){if(m){const Z=n0(I/F,w,k)*F;if(q=Math.max(q,Z),l){let $=0;!d&&!p||d&&!p&&x?$=Qc(D+ne+I/F,l[1][1])*F:$=$c(D+ne+(d?ee:-ee)/F,l[0][1])*F,q=Math.max(q,$)}if(c){let $=0;!d&&!p||d&&!p&&x?$=$c(D+I/F,c[1][1])*F:$=Qc(D+(d?ee:-ee)/F,c[0][1])*F,q=Math.max(q,$)}}if(g){const Z=n0(V*F,A,C)/F;if(Q=Math.max(Q,Z),l){let $=0;!d&&!p||p&&!d&&x?$=Qc(N+V*F+X,l[1][0])/F:$=$c(N+(p?P:-P)*F+X,l[0][0])/F,Q=Math.max(Q,$)}if(c){let $=0;!d&&!p||p&&!d&&x?$=$c(N+V*F,c[1][0])/F:$=Qc(N+(p?P:-P)*F,c[0][0])/F,Q=Math.max(Q,$)}}}P=P+(P<0?Q:-Q),ee=ee+(ee<0?q:-q),r&&(x?I>V*F?P=(TT(d,p)?-ee:ee)/F:ee=(TT(d,p)?-P:P)*F:m?(P=ee/F,p=d):(ee=P*F,d=p));const B=d?N+ee:N,Y=p?D+P:D;return{width:H+(d?-ee:ee),height:z+(p?-P:P),x:s[0]*ee*(d?-1:1)+B,y:s[1]*P*(p?-1:1)+Y}}const qR={width:0,height:0,x:0,y:0},NX={...qR,pointerX:0,pointerY:0,aspectRatio:1};function RX(t){return[[0,0],[t.measured.width,t.measured.height]]}function kX(t,e,n){const i=e.position.x+t.position.x,r=e.position.y+t.position.y,s=t.measured.width??0,l=t.measured.height??0,c=n[0]*s,d=n[1]*l;return[[i-c,r-d],[i+s-c,r+l-d]]}function OX({domNode:t,nodeId:e,getStoreItems:n,onChange:i,onEnd:r}){const s=Qa(t);let l={controlDirection:wT("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:p,boundaries:m,keepAspectRatio:g,resizeDirection:x,onResizeStart:v,onResize:E,onResizeEnd:A,shouldResize:C}){let w={...qR},k={...NX};l={boundaries:m,resizeDirection:x,keepAspectRatio:g,controlDirection:wT(p)};let N,D=null,H=[],z,F,ee,P=!1;const I=eR().on("start",V=>{const{nodeLookup:X,transform:ne,snapGrid:q,snapToGrid:Q,nodeOrigin:B,paneDomNode:Y}=n();if(N=X.get(e),!N)return;D=(Y==null?void 0:Y.getBoundingClientRect())??null;const{xSnapped:Z,ySnapped:$}=Sm(V.sourceEvent,{transform:ne,snapGrid:q,snapToGrid:Q,containerBounds:D});w={width:N.measured.width??0,height:N.measured.height??0,x:N.position.x??0,y:N.position.y??0},k={...w,pointerX:Z,pointerY:$,aspectRatio:w.width/w.height},z=void 0,N.parentId&&(N.extent==="parent"||N.expandParent)&&(z=X.get(N.parentId),F=z&&N.extent==="parent"?RX(z):void 0),H=[],ee=void 0;for(const[j,K]of X)if(K.parentId===e&&(H.push({id:j,position:{...K.position},extent:K.extent}),K.extent==="parent"||K.expandParent)){const te=kX(K,N,K.origin??B);ee?ee=[[Math.min(te[0][0],ee[0][0]),Math.min(te[0][1],ee[0][1])],[Math.max(te[1][0],ee[1][0]),Math.max(te[1][1],ee[1][1])]]:ee=te}v==null||v(V,{...w})}).on("drag",V=>{const{transform:X,snapGrid:ne,snapToGrid:q,nodeOrigin:Q}=n(),B=Sm(V.sourceEvent,{transform:X,snapGrid:ne,snapToGrid:q,containerBounds:D}),Y=[];if(!N)return;const{x:Z,y:$,width:j,height:K}=w,te={},U=N.origin??Q,{width:le,height:de,x:ge,y:se}=MX(k,l.controlDirection,B,l.boundaries,l.keepAspectRatio,U,F,ee),pe=le!==j,Ae=de!==K,Le=ge!==Z&&pe,Ge=se!==$&&Ae;if(!Le&&!Ge&&!pe&&!Ae)return;if((Le||Ge||U[0]===1||U[1]===1)&&(te.x=Le?ge:w.x,te.y=Ge?se:w.y,w.x=te.x,w.y=te.y,H.length>0)){const ut=ge-Z,Ue=se-$;for(const At of H)At.position={x:At.position.x-ut+U[0]*(le-j),y:At.position.y-Ue+U[1]*(de-K)},Y.push(At)}if((pe||Ae)&&(te.width=pe&&(!l.resizeDirection||l.resizeDirection==="horizontal")?le:w.width,te.height=Ae&&(!l.resizeDirection||l.resizeDirection==="vertical")?de:w.height,w.width=te.width,w.height=te.height),z&&N.expandParent){const ut=U[0]*(te.width??0);te.x&&te.x<ut&&(w.x=ut,k.x=k.x-(te.x-ut));const Ue=U[1]*(te.height??0);te.y&&te.y<Ue&&(w.y=Ue,k.y=k.y-(te.y-Ue))}const Pe=AX({width:w.width,prevWidth:j,height:w.height,prevHeight:K,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),Ie={...w,direction:Pe};(C==null?void 0:C(V,Ie))!==!1&&(P=!0,E==null||E(V,Ie),i(te,Y))}).on("end",V=>{P&&(A==null||A(V,{...w}),r==null||r({...w}),P=!1)});s.call(I)}function d(){s.on(".drag",null)}return{update:c,destroy:d}}var xv={exports:{}},vv={},_v={exports:{}},Sv={};/**
379
- * @license React
380
- * use-sync-external-store-shim.production.js
381
- *
382
- * Copyright (c) Meta Platforms, Inc. and affiliates.
383
- *
384
- * This source code is licensed under the MIT license found in the
385
- * LICENSE file in the root directory of this source tree.
386
- */var CT;function DX(){if(CT)return Sv;CT=1;var t=ph();function e(g,x){return g===x&&(g!==0||1/g===1/x)||g!==g&&x!==x}var n=typeof Object.is=="function"?Object.is:e,i=t.useState,r=t.useEffect,s=t.useLayoutEffect,l=t.useDebugValue;function c(g,x){var v=x(),E=i({inst:{value:v,getSnapshot:x}}),A=E[0].inst,C=E[1];return s(function(){A.value=v,A.getSnapshot=x,d(A)&&C({inst:A})},[g,v,x]),r(function(){return d(A)&&C({inst:A}),g(function(){d(A)&&C({inst:A})})},[g]),l(v),v}function d(g){var x=g.getSnapshot;g=g.value;try{var v=x();return!n(g,v)}catch{return!0}}function p(g,x){return x()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:c;return Sv.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:m,Sv}var AT;function zX(){return AT||(AT=1,_v.exports=DX()),_v.exports}/**
387
- * @license React
388
- * use-sync-external-store-shim/with-selector.production.js
389
- *
390
- * Copyright (c) Meta Platforms, Inc. and affiliates.
391
- *
392
- * This source code is licensed under the MIT license found in the
393
- * LICENSE file in the root directory of this source tree.
394
- */var MT;function BX(){if(MT)return vv;MT=1;var t=ph(),e=zX();function n(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var i=typeof Object.is=="function"?Object.is:n,r=e.useSyncExternalStore,s=t.useRef,l=t.useEffect,c=t.useMemo,d=t.useDebugValue;return vv.useSyncExternalStoreWithSelector=function(p,m,g,x,v){var E=s(null);if(E.current===null){var A={hasValue:!1,value:null};E.current=A}else A=E.current;E=c(function(){function w(z){if(!k){if(k=!0,N=z,z=x(z),v!==void 0&&A.hasValue){var F=A.value;if(v(F,z))return D=F}return D=z}if(F=D,i(N,z))return F;var ee=x(z);return v!==void 0&&v(F,ee)?(N=z,F):(N=z,D=ee)}var k=!1,N,D,H=g===void 0?null:g;return[function(){return w(m())},H===null?void 0:function(){return w(H())}]},[m,g,x,v]);var C=r(p,E[0],E[1]);return l(function(){A.hasValue=!0,A.value=C},[C]),d(C),C},vv}var NT;function LX(){return NT||(NT=1,xv.exports=BX()),xv.exports}var UX=LX();const IX=lu(UX),HX={},RT=t=>{let e;const n=new Set,i=(m,g)=>{const x=typeof m=="function"?m(e):m;if(!Object.is(x,e)){const v=e;e=g??(typeof x!="object"||x===null)?x:Object.assign({},e,x),n.forEach(E=>E(e,v))}},r=()=>e,d={setState:i,getState:r,getInitialState:()=>p,subscribe:m=>(n.add(m),()=>n.delete(m)),destroy:()=>{(HX?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},p=e=t(i,r,d);return d},jX=t=>t?RT(t):RT,{useDebugValue:PX}=sm,{useSyncExternalStoreWithSelector:GX}=IX,FX=t=>t;function YR(t,e=FX,n){const i=GX(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return PX(i),i}const kT=(t,e)=>{const n=jX(t),i=(r,s=e)=>YR(n,r,s);return Object.assign(i,n),i},qX=(t,e)=>t?kT(t,e):kT;function Zn(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[i,r]of t)if(!Object.is(r,e.get(i)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(e,i)||!Object.is(t[i],e[i]))return!1;return!0}const db=G.createContext(null),YX=db.Provider,VR=fo.error001();function Wt(t,e){const n=G.useContext(db);if(n===null)throw new Error(VR);return YR(n,t,e)}function $n(){const t=G.useContext(db);if(t===null)throw new Error(VR);return G.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const OT={display:"none"},VX={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},XR="react-flow__node-desc",KR="react-flow__edge-desc",XX="react-flow__aria-live",KX=t=>t.ariaLiveMessage,WX=t=>t.ariaLabelConfig;function ZX({rfId:t}){const e=Wt(KX);return R.jsx("div",{id:`${XX}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:VX,children:e})}function $X({rfId:t,disableKeyboardA11y:e}){const n=Wt(WX);return R.jsxs(R.Fragment,{children:[R.jsx("div",{id:`${XR}-${t}`,style:OT,children:e?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),R.jsx("div",{id:`${KR}-${t}`,style:OT,children:n["edge.a11yDescription.default"]}),!e&&R.jsx(ZX,{rfId:t})]})}const hb=G.forwardRef(({position:t="top-left",children:e,className:n,style:i,...r},s)=>{const l=`${t}`.split("-");return R.jsx("div",{className:Oi(["react-flow__panel",n,...l]),style:i,ref:s,...r,children:e})});hb.displayName="Panel";function QX({proOptions:t,position:e="bottom-right"}){return t!=null&&t.hideAttribution?null:R.jsx(hb,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:R.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const JX=t=>{const e=[],n=[];for(const[,i]of t.nodeLookup)i.selected&&e.push(i.internals.userNode);for(const[,i]of t.edgeLookup)i.selected&&n.push(i);return{selectedNodes:e,selectedEdges:n}},i0=t=>t.id;function eK(t,e){return Zn(t.selectedNodes.map(i0),e.selectedNodes.map(i0))&&Zn(t.selectedEdges.map(i0),e.selectedEdges.map(i0))}function tK({onSelectionChange:t}){const e=$n(),{selectedNodes:n,selectedEdges:i}=Wt(JX,eK);return G.useEffect(()=>{const r={nodes:n,edges:i};t==null||t(r),e.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,i,t]),null}const nK=t=>!!t.onSelectionChangeHandlers;function iK({onSelectionChange:t}){const e=Wt(nK);return t||e?R.jsx(tK,{onSelectionChange:t}):null}const WR=[0,0],rK={x:0,y:0,zoom:1},aK=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],DT=[...aK,"rfId"],sK=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),zT={translateExtent:Lm,nodeOrigin:WR,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function lK(t){const{setNodes:e,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:d}=Wt(sK,Zn),p=$n();G.useEffect(()=>(d(t.defaultNodes,t.defaultEdges),()=>{m.current=zT,c()}),[]);const m=G.useRef(zT);return G.useEffect(()=>{for(const g of DT){const x=t[g],v=m.current[g];x!==v&&(typeof t[g]>"u"||(g==="nodes"?e(x):g==="edges"?n(x):g==="minZoom"?i(x):g==="maxZoom"?r(x):g==="translateExtent"?s(x):g==="nodeExtent"?l(x):g==="ariaLabelConfig"?p.setState({ariaLabelConfig:qV(x)}):g==="fitView"?p.setState({fitViewQueued:x}):g==="fitViewOptions"?p.setState({fitViewOptions:x}):p.setState({[g]:x})))}m.current=t},DT.map(g=>t[g])),null}function BT(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function oK(t){var i;const[e,n]=G.useState(t==="system"?null:t);return G.useEffect(()=>{if(t!=="system"){n(t);return}const r=BT(),s=()=>n(r!=null&&r.matches?"dark":"light");return s(),r==null||r.addEventListener("change",s),()=>{r==null||r.removeEventListener("change",s)}},[t]),e!==null?e:(i=BT())!=null&&i.matches?"dark":"light"}const LT=typeof document<"u"?document:null;function jm(t=null,e={target:LT,actInsideInputWithModifier:!0}){const[n,i]=G.useState(!1),r=G.useRef(!1),s=G.useRef(new Set([])),[l,c]=G.useMemo(()=>{if(t!==null){const p=(Array.isArray(t)?t:[t]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
395
- `).replace(`
396
-
397
- `,`
398
- +`).split(`
399
- `)),m=p.reduce((g,x)=>g.concat(...x),[]);return[p,m]}return[[],[]]},[t]);return G.useEffect(()=>{const d=(e==null?void 0:e.target)??LT,p=(e==null?void 0:e.actInsideInputWithModifier)??!0;if(t!==null){const m=v=>{var C,w;if(r.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!r.current||r.current&&!p)&&MR(v))return!1;const A=IT(v.code,c);if(s.current.add(v[A]),UT(l,s.current,!1)){const k=((w=(C=v.composedPath)==null?void 0:C.call(v))==null?void 0:w[0])||v.target,N=(k==null?void 0:k.nodeName)==="BUTTON"||(k==null?void 0:k.nodeName)==="A";e.preventDefault!==!1&&(r.current||!N)&&v.preventDefault(),i(!0)}},g=v=>{const E=IT(v.code,c);UT(l,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(v[E]),v.key==="Meta"&&s.current.clear(),r.current=!1},x=()=>{s.current.clear(),i(!1)};return d==null||d.addEventListener("keydown",m),d==null||d.addEventListener("keyup",g),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{d==null||d.removeEventListener("keydown",m),d==null||d.removeEventListener("keyup",g),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[t,i]),n}function UT(t,e,n){return t.filter(i=>n||i.length===e.size).some(i=>i.every(r=>e.has(r)))}function IT(t,e){return e.includes(t)?"code":"key"}const cK=()=>{const t=$n();return G.useMemo(()=>({zoomIn:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomOut:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1/1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomTo:(e,n)=>{const{panZoom:i}=t.getState();return i?i.scaleTo(e,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(e,n)=>{const{transform:[i,r,s],panZoom:l}=t.getState();return l?(await l.setViewport({x:e.x??i,y:e.y??r,zoom:e.zoom??s},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[e,n,i]=t.getState().transform;return{x:e,y:n,zoom:i}},setCenter:async(e,n,i)=>t.getState().setCenter(e,n,i),fitBounds:async(e,n)=>{const{width:i,height:r,minZoom:s,maxZoom:l,panZoom:c}=t.getState(),d=R1(e,i,r,s,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(d,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(e,n={})=>{const{transform:i,snapGrid:r,snapToGrid:s,domNode:l}=t.getState();if(!l)return e;const{x:c,y:d}=l.getBoundingClientRect(),p={x:e.x-c,y:e.y-d},m=n.snapGrid??r,g=n.snapToGrid??s;return tg(p,i,g,m)},flowToScreenPosition:e=>{const{transform:n,domNode:i}=t.getState();if(!i)return e;const{x:r,y:s}=i.getBoundingClientRect(),l=j0(e,n);return{x:l.x+r,y:l.y+s}}}),[])};function ZR(t,e){const n=[],i=new Map,r=[];for(const s of t)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const l=i.get(s.id);l?l.push(s):i.set(s.id,[s])}for(const s of e){const l=i.get(s.id);if(!l){n.push(s);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...s};for(const d of l)uK(d,c);n.push(c)}return r.length&&r.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function uK(t,e){switch(t.type){case"select":{e.selected=t.selected;break}case"position":{typeof t.position<"u"&&(e.position=t.position),typeof t.dragging<"u"&&(e.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(e.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(e.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(e.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(e.resizing=t.resizing);break}}}function fK(t,e){return ZR(t,e)}function dK(t,e){return ZR(t,e)}function cf(t,e){return{id:t,type:"select",selected:e}}function Xd(t,e=new Set,n=!1){const i=[];for(const[r,s]of t){const l=e.has(r);!(s.selected===void 0&&!l)&&s.selected!==l&&(n&&(s.selected=l),i.push(cf(s.id,l)))}return i}function HT({items:t=[],lookup:e}){var r;const n=[],i=new Map(t.map(s=>[s.id,s]));for(const[s,l]of t.entries()){const c=e.get(l.id),d=((r=c==null?void 0:c.internals)==null?void 0:r.userNode)??c;d!==void 0&&d!==l&&n.push({id:l.id,item:l,type:"replace"}),d===void 0&&n.push({item:l,type:"add",index:s})}for(const[s]of e)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function jT(t){return{id:t.id,type:"remove"}}const PT=t=>zV(t),hK=t=>vR(t);function $R(t){return G.forwardRef(t)}const pK=typeof window<"u"?G.useLayoutEffect:G.useEffect;function GT(t){const[e,n]=G.useState(BigInt(0)),[i]=G.useState(()=>mK(()=>n(r=>r+BigInt(1))));return pK(()=>{const r=i.get();r.length&&(t(r),i.reset())},[e]),i}function mK(t){let e=[];return{get:()=>e,reset:()=>{e=[]},push:n=>{e.push(n),t()}}}const QR=G.createContext(null);function gK({children:t}){const e=$n(),n=G.useCallback(c=>{const{nodes:d=[],setNodes:p,hasDefaultNodes:m,onNodesChange:g,nodeLookup:x,fitViewQueued:v,onNodesChangeMiddlewareMap:E}=e.getState();let A=d;for(const w of c)A=typeof w=="function"?w(A):w;let C=HT({items:A,lookup:x});for(const w of E.values())C=w(C);m&&p(A),C.length>0?g==null||g(C):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:k,setNodes:N}=e.getState();w&&N(k)})},[]),i=GT(n),r=G.useCallback(c=>{const{edges:d=[],setEdges:p,hasDefaultEdges:m,onEdgesChange:g,edgeLookup:x}=e.getState();let v=d;for(const E of c)v=typeof E=="function"?E(v):E;m?p(v):g&&g(HT({items:v,lookup:x}))},[]),s=GT(r),l=G.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return R.jsx(QR.Provider,{value:l,children:t})}function yK(){const t=G.useContext(QR);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const bK=t=>!!t.panZoom;function pb(){const t=cK(),e=$n(),n=yK(),i=Wt(bK),r=G.useMemo(()=>{const s=g=>e.getState().nodeLookup.get(g),l=g=>{n.nodeQueue.push(g)},c=g=>{n.edgeQueue.push(g)},d=g=>{var w,k;const{nodeLookup:x,nodeOrigin:v}=e.getState(),E=PT(g)?g:x.get(g.id),A=E.parentId?CR(E.position,E.measured,E.parentId,x,v):E.position,C={...E,position:A,width:((w=E.measured)==null?void 0:w.width)??E.width,height:((k=E.measured)==null?void 0:k.height)??E.height};return fh(C)},p=(g,x,v={replace:!1})=>{l(E=>E.map(A=>{if(A.id===g){const C=typeof x=="function"?x(A):x;return v.replace&&PT(C)?C:{...A,...C}}return A}))},m=(g,x,v={replace:!1})=>{c(E=>E.map(A=>{if(A.id===g){const C=typeof x=="function"?x(A):x;return v.replace&&hK(C)?C:{...A,...C}}return A}))};return{getNodes:()=>e.getState().nodes.map(g=>({...g})),getNode:g=>{var x;return(x=s(g))==null?void 0:x.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:g=[]}=e.getState();return g.map(x=>({...x}))},getEdge:g=>e.getState().edgeLookup.get(g),setNodes:l,setEdges:c,addNodes:g=>{const x=Array.isArray(g)?g:[g];n.nodeQueue.push(v=>[...v,...x])},addEdges:g=>{const x=Array.isArray(g)?g:[g];n.edgeQueue.push(v=>[...v,...x])},toObject:()=>{const{nodes:g=[],edges:x=[],transform:v}=e.getState(),[E,A,C]=v;return{nodes:g.map(w=>({...w})),edges:x.map(w=>({...w})),viewport:{x:E,y:A,zoom:C}}},deleteElements:async({nodes:g=[],edges:x=[]})=>{const{nodes:v,edges:E,onNodesDelete:A,onEdgesDelete:C,triggerNodeChanges:w,triggerEdgeChanges:k,onDelete:N,onBeforeDelete:D}=e.getState(),{nodes:H,edges:z}=await HV({nodesToRemove:g,edgesToRemove:x,nodes:v,edges:E,onBeforeDelete:D}),F=z.length>0,ee=H.length>0;if(F){const P=z.map(jT);C==null||C(z),k(P)}if(ee){const P=H.map(jT);A==null||A(H),w(P)}return(ee||F)&&(N==null||N({nodes:H,edges:z})),{deletedNodes:H,deletedEdges:z}},getIntersectingNodes:(g,x=!0,v)=>{const E=hT(g),A=E?g:d(g),C=v!==void 0;return A?(v||e.getState().nodes).filter(w=>{const k=e.getState().nodeLookup.get(w.id);if(k&&!E&&(w.id===g.id||!k.internals.positionAbsolute))return!1;const N=fh(C?w:k),D=Im(N,A);return x&&D>0||D>=N.width*N.height||D>=A.width*A.height}):[]},isNodeIntersecting:(g,x,v=!0)=>{const A=hT(g)?g:d(g);if(!A)return!1;const C=Im(A,x);return v&&C>0||C>=x.width*x.height||C>=A.width*A.height},updateNode:p,updateNodeData:(g,x,v={replace:!1})=>{p(g,E=>{const A=typeof x=="function"?x(E):x;return v.replace?{...E,data:A}:{...E,data:{...E.data,...A}}},v)},updateEdge:m,updateEdgeData:(g,x,v={replace:!1})=>{m(g,E=>{const A=typeof x=="function"?x(E):x;return v.replace?{...E,data:A}:{...E,data:{...E.data,...A}}},v)},getNodesBounds:g=>{const{nodeLookup:x,nodeOrigin:v}=e.getState();return BV(g,{nodeLookup:x,nodeOrigin:v})},getHandleConnections:({type:g,id:x,nodeId:v})=>{var E;return Array.from(((E=e.getState().connectionLookup.get(`${v}-${g}${x?`-${x}`:""}`))==null?void 0:E.values())??[])},getNodeConnections:({type:g,handleId:x,nodeId:v})=>{var E;return Array.from(((E=e.getState().connectionLookup.get(`${v}${g?x?`-${g}-${x}`:`-${g}`:""}`))==null?void 0:E.values())??[])},fitView:async g=>{const x=e.getState().fitViewResolver??FV();return e.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:x}),n.nodeQueue.push(v=>[...v]),x.promise}}},[]);return G.useMemo(()=>({...r,...t,viewportInitialized:i}),[i])}const FT=t=>t.selected,xK=typeof window<"u"?window:void 0;function vK({deleteKeyCode:t,multiSelectionKeyCode:e}){const n=$n(),{deleteElements:i}=pb(),r=jm(t,{actInsideInputWithModifier:!1}),s=jm(e,{target:xK});G.useEffect(()=>{if(r){const{edges:l,nodes:c}=n.getState();i({nodes:c.filter(FT),edges:l.filter(FT)}),n.setState({nodesSelectionActive:!1})}},[r]),G.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function _K(t){const e=$n();G.useEffect(()=>{const n=()=>{var r,s,l,c;if(!t.current||!(((s=(r=t.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=k1(t.current);(i.height===0||i.width===0)&&((c=(l=e.getState()).onError)==null||c.call(l,"004",fo.error004())),e.setState({width:i.width||500,height:i.height||500})};if(t.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(t.current),()=>{window.removeEventListener("resize",n),i&&t.current&&i.unobserve(t.current)}}},[])}const mb={position:"absolute",width:"100%",height:"100%",top:0,left:0},SK=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function EK({onPaneContextMenu:t,zoomOnScroll:e=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=pf.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:d,translateExtent:p,minZoom:m,maxZoom:g,zoomActivationKeyCode:x,preventScrolling:v=!0,children:E,noWheelClassName:A,noPanClassName:C,onViewportChange:w,isControlledViewport:k,paneClickDistance:N,selectionOnDrag:D}){const H=$n(),z=G.useRef(null),{userSelectionActive:F,lib:ee,connectionInProgress:P}=Wt(SK,Zn),I=jm(x),V=G.useRef();_K(z);const X=G.useCallback(ne=>{w==null||w({x:ne[0],y:ne[1],zoom:ne[2]}),k||H.setState({transform:ne})},[w,k]);return G.useEffect(()=>{if(z.current){V.current=CX({domNode:z.current,minZoom:m,maxZoom:g,translateExtent:p,viewport:d,onDraggingChange:B=>H.setState(Y=>Y.paneDragging===B?Y:{paneDragging:B}),onPanZoomStart:(B,Y)=>{const{onViewportChangeStart:Z,onMoveStart:$}=H.getState();$==null||$(B,Y),Z==null||Z(Y)},onPanZoom:(B,Y)=>{const{onViewportChange:Z,onMove:$}=H.getState();$==null||$(B,Y),Z==null||Z(Y)},onPanZoomEnd:(B,Y)=>{const{onViewportChangeEnd:Z,onMoveEnd:$}=H.getState();$==null||$(B,Y),Z==null||Z(Y)}});const{x:ne,y:q,zoom:Q}=V.current.getViewport();return H.setState({panZoom:V.current,transform:[ne,q,Q],domNode:z.current.closest(".react-flow")}),()=>{var B;(B=V.current)==null||B.destroy()}}},[]),G.useEffect(()=>{var ne;(ne=V.current)==null||ne.update({onPaneContextMenu:t,zoomOnScroll:e,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:I,preventScrolling:v,noPanClassName:C,userSelectionActive:F,noWheelClassName:A,lib:ee,onTransformChange:X,connectionInProgress:P,selectionOnDrag:D,paneClickDistance:N})},[t,e,n,i,r,s,l,c,I,v,C,F,A,ee,X,P,D,N]),R.jsx("div",{className:"react-flow__renderer",ref:z,style:mb,children:E})}const wK=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function TK(){const{userSelectionActive:t,userSelectionRect:e}=Wt(wK,Zn);return t&&e?R.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const Ev=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},CK=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function AK({isSelecting:t,selectionKeyPressed:e,selectionMode:n=Um.Full,panOnDrag:i,paneClickDistance:r,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:c,onPaneClick:d,onPaneContextMenu:p,onPaneScroll:m,onPaneMouseEnter:g,onPaneMouseMove:x,onPaneMouseLeave:v,children:E}){const A=$n(),{userSelectionActive:C,elementsSelectable:w,dragging:k,connectionInProgress:N}=Wt(CK,Zn),D=w&&(t||C),H=G.useRef(null),z=G.useRef(),F=G.useRef(new Set),ee=G.useRef(new Set),P=G.useRef(!1),I=Z=>{if(P.current||N){P.current=!1;return}d==null||d(Z),A.getState().resetSelectedElements(),A.setState({nodesSelectionActive:!1})},V=Z=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){Z.preventDefault();return}p==null||p(Z)},X=m?Z=>m(Z):void 0,ne=Z=>{P.current&&(Z.stopPropagation(),P.current=!1)},q=Z=>{var de,ge;const{domNode:$}=A.getState();if(z.current=$==null?void 0:$.getBoundingClientRect(),!z.current)return;const j=Z.target===H.current;if(!j&&!!Z.target.closest(".nokey")||!t||!(s&&j||e)||Z.button!==0||!Z.isPrimary)return;(ge=(de=Z.target)==null?void 0:de.setPointerCapture)==null||ge.call(de,Z.pointerId),P.current=!1;const{x:U,y:le}=ml(Z.nativeEvent,z.current);A.setState({userSelectionRect:{width:0,height:0,startX:U,startY:le,x:U,y:le}}),j||(Z.stopPropagation(),Z.preventDefault())},Q=Z=>{const{userSelectionRect:$,transform:j,nodeLookup:K,edgeLookup:te,connectionLookup:U,triggerNodeChanges:le,triggerEdgeChanges:de,defaultEdgeOptions:ge,resetSelectedElements:se}=A.getState();if(!z.current||!$)return;const{x:pe,y:Ae}=ml(Z.nativeEvent,z.current),{startX:Le,startY:Ge}=$;if(!P.current){const Ue=e?0:r;if(Math.hypot(pe-Le,Ae-Ge)<=Ue)return;se(),l==null||l(Z)}P.current=!0;const Pe={startX:Le,startY:Ge,x:pe<Le?pe:Le,y:Ae<Ge?Ae:Ge,width:Math.abs(pe-Le),height:Math.abs(Ae-Ge)},Ie=F.current,We=ee.current;F.current=new Set(N1(K,Pe,j,n===Um.Partial,!0).map(Ue=>Ue.id)),ee.current=new Set;const ut=(ge==null?void 0:ge.selectable)??!0;for(const Ue of F.current){const At=U.get(Ue);if(At)for(const{edgeId:zn}of At.values()){const Bn=te.get(zn);Bn&&(Bn.selectable??ut)&&ee.current.add(zn)}}if(!pT(Ie,F.current)){const Ue=Xd(K,F.current,!0);le(Ue)}if(!pT(We,ee.current)){const Ue=Xd(te,ee.current);de(Ue)}A.setState({userSelectionRect:Pe,userSelectionActive:!0,nodesSelectionActive:!1})},B=Z=>{var $,j;Z.button===0&&((j=($=Z.target)==null?void 0:$.releasePointerCapture)==null||j.call($,Z.pointerId),!C&&Z.target===H.current&&A.getState().userSelectionRect&&(I==null||I(Z)),A.setState({userSelectionActive:!1,userSelectionRect:null}),P.current&&(c==null||c(Z),A.setState({nodesSelectionActive:F.current.size>0})))},Y=i===!0||Array.isArray(i)&&i.includes(0);return R.jsxs("div",{className:Oi(["react-flow__pane",{draggable:Y,dragging:k,selection:t}]),onClick:D?void 0:Ev(I,H),onContextMenu:Ev(V,H),onWheel:Ev(X,H),onPointerEnter:D?void 0:g,onPointerMove:D?Q:x,onPointerUp:D?B:void 0,onPointerDownCapture:D?q:void 0,onClickCapture:D?ne:void 0,onPointerLeave:v,ref:H,style:mb,children:[E,R.jsx(TK,{})]})}function M_({id:t,store:e,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:l,nodeLookup:c,onError:d}=e.getState(),p=c.get(t);if(!p){d==null||d("012",fo.error012(t));return}e.setState({nodesSelectionActive:!1}),p.selected?(n||p.selected&&l)&&(s({nodes:[p],edges:[]}),requestAnimationFrame(()=>{var m;return(m=i==null?void 0:i.current)==null?void 0:m.blur()})):r([t])}function JR({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:l}){const c=$n(),[d,p]=G.useState(!1),m=G.useRef();return G.useEffect(()=>{m.current=dX({getStoreItems:()=>c.getState(),onNodeMouseDown:g=>{M_({id:g,store:c,nodeRef:t})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),G.useEffect(()=>{if(!(e||!t.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:i,domNode:t.current,isSelectable:s,nodeId:r,nodeClickDistance:l}),()=>{var g;(g=m.current)==null||g.destroy()}},[n,i,e,s,t,r,l]),d}const MK=t=>e=>e.selected&&(e.draggable||t&&typeof e.draggable>"u");function ek(){const t=$n();return G.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:l,onError:c,updateNodePositions:d,nodeLookup:p,nodeOrigin:m}=t.getState(),g=new Map,x=MK(l),v=r?s[0]:5,E=r?s[1]:5,A=n.direction.x*v*n.factor,C=n.direction.y*E*n.factor;for(const[,w]of p){if(!x(w))continue;let k={x:w.internals.positionAbsolute.x+A,y:w.internals.positionAbsolute.y+C};r&&(k=eg(k,s));const{position:N,positionAbsolute:D}=_R({nodeId:w.id,nextPosition:k,nodeLookup:p,nodeExtent:i,nodeOrigin:m,onError:c});w.position=N,w.internals.positionAbsolute=D,g.set(w.id,w)}d(g)},[])}const U1=G.createContext(null),NK=U1.Provider;U1.Consumer;const tk=()=>G.useContext(U1),RK=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),kK=(t,e,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:l}=i,{fromHandle:c,toHandle:d,isValid:p}=l,m=(d==null?void 0:d.nodeId)===t&&(d==null?void 0:d.id)===e&&(d==null?void 0:d.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===t&&(c==null?void 0:c.id)===e&&(c==null?void 0:c.type)===n,connectingTo:m,clickConnecting:(r==null?void 0:r.nodeId)===t&&(r==null?void 0:r.id)===e&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===ch.Strict?(c==null?void 0:c.type)!==n:t!==(c==null?void 0:c.nodeId)||e!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!r,valid:m&&p}};function OK({type:t="source",position:e=Qe.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:l,onConnect:c,children:d,className:p,onMouseDown:m,onTouchStart:g,...x},v){var Q,B;const E=l||null,A=t==="target",C=$n(),w=tk(),{connectOnClick:k,noPanClassName:N,rfId:D}=Wt(RK,Zn),{connectingFrom:H,connectingTo:z,clickConnecting:F,isPossibleEndHandle:ee,connectionInProcess:P,clickConnectionInProcess:I,valid:V}=Wt(kK(w,E,t),Zn);w||(B=(Q=C.getState()).onError)==null||B.call(Q,"010",fo.error010());const X=Y=>{const{defaultEdgeOptions:Z,onConnect:$,hasDefaultEdges:j}=C.getState(),K={...Z,...Y};if(j){const{edges:te,setEdges:U}=C.getState();U(ZV(K,te))}$==null||$(K),c==null||c(K)},ne=Y=>{if(!w)return;const Z=NR(Y.nativeEvent);if(r&&(Z&&Y.button===0||!Z)){const $=C.getState();A_.onPointerDown(Y.nativeEvent,{handleDomNode:Y.currentTarget,autoPanOnConnect:$.autoPanOnConnect,connectionMode:$.connectionMode,connectionRadius:$.connectionRadius,domNode:$.domNode,nodeLookup:$.nodeLookup,lib:$.lib,isTarget:A,handleId:E,nodeId:w,flowId:$.rfId,panBy:$.panBy,cancelConnection:$.cancelConnection,onConnectStart:$.onConnectStart,onConnectEnd:(...j)=>{var K,te;return(te=(K=C.getState()).onConnectEnd)==null?void 0:te.call(K,...j)},updateConnection:$.updateConnection,onConnect:X,isValidConnection:n||((...j)=>{var K,te;return((te=(K=C.getState()).isValidConnection)==null?void 0:te.call(K,...j))??!0}),getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,autoPanSpeed:$.autoPanSpeed,dragThreshold:$.connectionDragThreshold})}Z?m==null||m(Y):g==null||g(Y)},q=Y=>{const{onClickConnectStart:Z,onClickConnectEnd:$,connectionClickStartHandle:j,connectionMode:K,isValidConnection:te,lib:U,rfId:le,nodeLookup:de,connection:ge}=C.getState();if(!w||!j&&!r)return;if(!j){Z==null||Z(Y.nativeEvent,{nodeId:w,handleId:E,handleType:t}),C.setState({connectionClickStartHandle:{nodeId:w,type:t,id:E}});return}const se=AR(Y.target),pe=n||te,{connection:Ae,isValid:Le}=A_.isValid(Y.nativeEvent,{handle:{nodeId:w,id:E,type:t},connectionMode:K,fromNodeId:j.nodeId,fromHandleId:j.id||null,fromType:j.type,isValidConnection:pe,flowId:le,doc:se,lib:U,nodeLookup:de});Le&&Ae&&X(Ae);const Ge=structuredClone(ge);delete Ge.inProgress,Ge.toPosition=Ge.toHandle?Ge.toHandle.position:null,$==null||$(Y,Ge),C.setState({connectionClickStartHandle:null})};return R.jsx("div",{"data-handleid":E,"data-nodeid":w,"data-handlepos":e,"data-id":`${D}-${w}-${E}-${t}`,className:Oi(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",N,p,{source:!A,target:A,connectable:i,connectablestart:r,connectableend:s,clickconnecting:F,connectingfrom:H,connectingto:z,valid:V,connectionindicator:i&&(!P||ee)&&(P||I?s:r)}]),onMouseDown:ne,onTouchStart:ne,onClick:k?q:void 0,ref:v,...x,children:d})}const su=G.memo($R(OK));function DK({data:t,isConnectable:e,sourcePosition:n=Qe.Bottom}){return R.jsxs(R.Fragment,{children:[t==null?void 0:t.label,R.jsx(su,{type:"source",position:n,isConnectable:e})]})}function zK({data:t,isConnectable:e,targetPosition:n=Qe.Top,sourcePosition:i=Qe.Bottom}){return R.jsxs(R.Fragment,{children:[R.jsx(su,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,R.jsx(su,{type:"source",position:i,isConnectable:e})]})}function BK(){return null}function LK({data:t,isConnectable:e,targetPosition:n=Qe.Top}){return R.jsxs(R.Fragment,{children:[R.jsx(su,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label]})}const P0={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},qT={input:DK,default:zK,output:LK,group:BK};function UK(t){var e,n,i,r;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((e=t.style)==null?void 0:e.width),height:t.height??t.initialHeight??((n=t.style)==null?void 0:n.height)}:{width:t.width??((i=t.style)==null?void 0:i.width),height:t.height??((r=t.style)==null?void 0:r.height)}}const IK=t=>{const{width:e,height:n,x:i,y:r}=Jm(t.nodeLookup,{filter:s=>!!s.selected});return{width:pl(e)?e:null,height:pl(n)?n:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${i}px,${r}px)`}};function HK({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const i=$n(),{width:r,height:s,transformString:l,userSelectionActive:c}=Wt(IK,Zn),d=ek(),p=G.useRef(null);G.useEffect(()=>{var v;n||(v=p.current)==null||v.focus({preventScroll:!0})},[n]);const m=!c&&r!==null&&s!==null;if(JR({nodeRef:p,disabled:!m}),!m)return null;const g=t?v=>{const E=i.getState().nodes.filter(A=>A.selected);t(v,E)}:void 0,x=v=>{Object.prototype.hasOwnProperty.call(P0,v.key)&&(v.preventDefault(),d({direction:P0[v.key],factor:v.shiftKey?4:1}))};return R.jsx("div",{className:Oi(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l},children:R.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:x,style:{width:r,height:s}})})}const YT=typeof window<"u"?window:void 0,jK=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function nk({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:d,selectionKeyCode:p,selectionOnDrag:m,selectionMode:g,onSelectionStart:x,onSelectionEnd:v,multiSelectionKeyCode:E,panActivationKeyCode:A,zoomActivationKeyCode:C,elementsSelectable:w,zoomOnScroll:k,zoomOnPinch:N,panOnScroll:D,panOnScrollSpeed:H,panOnScrollMode:z,zoomOnDoubleClick:F,panOnDrag:ee,defaultViewport:P,translateExtent:I,minZoom:V,maxZoom:X,preventScrolling:ne,onSelectionContextMenu:q,noWheelClassName:Q,noPanClassName:B,disableKeyboardA11y:Y,onViewportChange:Z,isControlledViewport:$}){const{nodesSelectionActive:j,userSelectionActive:K}=Wt(jK,Zn),te=jm(p,{target:YT}),U=jm(A,{target:YT}),le=U||ee,de=U||D,ge=m&&le!==!0,se=te||K||ge;return vK({deleteKeyCode:d,multiSelectionKeyCode:E}),R.jsx(EK,{onPaneContextMenu:s,elementsSelectable:w,zoomOnScroll:k,zoomOnPinch:N,panOnScroll:de,panOnScrollSpeed:H,panOnScrollMode:z,zoomOnDoubleClick:F,panOnDrag:!te&&le,defaultViewport:P,translateExtent:I,minZoom:V,maxZoom:X,zoomActivationKeyCode:C,preventScrolling:ne,noWheelClassName:Q,noPanClassName:B,onViewportChange:Z,isControlledViewport:$,paneClickDistance:c,selectionOnDrag:ge,children:R.jsxs(AK,{onSelectionStart:x,onSelectionEnd:v,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:le,isSelecting:!!se,selectionMode:g,selectionKeyPressed:te,paneClickDistance:c,selectionOnDrag:ge,children:[t,j&&R.jsx(HK,{onSelectionContextMenu:q,noPanClassName:B,disableKeyboardA11y:Y})]})})}nk.displayName="FlowRenderer";const PK=G.memo(nk),GK=t=>e=>t?N1(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(n=>n.id):Array.from(e.nodeLookup.keys());function FK(t){return Wt(G.useCallback(GK(t),[t]),Zn)}const qK=t=>t.updateNodeInternals;function YK(){const t=Wt(qK),[e]=G.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const s=r.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:r.target,force:!0})}),t(i)}));return G.useEffect(()=>()=>{e==null||e.disconnect()},[e]),e}function VK({node:t,nodeType:e,hasDimensions:n,resizeObserver:i}){const r=$n(),s=G.useRef(null),l=G.useRef(null),c=G.useRef(t.sourcePosition),d=G.useRef(t.targetPosition),p=G.useRef(e),m=n&&!!t.internals.handleBounds;return G.useEffect(()=>{s.current&&!t.hidden&&(!m||l.current!==s.current)&&(l.current&&(i==null||i.unobserve(l.current)),i==null||i.observe(s.current),l.current=s.current)},[m,t.hidden]),G.useEffect(()=>()=>{l.current&&(i==null||i.unobserve(l.current),l.current=null)},[]),G.useEffect(()=>{if(s.current){const g=p.current!==e,x=c.current!==t.sourcePosition,v=d.current!==t.targetPosition;(g||x||v)&&(p.current=e,c.current=t.sourcePosition,d.current=t.targetPosition,r.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:s.current,force:!0}]])))}},[t.id,e,t.sourcePosition,t.targetPosition]),s}function XK({id:t,onClick:e,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:l,nodesDraggable:c,elementsSelectable:d,nodesConnectable:p,nodesFocusable:m,resizeObserver:g,noDragClassName:x,noPanClassName:v,disableKeyboardA11y:E,rfId:A,nodeTypes:C,nodeClickDistance:w,onError:k}){const{node:N,internals:D,isParent:H}=Wt(pe=>{const Ae=pe.nodeLookup.get(t),Le=pe.parentLookup.has(t);return{node:Ae,internals:Ae.internals,isParent:Le}},Zn);let z=N.type||"default",F=(C==null?void 0:C[z])||qT[z];F===void 0&&(k==null||k("003",fo.error003(z)),z="default",F=(C==null?void 0:C.default)||qT.default);const ee=!!(N.draggable||c&&typeof N.draggable>"u"),P=!!(N.selectable||d&&typeof N.selectable>"u"),I=!!(N.connectable||p&&typeof N.connectable>"u"),V=!!(N.focusable||m&&typeof N.focusable>"u"),X=$n(),ne=TR(N),q=VK({node:N,nodeType:z,hasDimensions:ne,resizeObserver:g}),Q=JR({nodeRef:q,disabled:N.hidden||!ee,noDragClassName:x,handleSelector:N.dragHandle,nodeId:t,isSelectable:P,nodeClickDistance:w}),B=ek();if(N.hidden)return null;const Y=lc(N),Z=UK(N),$=P||ee||e||n||i||r,j=n?pe=>n(pe,{...D.userNode}):void 0,K=i?pe=>i(pe,{...D.userNode}):void 0,te=r?pe=>r(pe,{...D.userNode}):void 0,U=s?pe=>s(pe,{...D.userNode}):void 0,le=l?pe=>l(pe,{...D.userNode}):void 0,de=pe=>{const{selectNodesOnDrag:Ae,nodeDragThreshold:Le}=X.getState();P&&(!Ae||!ee||Le>0)&&M_({id:t,store:X,nodeRef:q}),e&&e(pe,{...D.userNode})},ge=pe=>{if(!(MR(pe.nativeEvent)||E)){if(gR.includes(pe.key)&&P){const Ae=pe.key==="Escape";M_({id:t,store:X,unselect:Ae,nodeRef:q})}else if(ee&&N.selected&&Object.prototype.hasOwnProperty.call(P0,pe.key)){pe.preventDefault();const{ariaLabelConfig:Ae}=X.getState();X.setState({ariaLiveMessage:Ae["node.a11yDescription.ariaLiveMessage"]({direction:pe.key.replace("Arrow","").toLowerCase(),x:~~D.positionAbsolute.x,y:~~D.positionAbsolute.y})}),B({direction:P0[pe.key],factor:pe.shiftKey?4:1})}}},se=()=>{var We;if(E||!((We=q.current)!=null&&We.matches(":focus-visible")))return;const{transform:pe,width:Ae,height:Le,autoPanOnNodeFocus:Ge,setCenter:Pe}=X.getState();if(!Ge)return;N1(new Map([[t,N]]),{x:0,y:0,width:Ae,height:Le},pe,!0).length>0||Pe(N.position.x+Y.width/2,N.position.y+Y.height/2,{zoom:pe[2]})};return R.jsx("div",{className:Oi(["react-flow__node",`react-flow__node-${z}`,{[v]:ee},N.className,{selected:N.selected,selectable:P,parent:H,draggable:ee,dragging:Q}]),ref:q,style:{zIndex:D.z,transform:`translate(${D.positionAbsolute.x}px,${D.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:ne?"visible":"hidden",...N.style,...Z},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:j,onMouseMove:K,onMouseLeave:te,onContextMenu:U,onClick:de,onDoubleClick:le,onKeyDown:V?ge:void 0,tabIndex:V?0:void 0,onFocus:V?se:void 0,role:N.ariaRole??(V?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${XR}-${A}`,"aria-label":N.ariaLabel,...N.domAttributes,children:R.jsx(NK,{value:t,children:R.jsx(F,{id:t,data:N.data,type:z,positionAbsoluteX:D.positionAbsolute.x,positionAbsoluteY:D.positionAbsolute.y,selected:N.selected??!1,selectable:P,draggable:ee,deletable:N.deletable??!0,isConnectable:I,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:Q,dragHandle:N.dragHandle,zIndex:D.z,parentId:N.parentId,...Y})})})}var KK=G.memo(XK);const WK=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function ik(t){const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=Wt(WK,Zn),l=FK(t.onlyRenderVisibleElements),c=YK();return R.jsx("div",{className:"react-flow__nodes",style:mb,children:l.map(d=>R.jsx(KK,{id:d,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:c,nodesDraggable:e,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,nodeClickDistance:t.nodeClickDistance,onError:s},d))})}ik.displayName="NodeRenderer";const ZK=G.memo(ik);function $K(t){return Wt(G.useCallback(n=>{if(!t)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),l=n.nodeLookup.get(r.target);s&&l&&XV({sourceNode:s,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[t]),Zn)}const QK=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t}};return R.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},JK=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t,fill:t}};return R.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},VT={[I0.Arrow]:QK,[I0.ArrowClosed]:JK};function eW(t){const e=$n();return G.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(VT,t)?VT[t]:((s=(r=e.getState()).onError)==null||s.call(r,"009",fo.error009(t)),null)},[t])}const tW=({id:t,type:e,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const d=eW(e);return d?R.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0",children:R.jsx(d,{color:n,strokeWidth:l})}):null},rk=({defaultColor:t,rfId:e})=>{const n=Wt(s=>s.edges),i=Wt(s=>s.defaultEdgeOptions),r=G.useMemo(()=>tX(n,{id:e,defaultColor:t,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,e,t]);return r.length?R.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:R.jsx("defs",{children:r.map(s=>R.jsx(tW,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};rk.displayName="MarkerDefinitions";var nW=G.memo(rk);function ak({x:t,y:e,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:d,className:p,...m}){const[g,x]=G.useState({x:1,y:0,width:0,height:0}),v=Oi(["react-flow__edge-textwrapper",p]),E=G.useRef(null);return G.useEffect(()=>{if(E.current){const A=E.current.getBBox();x({x:A.x,y:A.y,width:A.width,height:A.height})}},[n]),n?R.jsxs("g",{transform:`translate(${t-g.width/2} ${e-g.height/2})`,className:v,visibility:g.width?"visible":"hidden",...m,children:[r&&R.jsx("rect",{width:g.width+2*l[0],x:-l[0],y:-l[1],height:g.height+2*l[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),R.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:E,style:i,children:n}),d]}):null}ak.displayName="EdgeText";const iW=G.memo(ak);function gb({path:t,labelX:e,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,interactionWidth:p=20,...m}){return R.jsxs(R.Fragment,{children:[R.jsx("path",{...m,d:t,fill:"none",className:Oi(["react-flow__edge-path",m.className])}),p?R.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,i&&pl(e)&&pl(n)?R.jsx(iW,{x:e,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d}):null]})}function XT({pos:t,x1:e,y1:n,x2:i,y2:r}){return t===Qe.Left||t===Qe.Right?[.5*(e+i),n]:[e,.5*(n+r)]}function sk({sourceX:t,sourceY:e,sourcePosition:n=Qe.Bottom,targetX:i,targetY:r,targetPosition:s=Qe.Top}){const[l,c]=XT({pos:n,x1:t,y1:e,x2:i,y2:r}),[d,p]=XT({pos:s,x1:i,y1:r,x2:t,y2:e}),[m,g,x,v]=RR({sourceX:t,sourceY:e,targetX:i,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:p});return[`M${t},${e} C${l},${c} ${d},${p} ${i},${r}`,m,g,x,v]}function lk(t){return G.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:l,targetPosition:c,label:d,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:v,style:E,markerEnd:A,markerStart:C,interactionWidth:w})=>{const[k,N,D]=sk({sourceX:n,sourceY:i,sourcePosition:l,targetX:r,targetY:s,targetPosition:c}),H=t.isInternal?void 0:e;return R.jsx(gb,{id:H,path:k,labelX:N,labelY:D,label:d,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:v,style:E,markerEnd:A,markerStart:C,interactionWidth:w})})}const rW=lk({isInternal:!1}),ok=lk({isInternal:!0});rW.displayName="SimpleBezierEdge";ok.displayName="SimpleBezierEdgeInternal";function ck(t){return G.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,sourcePosition:v=Qe.Bottom,targetPosition:E=Qe.Top,markerEnd:A,markerStart:C,pathOptions:w,interactionWidth:k})=>{const[N,D,H]=w_({sourceX:n,sourceY:i,sourcePosition:v,targetX:r,targetY:s,targetPosition:E,borderRadius:w==null?void 0:w.borderRadius,offset:w==null?void 0:w.offset,stepPosition:w==null?void 0:w.stepPosition}),z=t.isInternal?void 0:e;return R.jsx(gb,{id:z,path:N,labelX:D,labelY:H,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:A,markerStart:C,interactionWidth:k})})}const uk=ck({isInternal:!1}),fk=ck({isInternal:!0});uk.displayName="SmoothStepEdge";fk.displayName="SmoothStepEdgeInternal";function dk(t){return G.memo(({id:e,...n})=>{var r;const i=t.isInternal?void 0:e;return R.jsx(uk,{...n,id:i,pathOptions:G.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const aW=dk({isInternal:!1}),hk=dk({isInternal:!0});aW.displayName="StepEdge";hk.displayName="StepEdgeInternal";function pk(t){return G.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:v,markerStart:E,interactionWidth:A})=>{const[C,w,k]=DR({sourceX:n,sourceY:i,targetX:r,targetY:s}),N=t.isInternal?void 0:e;return R.jsx(gb,{id:N,path:C,labelX:w,labelY:k,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:v,markerStart:E,interactionWidth:A})})}const sW=pk({isInternal:!1}),mk=pk({isInternal:!0});sW.displayName="StraightEdge";mk.displayName="StraightEdgeInternal";function gk(t){return G.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:l=Qe.Bottom,targetPosition:c=Qe.Top,label:d,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:v,style:E,markerEnd:A,markerStart:C,pathOptions:w,interactionWidth:k})=>{const[N,D,H]=kR({sourceX:n,sourceY:i,sourcePosition:l,targetX:r,targetY:s,targetPosition:c,curvature:w==null?void 0:w.curvature}),z=t.isInternal?void 0:e;return R.jsx(gb,{id:z,path:N,labelX:D,labelY:H,label:d,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:v,style:E,markerEnd:A,markerStart:C,interactionWidth:k})})}const lW=gk({isInternal:!1}),yk=gk({isInternal:!0});lW.displayName="BezierEdge";yk.displayName="BezierEdgeInternal";const KT={default:yk,straight:mk,step:hk,smoothstep:fk,simplebezier:ok},WT={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},oW=(t,e,n)=>n===Qe.Left?t-e:n===Qe.Right?t+e:t,cW=(t,e,n)=>n===Qe.Top?t-e:n===Qe.Bottom?t+e:t,ZT="react-flow__edgeupdater";function $T({position:t,centerX:e,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:l,type:c}){return R.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:l,className:Oi([ZT,`${ZT}-${c}`]),cx:oW(e,i,t),cy:cW(n,i,t),r:i,stroke:"transparent",fill:"transparent"})}function uW({isReconnectable:t,reconnectRadius:e,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:l,sourcePosition:c,targetPosition:d,onReconnect:p,onReconnectStart:m,onReconnectEnd:g,setReconnecting:x,setUpdateHover:v}){const E=$n(),A=(D,H)=>{if(D.button!==0)return;const{autoPanOnConnect:z,domNode:F,connectionMode:ee,connectionRadius:P,lib:I,onConnectStart:V,cancelConnection:X,nodeLookup:ne,rfId:q,panBy:Q,updateConnection:B}=E.getState(),Y=H.type==="target",Z=(K,te)=>{x(!1),g==null||g(K,n,H.type,te)},$=K=>p==null?void 0:p(n,K),j=(K,te)=>{x(!0),m==null||m(D,n,H.type),V==null||V(K,te)};A_.onPointerDown(D.nativeEvent,{autoPanOnConnect:z,connectionMode:ee,connectionRadius:P,domNode:F,handleId:H.id,nodeId:H.nodeId,nodeLookup:ne,isTarget:Y,edgeUpdaterType:H.type,lib:I,flowId:q,cancelConnection:X,panBy:Q,isValidConnection:(...K)=>{var te,U;return((U=(te=E.getState()).isValidConnection)==null?void 0:U.call(te,...K))??!0},onConnect:$,onConnectStart:j,onConnectEnd:(...K)=>{var te,U;return(U=(te=E.getState()).onConnectEnd)==null?void 0:U.call(te,...K)},onReconnectEnd:Z,updateConnection:B,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:D.currentTarget})},C=D=>A(D,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),w=D=>A(D,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),k=()=>v(!0),N=()=>v(!1);return R.jsxs(R.Fragment,{children:[(t===!0||t==="source")&&R.jsx($T,{position:c,centerX:i,centerY:r,radius:e,onMouseDown:C,onMouseEnter:k,onMouseOut:N,type:"source"}),(t===!0||t==="target")&&R.jsx($T,{position:d,centerX:s,centerY:l,radius:e,onMouseDown:w,onMouseEnter:k,onMouseOut:N,type:"target"})]})}function fW({id:t,edgesFocusable:e,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:l,onMouseEnter:c,onMouseMove:d,onMouseLeave:p,reconnectRadius:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:v,rfId:E,edgeTypes:A,noPanClassName:C,onError:w,disableKeyboardA11y:k}){let N=Wt(Pe=>Pe.edgeLookup.get(t));const D=Wt(Pe=>Pe.defaultEdgeOptions);N=D?{...D,...N}:N;let H=N.type||"default",z=(A==null?void 0:A[H])||KT[H];z===void 0&&(w==null||w("011",fo.error011(H)),H="default",z=(A==null?void 0:A.default)||KT.default);const F=!!(N.focusable||e&&typeof N.focusable>"u"),ee=typeof g<"u"&&(N.reconnectable||n&&typeof N.reconnectable>"u"),P=!!(N.selectable||i&&typeof N.selectable>"u"),I=G.useRef(null),[V,X]=G.useState(!1),[ne,q]=G.useState(!1),Q=$n(),{zIndex:B,sourceX:Y,sourceY:Z,targetX:$,targetY:j,sourcePosition:K,targetPosition:te}=Wt(G.useCallback(Pe=>{const Ie=Pe.nodeLookup.get(N.source),We=Pe.nodeLookup.get(N.target);if(!Ie||!We)return{zIndex:N.zIndex,...WT};const ut=eX({id:t,sourceNode:Ie,targetNode:We,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:Pe.connectionMode,onError:w});return{zIndex:VV({selected:N.selected,zIndex:N.zIndex,sourceNode:Ie,targetNode:We,elevateOnSelect:Pe.elevateEdgesOnSelect,zIndexMode:Pe.zIndexMode}),...ut||WT}},[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex]),Zn),U=G.useMemo(()=>N.markerStart?`url('#${T_(N.markerStart,E)}')`:void 0,[N.markerStart,E]),le=G.useMemo(()=>N.markerEnd?`url('#${T_(N.markerEnd,E)}')`:void 0,[N.markerEnd,E]);if(N.hidden||Y===null||Z===null||$===null||j===null)return null;const de=Pe=>{var Ue;const{addSelectedEdges:Ie,unselectNodesAndEdges:We,multiSelectionActive:ut}=Q.getState();P&&(Q.setState({nodesSelectionActive:!1}),N.selected&&ut?(We({nodes:[],edges:[N]}),(Ue=I.current)==null||Ue.blur()):Ie([t])),r&&r(Pe,N)},ge=s?Pe=>{s(Pe,{...N})}:void 0,se=l?Pe=>{l(Pe,{...N})}:void 0,pe=c?Pe=>{c(Pe,{...N})}:void 0,Ae=d?Pe=>{d(Pe,{...N})}:void 0,Le=p?Pe=>{p(Pe,{...N})}:void 0,Ge=Pe=>{var Ie;if(!k&&gR.includes(Pe.key)&&P){const{unselectNodesAndEdges:We,addSelectedEdges:ut}=Q.getState();Pe.key==="Escape"?((Ie=I.current)==null||Ie.blur(),We({edges:[N]})):ut([t])}};return R.jsx("svg",{style:{zIndex:B},children:R.jsxs("g",{className:Oi(["react-flow__edge",`react-flow__edge-${H}`,N.className,C,{selected:N.selected,animated:N.animated,inactive:!P&&!r,updating:V,selectable:P}]),onClick:de,onDoubleClick:ge,onContextMenu:se,onMouseEnter:pe,onMouseMove:Ae,onMouseLeave:Le,onKeyDown:F?Ge:void 0,tabIndex:F?0:void 0,role:N.ariaRole??(F?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":N.ariaLabel===null?void 0:N.ariaLabel||`Edge from ${N.source} to ${N.target}`,"aria-describedby":F?`${KR}-${E}`:void 0,ref:I,...N.domAttributes,children:[!ne&&R.jsx(z,{id:t,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,selectable:P,deletable:N.deletable??!0,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:Y,sourceY:Z,targetX:$,targetY:j,sourcePosition:K,targetPosition:te,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:U,markerEnd:le,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),ee&&R.jsx(uW,{edge:N,isReconnectable:ee,reconnectRadius:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:v,sourceX:Y,sourceY:Z,targetX:$,targetY:j,sourcePosition:K,targetPosition:te,setUpdateHover:X,setReconnecting:q})]})})}var dW=G.memo(fW);const hW=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function bk({defaultMarkerColor:t,onlyRenderVisibleElements:e,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:d,onEdgeMouseLeave:p,onEdgeClick:m,reconnectRadius:g,onEdgeDoubleClick:x,onReconnectStart:v,onReconnectEnd:E,disableKeyboardA11y:A}){const{edgesFocusable:C,edgesReconnectable:w,elementsSelectable:k,onError:N}=Wt(hW,Zn),D=$K(e);return R.jsxs("div",{className:"react-flow__edges",children:[R.jsx(nW,{defaultColor:t,rfId:n}),D.map(H=>R.jsx(dW,{id:H,edgesFocusable:C,edgesReconnectable:w,elementsSelectable:k,noPanClassName:r,onReconnect:s,onContextMenu:l,onMouseEnter:c,onMouseMove:d,onMouseLeave:p,onClick:m,reconnectRadius:g,onDoubleClick:x,onReconnectStart:v,onReconnectEnd:E,rfId:n,onError:N,edgeTypes:i,disableKeyboardA11y:A},H))]})}bk.displayName="EdgeRenderer";const pW=G.memo(bk),mW=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function gW({children:t}){const e=Wt(mW);return R.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:t})}function yW(t){const e=pb(),n=G.useRef(!1);G.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const bW=t=>{var e;return(e=t.panZoom)==null?void 0:e.syncViewport};function xW(t){const e=Wt(bW),n=$n();return G.useEffect(()=>{t&&(e==null||e(t),n.setState({transform:[t.x,t.y,t.zoom]}))},[t,e]),null}function vW(t){return t.connection.inProgress?{...t.connection,to:tg(t.connection.to,t.transform)}:{...t.connection}}function _W(t){return vW}function SW(t){const e=_W();return Wt(e,Zn)}const EW=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function wW({containerStyle:t,style:e,type:n,component:i}){const{nodesConnectable:r,width:s,height:l,isValid:c,inProgress:d}=Wt(EW,Zn);return!(s&&r&&d)?null:R.jsx("svg",{style:t,width:s,height:l,className:"react-flow__connectionline react-flow__container",children:R.jsx("g",{className:Oi(["react-flow__connection",xR(c)]),children:R.jsx(xk,{style:e,type:n,CustomComponent:i,isValid:c})})})}const xk=({style:t,type:e=nu.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:l,fromHandle:c,fromPosition:d,to:p,toNode:m,toHandle:g,toPosition:x,pointer:v}=SW();if(!r)return;if(n)return R.jsx(n,{connectionLineType:e,connectionLineStyle:t,fromNode:l,fromHandle:c,fromX:s.x,fromY:s.y,toX:p.x,toY:p.y,fromPosition:d,toPosition:x,connectionStatus:xR(i),toNode:m,toHandle:g,pointer:v});let E="";const A={sourceX:s.x,sourceY:s.y,sourcePosition:d,targetX:p.x,targetY:p.y,targetPosition:x};switch(e){case nu.Bezier:[E]=kR(A);break;case nu.SimpleBezier:[E]=sk(A);break;case nu.Step:[E]=w_({...A,borderRadius:0});break;case nu.SmoothStep:[E]=w_(A);break;default:[E]=DR(A)}return R.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:t})};xk.displayName="ConnectionLine";const TW={};function QT(t=TW){G.useRef(t),$n(),G.useEffect(()=>{},[t])}function CW(){$n(),G.useRef(!1),G.useEffect(()=>{},[])}function vk({nodeTypes:t,edgeTypes:e,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:p,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:x,onSelectionEnd:v,connectionLineType:E,connectionLineStyle:A,connectionLineComponent:C,connectionLineContainerStyle:w,selectionKeyCode:k,selectionOnDrag:N,selectionMode:D,multiSelectionKeyCode:H,panActivationKeyCode:z,zoomActivationKeyCode:F,deleteKeyCode:ee,onlyRenderVisibleElements:P,elementsSelectable:I,defaultViewport:V,translateExtent:X,minZoom:ne,maxZoom:q,preventScrolling:Q,defaultMarkerColor:B,zoomOnScroll:Y,zoomOnPinch:Z,panOnScroll:$,panOnScrollSpeed:j,panOnScrollMode:K,zoomOnDoubleClick:te,panOnDrag:U,onPaneClick:le,onPaneMouseEnter:de,onPaneMouseMove:ge,onPaneMouseLeave:se,onPaneScroll:pe,onPaneContextMenu:Ae,paneClickDistance:Le,nodeClickDistance:Ge,onEdgeContextMenu:Pe,onEdgeMouseEnter:Ie,onEdgeMouseMove:We,onEdgeMouseLeave:ut,reconnectRadius:Ue,onReconnect:At,onReconnectStart:zn,onReconnectEnd:Bn,noDragClassName:bn,noWheelClassName:wi,noPanClassName:ka,disableKeyboardA11y:Lr,nodeExtent:hn,rfId:ua,viewport:_e,onViewportChange:Re}){return QT(t),QT(e),CW(),yW(n),xW(_e),R.jsx(PK,{onPaneClick:le,onPaneMouseEnter:de,onPaneMouseMove:ge,onPaneMouseLeave:se,onPaneContextMenu:Ae,onPaneScroll:pe,paneClickDistance:Le,deleteKeyCode:ee,selectionKeyCode:k,selectionOnDrag:N,selectionMode:D,onSelectionStart:x,onSelectionEnd:v,multiSelectionKeyCode:H,panActivationKeyCode:z,zoomActivationKeyCode:F,elementsSelectable:I,zoomOnScroll:Y,zoomOnPinch:Z,zoomOnDoubleClick:te,panOnScroll:$,panOnScrollSpeed:j,panOnScrollMode:K,panOnDrag:U,defaultViewport:V,translateExtent:X,minZoom:ne,maxZoom:q,onSelectionContextMenu:g,preventScrolling:Q,noDragClassName:bn,noWheelClassName:wi,noPanClassName:ka,disableKeyboardA11y:Lr,onViewportChange:Re,isControlledViewport:!!_e,children:R.jsxs(gW,{children:[R.jsx(pW,{edgeTypes:e,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:At,onReconnectStart:zn,onReconnectEnd:Bn,onlyRenderVisibleElements:P,onEdgeContextMenu:Pe,onEdgeMouseEnter:Ie,onEdgeMouseMove:We,onEdgeMouseLeave:ut,reconnectRadius:Ue,defaultMarkerColor:B,noPanClassName:ka,disableKeyboardA11y:Lr,rfId:ua}),R.jsx(wW,{style:A,type:E,component:C,containerStyle:w}),R.jsx("div",{className:"react-flow__edgelabel-renderer"}),R.jsx(ZK,{nodeTypes:t,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:p,onNodeContextMenu:m,nodeClickDistance:Ge,onlyRenderVisibleElements:P,noPanClassName:ka,noDragClassName:bn,disableKeyboardA11y:Lr,nodeExtent:hn,rfId:ua}),R.jsx("div",{className:"react-flow__viewport-portal"})]})})}vk.displayName="GraphView";const AW=G.memo(vk),JT=({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:l,fitViewOptions:c,minZoom:d=.5,maxZoom:p=2,nodeOrigin:m,nodeExtent:g,zIndexMode:x="basic"}={})=>{const v=new Map,E=new Map,A=new Map,C=new Map,w=i??e??[],k=n??t??[],N=m??[0,0],D=g??Lm;LR(A,C,w);const H=C_(k,v,E,{nodeOrigin:N,nodeExtent:D,zIndexMode:x});let z=[0,0,1];if(l&&r&&s){const F=Jm(v,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:ee,y:P,zoom:I}=R1(F,r,s,d,p,(c==null?void 0:c.padding)??.1);z=[ee,P,I]}return{rfId:"1",width:r??0,height:s??0,transform:z,nodes:k,nodesInitialized:H,nodeLookup:v,parentLookup:E,edges:w,edgeLookup:C,connectionLookup:A,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:d,maxZoom:p,translateExtent:Lm,nodeExtent:D,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ch.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:c,fitViewResolver:null,connection:{...bR},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:jV,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:yR,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},MW=({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:l,fitViewOptions:c,minZoom:d,maxZoom:p,nodeOrigin:m,nodeExtent:g,zIndexMode:x})=>qX((v,E)=>{async function A(){const{nodeLookup:C,panZoom:w,fitViewOptions:k,fitViewResolver:N,width:D,height:H,minZoom:z,maxZoom:F}=E();w&&(await IV({nodes:C,width:D,height:H,panZoom:w,minZoom:z,maxZoom:F},k),N==null||N.resolve(!0),v({fitViewResolver:null}))}return{...JT({nodes:t,edges:e,width:r,height:s,fitView:l,fitViewOptions:c,minZoom:d,maxZoom:p,nodeOrigin:m,nodeExtent:g,defaultNodes:n,defaultEdges:i,zIndexMode:x}),setNodes:C=>{const{nodeLookup:w,parentLookup:k,nodeOrigin:N,elevateNodesOnSelect:D,fitViewQueued:H,zIndexMode:z}=E(),F=C_(C,w,k,{nodeOrigin:N,nodeExtent:g,elevateNodesOnSelect:D,checkEquality:!0,zIndexMode:z});H&&F?(A(),v({nodes:C,nodesInitialized:F,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:C,nodesInitialized:F})},setEdges:C=>{const{connectionLookup:w,edgeLookup:k}=E();LR(w,k,C),v({edges:C})},setDefaultNodesAndEdges:(C,w)=>{if(C){const{setNodes:k}=E();k(C),v({hasDefaultNodes:!0})}if(w){const{setEdges:k}=E();k(w),v({hasDefaultEdges:!0})}},updateNodeInternals:C=>{const{triggerNodeChanges:w,nodeLookup:k,parentLookup:N,domNode:D,nodeOrigin:H,nodeExtent:z,debug:F,fitViewQueued:ee,zIndexMode:P}=E(),{changes:I,updatedInternals:V}=oX(C,k,N,D,H,z,P);V&&(rX(k,N,{nodeOrigin:H,nodeExtent:z,zIndexMode:P}),ee?(A(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(I==null?void 0:I.length)>0&&(F&&console.log("React Flow: trigger node changes",I),w==null||w(I)))},updateNodePositions:(C,w=!1)=>{const k=[];let N=[];const{nodeLookup:D,triggerNodeChanges:H,connection:z,updateConnection:F,onNodesChangeMiddlewareMap:ee}=E();for(const[P,I]of C){const V=D.get(P),X=!!(V!=null&&V.expandParent&&(V!=null&&V.parentId)&&(I!=null&&I.position)),ne={id:P,type:"position",position:X?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:w};if(V&&z.inProgress&&z.fromNode.id===V.id){const q=_f(V,z.fromHandle,Qe.Left,!0);F({...z,from:q})}X&&V.parentId&&k.push({id:P,parentId:V.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),N.push(ne)}if(k.length>0){const{parentLookup:P,nodeOrigin:I}=E(),V=L1(k,D,P,I);N.push(...V)}for(const P of ee.values())N=P(N);H(N)},triggerNodeChanges:C=>{const{onNodesChange:w,setNodes:k,nodes:N,hasDefaultNodes:D,debug:H}=E();if(C!=null&&C.length){if(D){const z=fK(C,N);k(z)}H&&console.log("React Flow: trigger node changes",C),w==null||w(C)}},triggerEdgeChanges:C=>{const{onEdgesChange:w,setEdges:k,edges:N,hasDefaultEdges:D,debug:H}=E();if(C!=null&&C.length){if(D){const z=dK(C,N);k(z)}H&&console.log("React Flow: trigger edge changes",C),w==null||w(C)}},addSelectedNodes:C=>{const{multiSelectionActive:w,edgeLookup:k,nodeLookup:N,triggerNodeChanges:D,triggerEdgeChanges:H}=E();if(w){const z=C.map(F=>cf(F,!0));D(z);return}D(Xd(N,new Set([...C]),!0)),H(Xd(k))},addSelectedEdges:C=>{const{multiSelectionActive:w,edgeLookup:k,nodeLookup:N,triggerNodeChanges:D,triggerEdgeChanges:H}=E();if(w){const z=C.map(F=>cf(F,!0));H(z);return}H(Xd(k,new Set([...C]))),D(Xd(N,new Set,!0))},unselectNodesAndEdges:({nodes:C,edges:w}={})=>{const{edges:k,nodes:N,nodeLookup:D,triggerNodeChanges:H,triggerEdgeChanges:z}=E(),F=C||N,ee=w||k,P=[];for(const V of F){if(!V.selected)continue;const X=D.get(V.id);X&&(X.selected=!1),P.push(cf(V.id,!1))}const I=[];for(const V of ee)V.selected&&I.push(cf(V.id,!1));H(P),z(I)},setMinZoom:C=>{const{panZoom:w,maxZoom:k}=E();w==null||w.setScaleExtent([C,k]),v({minZoom:C})},setMaxZoom:C=>{const{panZoom:w,minZoom:k}=E();w==null||w.setScaleExtent([k,C]),v({maxZoom:C})},setTranslateExtent:C=>{var w;(w=E().panZoom)==null||w.setTranslateExtent(C),v({translateExtent:C})},resetSelectedElements:()=>{const{edges:C,nodes:w,triggerNodeChanges:k,triggerEdgeChanges:N,elementsSelectable:D}=E();if(!D)return;const H=w.reduce((F,ee)=>ee.selected?[...F,cf(ee.id,!1)]:F,[]),z=C.reduce((F,ee)=>ee.selected?[...F,cf(ee.id,!1)]:F,[]);k(H),N(z)},setNodeExtent:C=>{const{nodes:w,nodeLookup:k,parentLookup:N,nodeOrigin:D,elevateNodesOnSelect:H,nodeExtent:z,zIndexMode:F}=E();C[0][0]===z[0][0]&&C[0][1]===z[0][1]&&C[1][0]===z[1][0]&&C[1][1]===z[1][1]||(C_(w,k,N,{nodeOrigin:D,nodeExtent:C,elevateNodesOnSelect:H,checkEquality:!1,zIndexMode:F}),v({nodeExtent:C}))},panBy:C=>{const{transform:w,width:k,height:N,panZoom:D,translateExtent:H}=E();return cX({delta:C,panZoom:D,transform:w,translateExtent:H,width:k,height:N})},setCenter:async(C,w,k)=>{const{width:N,height:D,maxZoom:H,panZoom:z}=E();if(!z)return Promise.resolve(!1);const F=typeof(k==null?void 0:k.zoom)<"u"?k.zoom:H;return await z.setViewport({x:N/2-C*F,y:D/2-w*F,zoom:F},{duration:k==null?void 0:k.duration,ease:k==null?void 0:k.ease,interpolate:k==null?void 0:k.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...bR}})},updateConnection:C=>{v({connection:C})},reset:()=>v({...JT()})}},Object.is);function _k({initialNodes:t,initialEdges:e,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:d,fitView:p,nodeOrigin:m,nodeExtent:g,zIndexMode:x,children:v}){const[E]=G.useState(()=>MW({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:p,minZoom:l,maxZoom:c,fitViewOptions:d,nodeOrigin:m,nodeExtent:g,zIndexMode:x}));return R.jsx(YX,{value:E,children:R.jsx(gK,{children:v})})}function NW({children:t,nodes:e,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:l,fitView:c,fitViewOptions:d,minZoom:p,maxZoom:m,nodeOrigin:g,nodeExtent:x,zIndexMode:v}){return G.useContext(db)?R.jsx(R.Fragment,{children:t}):R.jsx(_k,{initialNodes:e,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:l,fitView:c,initialFitViewOptions:d,initialMinZoom:p,initialMaxZoom:m,nodeOrigin:g,nodeExtent:x,zIndexMode:v,children:t})}const RW={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function kW({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:l,onNodeClick:c,onEdgeClick:d,onInit:p,onMove:m,onMoveStart:g,onMoveEnd:x,onConnect:v,onConnectStart:E,onConnectEnd:A,onClickConnectStart:C,onClickConnectEnd:w,onNodeMouseEnter:k,onNodeMouseMove:N,onNodeMouseLeave:D,onNodeContextMenu:H,onNodeDoubleClick:z,onNodeDragStart:F,onNodeDrag:ee,onNodeDragStop:P,onNodesDelete:I,onEdgesDelete:V,onDelete:X,onSelectionChange:ne,onSelectionDragStart:q,onSelectionDrag:Q,onSelectionDragStop:B,onSelectionContextMenu:Y,onSelectionStart:Z,onSelectionEnd:$,onBeforeDelete:j,connectionMode:K,connectionLineType:te=nu.Bezier,connectionLineStyle:U,connectionLineComponent:le,connectionLineContainerStyle:de,deleteKeyCode:ge="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:pe=!1,selectionMode:Ae=Um.Full,panActivationKeyCode:Le="Space",multiSelectionKeyCode:Ge=Hm()?"Meta":"Control",zoomActivationKeyCode:Pe=Hm()?"Meta":"Control",snapToGrid:Ie,snapGrid:We,onlyRenderVisibleElements:ut=!1,selectNodesOnDrag:Ue,nodesDraggable:At,autoPanOnNodeFocus:zn,nodesConnectable:Bn,nodesFocusable:bn,nodeOrigin:wi=WR,edgesFocusable:ka,edgesReconnectable:Lr,elementsSelectable:hn=!0,defaultViewport:ua=rK,minZoom:_e=.5,maxZoom:Re=2,translateExtent:Je=Lm,preventScrolling:bt=!0,nodeExtent:kt,defaultMarkerColor:yi="#b1b1b7",zoomOnScroll:rr=!0,zoomOnPinch:xn=!0,panOnScroll:Zt=!1,panOnScrollSpeed:Gn=.5,panOnScrollMode:Pt=pf.Free,zoomOnDoubleClick:Fi=!0,panOnDrag:Qn=!0,onPaneClick:go,onPaneMouseEnter:is,onPaneMouseMove:Oa,onPaneMouseLeave:rs,onPaneScroll:bi,onPaneContextMenu:ae,paneClickDistance:Ee=1,nodeClickDistance:ze=0,children:et,onReconnect:Jt,onReconnectStart:en,onReconnectEnd:Fe,onEdgeContextMenu:He,onEdgeDoubleClick:tt,onEdgeMouseEnter:Cn,onEdgeMouseMove:Gt,onEdgeMouseLeave:fa,reconnectRadius:ar=10,onNodesChange:qi,onEdgesChange:sr,noDragClassName:yt="nodrag",noWheelClassName:li="nowheel",noPanClassName:Ur="nopan",fitView:Bs,fitViewOptions:_l,connectOnClick:Sl,attributionPosition:El,proOptions:Da,defaultEdgeOptions:Ls,elevateNodesOnSelect:tn=!0,elevateEdgesOnSelect:nn=!1,disableKeyboardA11y:lr=!1,autoPanOnConnect:Ir,autoPanOnNodeDrag:Ln,autoPanSpeed:xr,connectionRadius:da,isValidConnection:Hr,onError:Me,style:Ve,id:xt,nodeDragThreshold:Xt,connectionDragThreshold:Un,viewport:xi,onViewportChange:Yi,width:Ti,height:un,colorMode:or="light",debug:yo,onScroll:ha,ariaLabelConfig:wl,zIndexMode:za="basic",...oc},Di){const as=xt||"1",ss=oK(or),Us=G.useCallback(oi=>{oi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ha==null||ha(oi)},[ha]);return R.jsx("div",{"data-testid":"rf__wrapper",...oc,onScroll:Us,style:{...Ve,...RW},ref:Di,className:Oi(["react-flow",r,ss]),id:xt,role:"application",children:R.jsxs(NW,{nodes:t,edges:e,width:Ti,height:un,fitView:Bs,fitViewOptions:_l,minZoom:_e,maxZoom:Re,nodeOrigin:wi,nodeExtent:kt,zIndexMode:za,children:[R.jsx(AW,{onInit:p,onNodeClick:c,onEdgeClick:d,onNodeMouseEnter:k,onNodeMouseMove:N,onNodeMouseLeave:D,onNodeContextMenu:H,onNodeDoubleClick:z,nodeTypes:s,edgeTypes:l,connectionLineType:te,connectionLineStyle:U,connectionLineComponent:le,connectionLineContainerStyle:de,selectionKeyCode:se,selectionOnDrag:pe,selectionMode:Ae,deleteKeyCode:ge,multiSelectionKeyCode:Ge,panActivationKeyCode:Le,zoomActivationKeyCode:Pe,onlyRenderVisibleElements:ut,defaultViewport:ua,translateExtent:Je,minZoom:_e,maxZoom:Re,preventScrolling:bt,zoomOnScroll:rr,zoomOnPinch:xn,zoomOnDoubleClick:Fi,panOnScroll:Zt,panOnScrollSpeed:Gn,panOnScrollMode:Pt,panOnDrag:Qn,onPaneClick:go,onPaneMouseEnter:is,onPaneMouseMove:Oa,onPaneMouseLeave:rs,onPaneScroll:bi,onPaneContextMenu:ae,paneClickDistance:Ee,nodeClickDistance:ze,onSelectionContextMenu:Y,onSelectionStart:Z,onSelectionEnd:$,onReconnect:Jt,onReconnectStart:en,onReconnectEnd:Fe,onEdgeContextMenu:He,onEdgeDoubleClick:tt,onEdgeMouseEnter:Cn,onEdgeMouseMove:Gt,onEdgeMouseLeave:fa,reconnectRadius:ar,defaultMarkerColor:yi,noDragClassName:yt,noWheelClassName:li,noPanClassName:Ur,rfId:as,disableKeyboardA11y:lr,nodeExtent:kt,viewport:xi,onViewportChange:Yi}),R.jsx(lK,{nodes:t,edges:e,defaultNodes:n,defaultEdges:i,onConnect:v,onConnectStart:E,onConnectEnd:A,onClickConnectStart:C,onClickConnectEnd:w,nodesDraggable:At,autoPanOnNodeFocus:zn,nodesConnectable:Bn,nodesFocusable:bn,edgesFocusable:ka,edgesReconnectable:Lr,elementsSelectable:hn,elevateNodesOnSelect:tn,elevateEdgesOnSelect:nn,minZoom:_e,maxZoom:Re,nodeExtent:kt,onNodesChange:qi,onEdgesChange:sr,snapToGrid:Ie,snapGrid:We,connectionMode:K,translateExtent:Je,connectOnClick:Sl,defaultEdgeOptions:Ls,fitView:Bs,fitViewOptions:_l,onNodesDelete:I,onEdgesDelete:V,onDelete:X,onNodeDragStart:F,onNodeDrag:ee,onNodeDragStop:P,onSelectionDrag:Q,onSelectionDragStart:q,onSelectionDragStop:B,onMove:m,onMoveStart:g,onMoveEnd:x,noPanClassName:Ur,nodeOrigin:wi,rfId:as,autoPanOnConnect:Ir,autoPanOnNodeDrag:Ln,autoPanSpeed:xr,onError:Me,connectionRadius:da,isValidConnection:Hr,selectNodesOnDrag:Ue,nodeDragThreshold:Xt,connectionDragThreshold:Un,onBeforeDelete:j,debug:yo,ariaLabelConfig:wl,zIndexMode:za}),R.jsx(iK,{onSelectionChange:ne}),et,R.jsx(QX,{proOptions:Da,position:El}),R.jsx($X,{rfId:as,disableKeyboardA11y:lr})]})})}var OW=$R(kW);function DW({dimensions:t,lineWidth:e,variant:n,className:i}){return R.jsx("path",{strokeWidth:e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:Oi(["react-flow__background-pattern",n,i])})}function zW({radius:t,className:e}){return R.jsx("circle",{cx:t,cy:t,r:t,className:Oi(["react-flow__background-pattern","dots",e])})}var ru;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(ru||(ru={}));const BW={[ru.Dots]:1,[ru.Lines]:1,[ru.Cross]:6},LW=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function Sk({id:t,variant:e=ru.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:l,bgColor:c,style:d,className:p,patternClassName:m}){const g=G.useRef(null),{transform:x,patternId:v}=Wt(LW,Zn),E=i||BW[e],A=e===ru.Dots,C=e===ru.Cross,w=Array.isArray(n)?n:[n,n],k=[w[0]*x[2]||1,w[1]*x[2]||1],N=E*x[2],D=Array.isArray(s)?s:[s,s],H=C?[N,N]:k,z=[D[0]*x[2]||1+H[0]/2,D[1]*x[2]||1+H[1]/2],F=`${v}${t||""}`;return R.jsxs("svg",{className:Oi(["react-flow__background",p]),style:{...d,...mb,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:g,"data-testid":"rf__background",children:[R.jsx("pattern",{id:F,x:x[0]%k[0],y:x[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${z[0]},-${z[1]})`,children:A?R.jsx(zW,{radius:N/2,className:m}):R.jsx(DW,{dimensions:H,lineWidth:r,variant:e,className:m})}),R.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${F})`})]})}Sk.displayName="Background";const UW=G.memo(Sk);function IW(){return R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:R.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function HW(){return R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:R.jsx("path",{d:"M0 0h32v4.2H0z"})})}function jW(){return R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:R.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function PW(){return R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:R.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function GW(){return R.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:R.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function r0({children:t,className:e,...n}){return R.jsx("button",{type:"button",className:Oi(["react-flow__controls-button",e]),...n,children:t})}const FW=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function Ek({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:l,onFitView:c,onInteractiveChange:d,className:p,children:m,position:g="bottom-left",orientation:x="vertical","aria-label":v}){const E=$n(),{isInteractive:A,minZoomReached:C,maxZoomReached:w,ariaLabelConfig:k}=Wt(FW,Zn),{zoomIn:N,zoomOut:D,fitView:H}=pb(),z=()=>{N(),s==null||s()},F=()=>{D(),l==null||l()},ee=()=>{H(r),c==null||c()},P=()=>{E.setState({nodesDraggable:!A,nodesConnectable:!A,elementsSelectable:!A}),d==null||d(!A)},I=x==="horizontal"?"horizontal":"vertical";return R.jsxs(hb,{className:Oi(["react-flow__controls",I,p]),position:g,style:t,"data-testid":"rf__controls","aria-label":v??k["controls.ariaLabel"],children:[e&&R.jsxs(R.Fragment,{children:[R.jsx(r0,{onClick:z,className:"react-flow__controls-zoomin",title:k["controls.zoomIn.ariaLabel"],"aria-label":k["controls.zoomIn.ariaLabel"],disabled:w,children:R.jsx(IW,{})}),R.jsx(r0,{onClick:F,className:"react-flow__controls-zoomout",title:k["controls.zoomOut.ariaLabel"],"aria-label":k["controls.zoomOut.ariaLabel"],disabled:C,children:R.jsx(HW,{})})]}),n&&R.jsx(r0,{className:"react-flow__controls-fitview",onClick:ee,title:k["controls.fitView.ariaLabel"],"aria-label":k["controls.fitView.ariaLabel"],children:R.jsx(jW,{})}),i&&R.jsx(r0,{className:"react-flow__controls-interactive",onClick:P,title:k["controls.interactive.ariaLabel"],"aria-label":k["controls.interactive.ariaLabel"],children:A?R.jsx(GW,{}):R.jsx(PW,{})}),m]})}Ek.displayName="Controls";const qW=G.memo(Ek);function YW({id:t,x:e,y:n,width:i,height:r,style:s,color:l,strokeColor:c,strokeWidth:d,className:p,borderRadius:m,shapeRendering:g,selected:x,onClick:v}){const{background:E,backgroundColor:A}=s||{},C=l||E||A;return R.jsx("rect",{className:Oi(["react-flow__minimap-node",{selected:x},p]),x:e,y:n,rx:m,ry:m,width:i,height:r,style:{fill:C,stroke:c,strokeWidth:d},shapeRendering:g,onClick:v?w=>v(w,t):void 0})}const VW=G.memo(YW),XW=t=>t.nodes.map(e=>e.id),wv=t=>t instanceof Function?t:()=>t;function KW({nodeStrokeColor:t,nodeColor:e,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=VW,onClick:l}){const c=Wt(XW,Zn),d=wv(e),p=wv(t),m=wv(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return R.jsx(R.Fragment,{children:c.map(x=>R.jsx(ZW,{id:x,nodeColorFunc:d,nodeStrokeColorFunc:p,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:l,shapeRendering:g},x))})}function WW({id:t,nodeColorFunc:e,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:l,NodeComponent:c,onClick:d}){const{node:p,x:m,y:g,width:x,height:v}=Wt(E=>{const A=E.nodeLookup.get(t);if(!A)return{node:void 0,x:0,y:0,width:0,height:0};const C=A.internals.userNode,{x:w,y:k}=A.internals.positionAbsolute,{width:N,height:D}=lc(C);return{node:C,x:w,y:k,width:N,height:D}},Zn);return!p||p.hidden||!TR(p)?null:R.jsx(c,{x:m,y:g,width:x,height:v,style:p.style,selected:!!p.selected,className:i(p),color:e(p),borderRadius:r,strokeColor:n(p),strokeWidth:s,shapeRendering:l,onClick:d,id:p.id})}const ZW=G.memo(WW);var $W=G.memo(KW);const QW=200,JW=150,eZ=t=>!t.hidden,tZ=t=>{const e={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:e,boundingRect:t.nodeLookup.size>0?wR(Jm(t.nodeLookup,{filter:eZ}),e):e,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},nZ="react-flow__minimap-desc";function wk({style:t,className:e,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:d,maskColor:p,maskStrokeColor:m,maskStrokeWidth:g,position:x="bottom-right",onClick:v,onNodeClick:E,pannable:A=!1,zoomable:C=!1,ariaLabel:w,inversePan:k,zoomStep:N=1,offsetScale:D=5}){const H=$n(),z=G.useRef(null),{boundingRect:F,viewBB:ee,rfId:P,panZoom:I,translateExtent:V,flowWidth:X,flowHeight:ne,ariaLabelConfig:q}=Wt(tZ,Zn),Q=(t==null?void 0:t.width)??QW,B=(t==null?void 0:t.height)??JW,Y=F.width/Q,Z=F.height/B,$=Math.max(Y,Z),j=$*Q,K=$*B,te=D*$,U=F.x-(j-F.width)/2-te,le=F.y-(K-F.height)/2-te,de=j+te*2,ge=K+te*2,se=`${nZ}-${P}`,pe=G.useRef(0),Ae=G.useRef();pe.current=$,G.useEffect(()=>{if(z.current&&I)return Ae.current=bX({domNode:z.current,panZoom:I,getTransform:()=>H.getState().transform,getViewScale:()=>pe.current}),()=>{var Ie;(Ie=Ae.current)==null||Ie.destroy()}},[I]),G.useEffect(()=>{var Ie;(Ie=Ae.current)==null||Ie.update({translateExtent:V,width:X,height:ne,inversePan:k,pannable:A,zoomStep:N,zoomable:C})},[A,C,k,N,V,X,ne]);const Le=v?Ie=>{var Ue;const[We,ut]=((Ue=Ae.current)==null?void 0:Ue.pointer(Ie))||[0,0];v(Ie,{x:We,y:ut})}:void 0,Ge=E?G.useCallback((Ie,We)=>{const ut=H.getState().nodeLookup.get(We).internals.userNode;E(Ie,ut)},[]):void 0,Pe=w??q["minimap.ariaLabel"];return R.jsx(hb,{position:x,style:{...t,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*$:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:Oi(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:R.jsxs("svg",{width:Q,height:B,viewBox:`${U} ${le} ${de} ${ge}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:z,onClick:Le,children:[Pe&&R.jsx("title",{id:se,children:Pe}),R.jsx($W,{onClick:Ge,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:c}),R.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-te},${le-te}h${de+te*2}v${ge+te*2}h${-de-te*2}z
400
- M${ee.x},${ee.y}h${ee.width}v${ee.height}h${-ee.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}wk.displayName="MiniMap";const iZ=G.memo(wk),rZ=t=>e=>t?`${Math.max(1/e.transform[2],1)}`:void 0,aZ={[hh.Line]:"right",[hh.Handle]:"bottom-right"};function sZ({nodeId:t,position:e,variant:n=hh.Handle,className:i,style:r=void 0,children:s,color:l,minWidth:c=10,minHeight:d=10,maxWidth:p=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:x,autoScale:v=!0,shouldResize:E,onResizeStart:A,onResize:C,onResizeEnd:w}){const k=tk(),N=typeof t=="string"?t:k,D=$n(),H=G.useRef(null),z=n===hh.Handle,F=Wt(G.useCallback(rZ(z&&v),[z,v]),Zn),ee=G.useRef(null),P=e??aZ[n];G.useEffect(()=>{if(!(!H.current||!N))return ee.current||(ee.current=OX({domNode:H.current,nodeId:N,getStoreItems:()=>{const{nodeLookup:V,transform:X,snapGrid:ne,snapToGrid:q,nodeOrigin:Q,domNode:B}=D.getState();return{nodeLookup:V,transform:X,snapGrid:ne,snapToGrid:q,nodeOrigin:Q,paneDomNode:B}},onChange:(V,X)=>{const{triggerNodeChanges:ne,nodeLookup:q,parentLookup:Q,nodeOrigin:B}=D.getState(),Y=[],Z={x:V.x,y:V.y},$=q.get(N);if($&&$.expandParent&&$.parentId){const j=$.origin??B,K=V.width??$.measured.width??0,te=V.height??$.measured.height??0,U={id:$.id,parentId:$.parentId,rect:{width:K,height:te,...CR({x:V.x??$.position.x,y:V.y??$.position.y},{width:K,height:te},$.parentId,q,j)}},le=L1([U],q,Q,B);Y.push(...le),Z.x=V.x?Math.max(j[0]*K,V.x):void 0,Z.y=V.y?Math.max(j[1]*te,V.y):void 0}if(Z.x!==void 0&&Z.y!==void 0){const j={id:N,type:"position",position:{...Z}};Y.push(j)}if(V.width!==void 0&&V.height!==void 0){const K={id:N,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:V.width,height:V.height}};Y.push(K)}for(const j of X){const K={...j,type:"position"};Y.push(K)}ne(Y)},onEnd:({width:V,height:X})=>{const ne={id:N,type:"dimensions",resizing:!1,dimensions:{width:V,height:X}};D.getState().triggerNodeChanges([ne])}})),ee.current.update({controlPosition:P,boundaries:{minWidth:c,minHeight:d,maxWidth:p,maxHeight:m},keepAspectRatio:g,resizeDirection:x,onResizeStart:A,onResize:C,onResizeEnd:w,shouldResize:E}),()=>{var V;(V=ee.current)==null||V.destroy()}},[P,c,d,p,m,g,A,C,w,E]);const I=P.split("-");return R.jsx("div",{className:Oi(["react-flow__resize-control","nodrag",...I,n,i]),ref:H,style:{...r,scale:F,...l&&{[z?"backgroundColor":"borderColor"]:l}},children:s})}G.memo(sZ);const Tk={background:"rgba(0, 200, 255, 0.4)",width:6,height:6,border:"none"},eC={background:"rgba(0, 230, 138, 0.4)",width:6,height:6,border:"none"};function lZ({data:t}){return R.jsxs("div",{style:{padding:"16px 32px",border:"2px solid rgba(0, 200, 255, 0.4)",borderRadius:12,background:"linear-gradient(135deg, #121425, #1a1d35)",boxShadow:"0 0 30px rgba(0, 200, 255, 0.15), 0 4px 16px rgba(0,0,0,0.5)",textAlign:"center",minWidth:200},children:[R.jsx(su,{type:"source",position:Qe.Bottom,style:Tk}),R.jsx("div",{style:{width:44,height:44,borderRadius:8,background:"linear-gradient(135deg, #00c8ff, #0090b8)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",fontWeight:700,color:"#07080e",margin:"0 auto 8px",boxShadow:"0 0 16px rgba(0, 200, 255, 0.35)"},children:t.label.slice(0,2).toUpperCase()}),R.jsx("div",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:700,fontSize:"1rem",color:"#e8ecf4"},children:t.label}),R.jsx("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.6rem",color:"#555d73",marginTop:3},children:"CEO"})]})}function oZ({data:t}){const e=t.agents;return R.jsxs("div",{style:{padding:"14px 20px",border:"1px solid rgba(0, 230, 138, 0.25)",borderRadius:10,background:"linear-gradient(135deg, #0d1a14, #121425)",boxShadow:"0 0 16px rgba(0, 230, 138, 0.08), 0 2px 8px rgba(0,0,0,0.3)",textAlign:"center",minWidth:160},children:[R.jsx(su,{type:"target",position:Qe.Top,style:eC}),R.jsx(su,{type:"source",position:Qe.Bottom,style:eC}),R.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,marginBottom:4},children:[R.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:5,background:"rgba(0, 230, 138, 0.15)",border:"1px solid rgba(0, 230, 138, 0.25)",fontSize:"0.6rem",color:"#00e68a",fontWeight:700},children:t.label.slice(0,1).toUpperCase()}),R.jsx("span",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:600,fontSize:"0.82rem",color:"#00e68a"},children:t.label})]}),t.description?R.jsx("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.55rem",color:"#555d73",marginBottom:4,maxWidth:180},children:String(t.description)}):null,R.jsxs("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.55rem",color:"#555d73"},children:[e.length," agent",e.length!==1?"s":""]})]})}function cZ({data:t}){return R.jsxs("div",{style:{padding:"8px 16px",border:"1px solid rgba(100, 120, 200, 0.12)",borderRadius:6,background:"#0c0e18",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",textAlign:"center",minWidth:110},children:[R.jsx(su,{type:"target",position:Qe.Top,style:Tk}),R.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6},children:[R.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:"#00e68a",boxShadow:"0 0 6px rgba(0,230,138,0.4)",flexShrink:0}}),R.jsx("span",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:500,fontSize:"0.72rem",color:"#8b93a8"},children:t.label})]})]})}const uZ={company:lZ,squad:oZ,agent:cZ},tC=280,fZ=52,dZ=170;function hZ(t){const{tree:e,squads:n}=t,i=[],r=[];if(n.length===0)return i.push({id:"company",type:"company",position:{x:0,y:0},data:{label:e.name},draggable:!0}),{nodes:i,edges:r};const l=n.length*tC/2-100;return i.push({id:"company",type:"company",position:{x:l,y:0},data:{label:e.name},draggable:!0}),n.forEach((c,d)=>{const p=`squad-${c.code}`,m=d*tC;i.push({id:p,type:"squad",position:{x:m,y:200},data:{label:c.name,description:c.description,agents:c.agents},draggable:!0}),r.push({id:`company-${p}`,source:"company",target:p,style:{stroke:"rgba(0, 230, 138, 0.3)",strokeWidth:2},animated:!1});const g=c.agents.length,x=Math.min(g,2),v=m+80;c.agents.forEach((E,A)=>{const C=A%x,w=Math.floor(A/x),k=v+(C-(x-1)/2)*dZ-55,N=400+w*fZ,D=`agent-${c.code}-${E.id}`;i.push({id:D,type:"agent",position:{x:k,y:N},data:{label:E.name},draggable:!0}),r.push({id:`${p}-${D}`,source:p,target:D,style:{stroke:"rgba(100, 120, 200, 0.15)",strokeWidth:1},animated:!1})})}),{nodes:i,edges:r}}function pZ({data:t}){const{fitView:e}=pb(),{nodes:n,edges:i}=G.useMemo(()=>hZ(t),[t]);G.useEffect(()=>{const s=setTimeout(()=>e({padding:.12,duration:400}),50);return()=>clearTimeout(s)},[n.length,e]);const r=t.squads.reduce((s,l)=>s+l.agents.length,0);return R.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",animation:"fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both"},children:[R.jsxs("div",{style:{padding:"16px 20px 12px",flexShrink:0},children:[R.jsxs("h2",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:700,fontSize:"1.1rem",color:"#e8ecf4",marginBottom:2},children:[t.tree.name," — Org Chart"]}),R.jsxs("p",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.65rem",color:"#555d73"},children:[t.squads.length," active squad",t.squads.length!==1?"s":""," / ",r," agents"]})]}),R.jsx("div",{style:{flex:1,minHeight:0},children:R.jsxs(OW,{nodes:n,edges:i,nodeTypes:uZ,fitView:!0,fitViewOptions:{padding:.12},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},style:{background:"#07080e"},nodesDraggable:!0,nodesConnectable:!1,children:[R.jsx(UW,{color:"rgba(100, 120, 200, 0.04)",gap:24,size:1}),R.jsx(qW,{showInteractive:!1,style:{background:"#121425",border:"1px solid rgba(100, 120, 200, 0.15)",borderRadius:8}}),R.jsx(iZ,{nodeColor:s=>s.type==="company"?"#00c8ff":s.type==="squad"?"#00e68a":"#555d73",maskColor:"rgba(7, 8, 14, 0.85)",style:{background:"#0c0e18",border:"1px solid rgba(100, 120, 200, 0.1)",borderRadius:8}})]})})]})}function mZ(){const[t,e]=G.useState(null),[n,i]=G.useState(!0),[r,s]=G.useState(null);return G.useEffect(()=>{fetch("/api/orgchart",{credentials:"include"}).then(l=>{if(!l.ok)throw new Error(`HTTP ${l.status}`);return l.json()}).then(l=>{e(l),i(!1)}).catch(l=>{s(l.message),i(!1)})},[]),n?R.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",fontFamily:"'JetBrains Mono', monospace",fontSize:"0.75rem",color:"#555d73"},children:"Loading org chart..."}):r||!t?R.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",fontFamily:"'JetBrains Mono', monospace",fontSize:"0.75rem",color:"#ff4070"},children:r||"Failed to load org chart"}):R.jsx(_k,{children:R.jsx(pZ,{data:t})})}const gZ=G.lazy(()=>Kd(()=>import("./JarvisView-D78mY8i-.js"),[]).then(t=>({default:t.JarvisView})));CO.createRoot(document.getElementById("root")).render(R.jsx(G.StrictMode,{children:R.jsx(Z3,{children:R.jsxs(C3,{children:[R.jsx(Ns,{path:"/login",element:R.jsx(PD,{})}),R.jsxs(Ns,{path:"/",element:R.jsx(jD,{}),children:[R.jsx(Ns,{index:!0,element:R.jsx(w3,{to:"/office",replace:!0})}),R.jsx(Ns,{path:"office",element:R.jsx(h8,{})}),R.jsx(Ns,{path:"chat",element:R.jsx(DG,{})}),R.jsx(Ns,{path:"kanban",element:R.jsx(HG,{})}),R.jsx(Ns,{path:"settings",element:R.jsx(WG,{})}),R.jsx(Ns,{path:"scheduler",element:R.jsx(ZG,{})}),R.jsx(Ns,{path:"email",element:R.jsx(eF,{})}),R.jsx(Ns,{path:"orgchart",element:R.jsx(mZ,{})}),R.jsx(Ns,{path:"jarvis",element:R.jsx(G.Suspense,{fallback:null,children:R.jsx(gZ,{})})})]})]})})}));export{K0 as $,EA as A,Mm as B,Gi as C,Ja as D,ho as E,ic as F,Aa as G,G_ as H,Ym as I,UD as J,HE as K,c0 as L,jt as M,j_ as N,vA as O,Dr as P,zs as Q,Iv as R,Qz as S,Tn as T,x0 as U,hA as V,Zv as W,C5 as X,M5 as Y,B5 as Z,O5 as _,yZ as a,Ef as a0,a4 as a1,qm as a2,P_ as a3,I5 as a4,Na as a5,PC as a6,Ds as a7,V0 as a8,SE as a9,ih as aa,bB as ab,L4 as ac,wE as ad,bx as ae,TE as af,I4 as ag,th as ah,Ei as ai,qC as aj,P6 as ak,wA as al,Qt as am,Fm as an,mi as ao,Pz as ap,Lz as aq,o5 as ar,t5 as as,A5 as at,N5 as au,L5 as av,z5 as aw,U5 as ax,dl as b,Ta as c,bz as d,Ca as e,gi as f,lz as g,On as h,o0 as i,R as j,Nt as k,e6 as l,FC as m,W0 as n,Y5 as o,Z0 as p,JC as q,G as r,xD as s,si as t,ox as u,Fd as v,ca as w,x4 as x,br as y,Wz as z};