@baseplate-dev/project-builder-web 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-DeLjV85y.js → web-DNtY4wq3.js} +2 -2
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-DeLjV85y.js.map → web-DNtY4wq3.js.map} +1 -1
- package/dist/assets/__federation_shared_@baseplate-dev/{project-builder-lib-CEcnKpIc.js → project-builder-lib-zvGcQ6PN.js} +2 -2
- package/dist/assets/__federation_shared_@baseplate-dev/{project-builder-lib-CEcnKpIc.js.map → project-builder-lib-zvGcQ6PN.js.map} +1 -1
- package/dist/assets/__federation_shared_@baseplate-dev/{ui-components-BngA7Gbo.js → ui-components-DQh2UKHB.js} +2 -2
- package/dist/assets/__federation_shared_@baseplate-dev/{ui-components-BngA7Gbo.js.map → ui-components-DQh2UKHB.js.map} +1 -1
- package/dist/assets/{_virtual___federation_fn_import-DTGz4eK3.js → _virtual___federation_fn_import-BawTfoQI.js} +2 -2
- package/dist/assets/{_virtual___federation_fn_import-DTGz4eK3.js.map → _virtual___federation_fn_import-BawTfoQI.js.map} +1 -1
- package/dist/assets/index-BDJ79UQH.css +1 -0
- package/dist/assets/index-C6NlRicZ.js +78 -0
- package/dist/assets/index-C6NlRicZ.js.map +1 -0
- package/dist/assets/{index.esm-BCWxrcvn.js → index.esm-H0JGW0RR.js} +2 -2
- package/dist/assets/{index.esm-BCWxrcvn.js.map → index.esm-H0JGW0RR.js.map} +1 -1
- package/dist/assets/model-merger-D2RoujrB.js +2 -0
- package/dist/assets/model-merger-D2RoujrB.js.map +1 -0
- package/dist/assets/{not-empty-CxPFIhu9.js → not-empty-CznDVwM8.js} +2 -2
- package/dist/assets/{not-empty-CxPFIhu9.js.map → not-empty-CznDVwM8.js.map} +1 -1
- package/dist/index.html +5 -5
- package/package.json +6 -6
- package/dist/assets/index-BM00URXH.js +0 -78
- package/dist/assets/index-BM00URXH.js.map +0 -1
- package/dist/assets/index-BievMsrf.css +0 -1
- package/dist/assets/model-merger-xMPe_PFP.js +0 -2
- package/dist/assets/model-merger-xMPe_PFP.js.map +0 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import{i as C}from"./_virtual___federation_fn_import-BawTfoQI.js";import{j as s,c as Cm,u as fa,g as lm,s as Xd,a as Lw,b as gi,d as bs,e as it,f as Ow,h as Uw}from"./index.esm-H0JGW0RR.js";import{r as zw,g as Em}from"./index-9Ra4Lmds.js";import{r as Bw}from"./index-B0D_rfGi.js";import{c as Te,G as Yi,M as U0,a as Rx,b as _w,d as Nx,e as Fw,f as qw,n as Mx,g as Hw,h as Dm,i as Ax,j as $x,k as Pw,l as kw,m as vi,o as Lx,p as ys,q as Vl,r as Tm,s as Iw,t as Vw,u as Gw,v as Yw,w as Ox,x as Xw,y as Qw,z as Kw,A as Zw}from"./not-empty-CznDVwM8.js";import{s as Zn,o as Ww,p as Jw,i as Ux,c as e4,f as t4}from"./index-DC_DCd-Q.js";import{i as n4}from"./isEqual-C420KeG-.js";import{c as a4}from"./capitalize-gOJXDbsR.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();var Qd={exports:{}},Yr={},Kd={exports:{}},Zd={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* scheduler.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var z0;function i4(){return z0||(z0=1,function(a){function n(U,k){var Y=U.length;U.push(k);e:for(;0<Y;){var ne=Y-1>>>1,re=U[ne];if(0<c(re,k))U[ne]=k,U[Y]=re,Y=ne;else break e}}function l(U){return U.length===0?null:U[0]}function o(U){if(U.length===0)return null;var k=U[0],Y=U.pop();if(Y!==k){U[0]=Y;e:for(var ne=0,re=U.length,ge=re>>>1;ne<ge;){var ie=2*(ne+1)-1,ce=U[ie],Se=ie+1,je=U[Se];if(0>c(ce,Y))Se<re&&0>c(je,ce)?(U[ne]=je,U[Se]=Y,ne=Se):(U[ne]=ce,U[ie]=Y,ne=ie);else if(Se<re&&0>c(je,Y))U[ne]=je,U[Se]=Y,ne=Se;else break e}}return k}function c(U,k){var Y=U.sortIndex-k.sortIndex;return Y!==0?Y:U.id-k.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;a.unstable_now=function(){return d.now()}}else{var f=Date,p=f.now();a.unstable_now=function(){return f.now()-p}}var m=[],g=[],v=1,b=null,x=3,j=!1,D=!1,S=!1,R=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function H(U){for(var k=l(g);k!==null;){if(k.callback===null)o(g);else if(k.startTime<=U)o(g),k.sortIndex=k.expirationTime,n(m,k);else break;k=l(g)}}function V(U){if(S=!1,H(U),!D)if(l(m)!==null)D=!0,K||(K=!0,se());else{var k=l(g);k!==null&&W(V,k.startTime-U)}}var K=!1,T=-1,O=5,Q=-1;function te(){return R?!0:!(a.unstable_now()-Q<O)}function ae(){if(R=!1,K){var U=a.unstable_now();Q=U;var k=!0;try{e:{D=!1,S&&(S=!1,A(T),T=-1),j=!0;var Y=x;try{t:{for(H(U),b=l(m);b!==null&&!(b.expirationTime>U&&te());){var ne=b.callback;if(typeof ne=="function"){b.callback=null,x=b.priorityLevel;var re=ne(b.expirationTime<=U);if(U=a.unstable_now(),typeof re=="function"){b.callback=re,H(U),k=!0;break t}b===l(m)&&o(m),H(U)}else o(m);b=l(m)}if(b!==null)k=!0;else{var ge=l(g);ge!==null&&W(V,ge.startTime-U),k=!1}}break e}finally{b=null,x=Y,j=!1}k=void 0}}finally{k?se():K=!1}}}var se;if(typeof B=="function")se=function(){B(ae)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,G=Ee.port2;Ee.port1.onmessage=ae,se=function(){G.postMessage(null)}}else se=function(){E(ae,0)};function W(U,k){T=E(function(){U(a.unstable_now())},k)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(U){U.callback=null},a.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<U?Math.floor(1e3/U):5},a.unstable_getCurrentPriorityLevel=function(){return x},a.unstable_next=function(U){switch(x){case 1:case 2:case 3:var k=3;break;default:k=x}var Y=x;x=k;try{return U()}finally{x=Y}},a.unstable_requestPaint=function(){R=!0},a.unstable_runWithPriority=function(U,k){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var Y=x;x=U;try{return k()}finally{x=Y}},a.unstable_scheduleCallback=function(U,k,Y){var ne=a.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?ne+Y:ne):Y=ne,U){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=Y+re,U={id:v++,callback:k,priorityLevel:U,startTime:Y,expirationTime:re,sortIndex:-1},Y>ne?(U.sortIndex=Y,n(g,U),l(m)===null&&U===l(g)&&(S?(A(T),T=-1):S=!0,W(V,Y-ne))):(U.sortIndex=re,n(m,U),D||j||(D=!0,K||(K=!0,se()))),U},a.unstable_shouldYield=te,a.unstable_wrapCallback=function(U){var k=x;return function(){var Y=x;x=k;try{return U.apply(this,arguments)}finally{x=Y}}}}(Zd)),Zd}var B0;function l4(){return B0||(B0=1,Kd.exports=i4()),Kd.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-dom-client.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var _0;function r4(){if(_0)return Yr;_0=1;var a=l4(),n=zw(),l=Bw();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(d(e)!==e)throw Error(o(188))}function m(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(o(188));return t!==e?null:e}for(var i=e,r=t;;){var u=i.return;if(u===null)break;var h=u.alternate;if(h===null){if(r=u.return,r!==null){i=r;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===i)return p(u),e;if(h===r)return p(u),t;h=h.sibling}throw Error(o(188))}if(i.return!==r.return)i=u,r=h;else{for(var y=!1,w=u.child;w;){if(w===i){y=!0,i=u,r=h;break}if(w===r){y=!0,r=u,i=h;break}w=w.sibling}if(!y){for(w=h.child;w;){if(w===i){y=!0,i=h,r=u;break}if(w===r){y=!0,r=h,i=u;break}w=w.sibling}if(!y)throw Error(o(189))}}if(i.alternate!==r)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),A=Symbol.for("react.consumer"),B=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Symbol.for("react.client.reference");function G(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case R:return"Profiler";case S:return"StrictMode";case V:return"Suspense";case K:return"SuspenseList";case Q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case j:return"Portal";case B:return(e.displayName||"Context")+".Provider";case A:return(e._context.displayName||"Context")+".Consumer";case H:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case T:return t=e.displayName||null,t!==null?t:G(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return G(e(t))}catch{}}return null}var W=Array.isArray,U=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ge(e){return{current:e}}function ie(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function ce(e,t){re++,ne[re]=e.current,e.current=t}var Se=ge(null),je=ge(null),Ue=ge(null),Ot=ge(null);function Dt(e,t){switch(ce(Ue,t),ce(je,e),ce(Se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?c0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=c0(t),e=u0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ie(Se),ce(Se,e)}function Tt(){ie(Se),ie(je),ie(Ue)}function Be(e){e.memoizedState!==null&&ce(Ot,e);var t=Se.current,i=u0(t,e.type);t!==i&&(ce(je,e),ce(Se,i))}function En(e){je.current===e&&(ie(Se),ie(je)),Ot.current===e&&(ie(Ot),Pr._currentValue=Y)}var ke=Object.prototype.hasOwnProperty,Ut=a.unstable_scheduleCallback,It=a.unstable_cancelCallback,ea=a.unstable_shouldYield,Vt=a.unstable_requestPaint,Yt=a.unstable_now,Zi=a.unstable_getCurrentPriorityLevel,ga=a.unstable_ImmediatePriority,un=a.unstable_UserBlockingPriority,Hn=a.unstable_NormalPriority,Pa=a.unstable_LowPriority,yi=a.unstable_IdlePriority,Dn=a.log,va=a.unstable_setDisableYieldValue,ta=null,rt=null;function st(e){if(typeof Dn=="function"&&va(e),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(ta,e)}catch{}}var Ve=Math.clz32?Math.clz32:Wi,xi=Math.log,Xt=Math.LN2;function Wi(e){return e>>>=0,e===0?32:31-(xi(e)/Xt|0)|0}var Qt=256,ba=4194304;function en(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function na(e,t,i){var r=e.pendingLanes;if(r===0)return 0;var u=0,h=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var w=r&134217727;return w!==0?(r=w&~h,r!==0?u=en(r):(y&=w,y!==0?u=en(y):i||(i=w&~e,i!==0&&(u=en(i))))):(w=r&~h,w!==0?u=en(w):y!==0?u=en(y):i||(i=r&~e,i!==0&&(u=en(i)))),u===0?0:t!==0&&t!==u&&(t&h)===0&&(h=u&-u,i=t&-t,h>=i||h===32&&(i&4194048)!==0)?t:u}function ya(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ji(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xa(){var e=Qt;return Qt<<=1,(Qt&4194048)===0&&(Qt=256),e}function Si(){var e=ba;return ba<<=1,(ba&62914560)===0&&(ba=4194304),e}function ja(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function nt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function zt(e,t,i,r,u,h){var y=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var w=e.entanglements,N=e.expirationTimes,F=e.hiddenUpdates;for(i=y&~i;0<i;){var X=31-Ve(i),J=1<<X;w[X]=0,N[X]=-1;var P=F[X];if(P!==null)for(F[X]=null,X=0;X<P.length;X++){var I=P[X];I!==null&&(I.lane&=-536870913)}i&=~J}r!==0&&jt(e,r,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(y&~t))}function jt(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ve(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|i&4194090}function dn(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var r=31-Ve(i),u=1<<r;u&t|e[r]&t&&(e[r]|=t),i&=~u}}function St(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function dt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rt(){var e=k.p;return e!==0?e:(e=window.event,e===void 0?32:N0(e.type))}function aa(e,t){var i=k.p;try{return k.p=e,t()}finally{k.p=i}}var Ze=Math.random().toString(36).slice(2),M="__reactFiber$"+Ze,L="__reactProps$"+Ze,q="__reactContainer$"+Ze,ee="__reactEvents$"+Ze,le="__reactListeners$"+Ze,fe="__reactHandles$"+Ze,be="__reactResources$"+Ze,oe="__reactMarker$"+Ze;function he(e){delete e[M],delete e[L],delete e[ee],delete e[le],delete e[fe]}function ue(e){var t=e[M];if(t)return t;for(var i=e.parentNode;i;){if(t=i[q]||i[M]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=m0(e);e!==null;){if(i=e[M])return i;e=m0(e)}return t}e=i,i=e.parentNode}return null}function me(e){if(e=e[M]||e[q]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Ce(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Ne(e){var t=e[be];return t||(t=e[be]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Oe(e){e[oe]=!0}var Ge=new Set,_e={};function Ie(e,t){fn(e,t),fn(e+"Capture",t)}function fn(e,t){for(_e[e]=t,e=0;e<t.length;e++)Ge.add(t[e])}var wi=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]*$"),Tn={},hn={};function er(e){return ke.call(hn,e)?!0:ke.call(Tn,e)?!1:wi.test(e)?hn[e]=!0:(Tn[e]=!0,!1)}function ia(e,t,i){if(er(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Rn(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function tn(e,t,i,r){if(r===null)e.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+r)}}var ka,ze;function Ye(e){if(ka===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);ka=t&&t[1]||"",ze=-1<i.stack.indexOf(`
|
|
18
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
+
`+ka+e+ze}var la=!1;function Sa(e,t){if(!e||la)return"";la=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(I){var P=I}Reflect.construct(e,[],J)}else{try{J.call()}catch(I){P=I}e.call(J.prototype)}}else{try{throw Error()}catch(I){P=I}(J=e())&&typeof J.catch=="function"&&J.catch(function(){})}}catch(I){if(I&&P&&typeof I.stack=="string")return[I.stack,P.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=r.DetermineComponentFrameRoot(),y=h[0],w=h[1];if(y&&w){var N=y.split(`
|
|
20
|
+
`),F=w.split(`
|
|
21
|
+
`);for(u=r=0;r<N.length&&!N[r].includes("DetermineComponentFrameRoot");)r++;for(;u<F.length&&!F[u].includes("DetermineComponentFrameRoot");)u++;if(r===N.length||u===F.length)for(r=N.length-1,u=F.length-1;1<=r&&0<=u&&N[r]!==F[u];)u--;for(;1<=r&&0<=u;r--,u--)if(N[r]!==F[u]){if(r!==1||u!==1)do if(r--,u--,0>u||N[r]!==F[u]){var X=`
|
|
22
|
+
`+N[r].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=r&&0<=u);break}}}finally{la=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Ye(i):""}function ft(e){switch(e.tag){case 26:case 27:case 5:return Ye(e.type);case 16:return Ye("Lazy");case 13:return Ye("Suspense");case 19:return Ye("SuspenseList");case 0:case 15:return Sa(e.type,!1);case 11:return Sa(e.type.render,!1);case 1:return Sa(e.type,!0);case 31:return Ye("Activity");default:return""}}function wa(e){try{var t="";do t+=ft(e),e=e.return;while(e);return t}catch(i){return`
|
|
23
|
+
Error generating stack: `+i.message+`
|
|
24
|
+
`+i.stack}}function Kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ms(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function RS(e){var t=Ms(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,h=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(y){r=""+y,h.call(this,y)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(y){r=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function As(e){e._valueTracker||(e._valueTracker=RS(e))}function lp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),r="";return e&&(r=Ms(e)?e.checked?"true":"false":e.value),e=r,e!==i?(t.setValue(e),!0):!1}function $s(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var NS=/[\n"\\]/g;function Nn(e){return e.replace(NS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Vc(e,t,i,r,u,h,y,w){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Kt(t)):e.value!==""+Kt(t)&&(e.value=""+Kt(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?Gc(e,y,Kt(t)):i!=null?Gc(e,y,Kt(i)):r!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+Kt(w):e.removeAttribute("name")}function rp(e,t,i,r,u,h,y,w){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||i!=null){if(!(h!=="submit"&&h!=="reset"||t!=null))return;i=i!=null?""+Kt(i):"",t=t!=null?""+Kt(t):i,w||t===e.value||(e.value=t),e.defaultValue=t}r=r??u,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=w?e.checked:!!r,e.defaultChecked=!!r,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y)}function Gc(e,t,i){t==="number"&&$s(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Ji(e,t,i,r){if(e=e.options,t){t={};for(var u=0;u<i.length;u++)t["$"+i[u]]=!0;for(i=0;i<e.length;i++)u=t.hasOwnProperty("$"+e[i].value),e[i].selected!==u&&(e[i].selected=u),u&&r&&(e[i].defaultSelected=!0)}else{for(i=""+Kt(i),t=null,u=0;u<e.length;u++){if(e[u].value===i){e[u].selected=!0,r&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function sp(e,t,i){if(t!=null&&(t=""+Kt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Kt(i):""}function op(e,t,i,r){if(t==null){if(r!=null){if(i!=null)throw Error(o(92));if(W(r)){if(1<r.length)throw Error(o(93));r=r[0]}i=r}i==null&&(i=""),t=i}i=Kt(t),e.defaultValue=i,r=e.textContent,r===i&&r!==""&&r!==null&&(e.value=r)}function el(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var MS=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 cp(e,t,i){var r=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,i):typeof i!="number"||i===0||MS.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function up(e,t,i){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,i!=null){for(var r in i)!i.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var u in t)r=t[u],t.hasOwnProperty(u)&&i[u]!==r&&cp(e,u,r)}else for(var h in t)t.hasOwnProperty(h)&&cp(e,h,t[h])}function Yc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var AS=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"]]),$S=/^[\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 Ls(e){return $S.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Xc=null;function Qc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tl=null,nl=null;function dp(e){var t=me(e);if(t&&(e=t.stateNode)){var i=e[L]||null;e:switch(e=t.stateNode,t.type){case"input":if(Vc(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Nn(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var r=i[t];if(r!==e&&r.form===e.form){var u=r[L]||null;if(!u)throw Error(o(90));Vc(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<i.length;t++)r=i[t],r.form===e.form&&lp(r)}break e;case"textarea":sp(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Ji(e,!!i.multiple,t,!1)}}}var Kc=!1;function fp(e,t,i){if(Kc)return e(t,i);Kc=!0;try{var r=e(t);return r}finally{if(Kc=!1,(tl!==null||nl!==null)&&(yo(),tl&&(t=tl,e=nl,nl=tl=null,dp(t),e)))for(t=0;t<e.length;t++)dp(e[t])}}function tr(e,t){var i=e.stateNode;if(i===null)return null;var r=i[L]||null;if(r===null)return null;i=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(o(231,t,typeof i));return i}var Ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zc=!1;if(Ca)try{var nr={};Object.defineProperty(nr,"passive",{get:function(){Zc=!0}}),window.addEventListener("test",nr,nr),window.removeEventListener("test",nr,nr)}catch{Zc=!1}var Ia=null,Wc=null,Os=null;function hp(){if(Os)return Os;var e,t=Wc,i=t.length,r,u="value"in Ia?Ia.value:Ia.textContent,h=u.length;for(e=0;e<i&&t[e]===u[e];e++);var y=i-e;for(r=1;r<=y&&t[i-r]===u[h-r];r++);return Os=u.slice(e,1<r?1-r:void 0)}function Us(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function zs(){return!0}function mp(){return!1}function nn(e){function t(i,r,u,h,y){this._reactName=i,this._targetInst=u,this.type=r,this.nativeEvent=h,this.target=y,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(i=e[w],this[w]=i?i(h):h[w]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?zs:mp,this.isPropagationStopped=mp,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=zs)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=zs)},persist:function(){},isPersistent:zs}),t}var Ci={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bs=nn(Ci),ar=v({},Ci,{view:0,detail:0}),LS=nn(ar),Jc,eu,ir,_s=v({},ar,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ir&&(ir&&e.type==="mousemove"?(Jc=e.screenX-ir.screenX,eu=e.screenY-ir.screenY):eu=Jc=0,ir=e),Jc)},movementY:function(e){return"movementY"in e?e.movementY:eu}}),pp=nn(_s),OS=v({},_s,{dataTransfer:0}),US=nn(OS),zS=v({},ar,{relatedTarget:0}),tu=nn(zS),BS=v({},Ci,{animationName:0,elapsedTime:0,pseudoElement:0}),_S=nn(BS),FS=v({},Ci,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qS=nn(FS),HS=v({},Ci,{data:0}),gp=nn(HS),PS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kS={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"},IS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function VS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=IS[e])?!!t[e]:!1}function nu(){return VS}var GS=v({},ar,{key:function(e){if(e.key){var t=PS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Us(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?kS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nu,charCode:function(e){return e.type==="keypress"?Us(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Us(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),YS=nn(GS),XS=v({},_s,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vp=nn(XS),QS=v({},ar,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nu}),KS=nn(QS),ZS=v({},Ci,{propertyName:0,elapsedTime:0,pseudoElement:0}),WS=nn(ZS),JS=v({},_s,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),e2=nn(JS),t2=v({},Ci,{newState:0,oldState:0}),n2=nn(t2),a2=[9,13,27,32],au=Ca&&"CompositionEvent"in window,lr=null;Ca&&"documentMode"in document&&(lr=document.documentMode);var i2=Ca&&"TextEvent"in window&&!lr,bp=Ca&&(!au||lr&&8<lr&&11>=lr),yp=" ",xp=!1;function jp(e,t){switch(e){case"keyup":return a2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var al=!1;function l2(e,t){switch(e){case"compositionend":return Sp(t);case"keypress":return t.which!==32?null:(xp=!0,yp);case"textInput":return e=t.data,e===yp&&xp?null:e;default:return null}}function r2(e,t){if(al)return e==="compositionend"||!au&&jp(e,t)?(e=hp(),Os=Wc=Ia=null,al=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return bp&&t.locale!=="ko"?null:t.data;default:return null}}var s2={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 wp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!s2[e.type]:t==="textarea"}function Cp(e,t,i,r){tl?nl?nl.push(r):nl=[r]:tl=r,t=Eo(t,"onChange"),0<t.length&&(i=new Bs("onChange","change",null,i,r),e.push({event:i,listeners:t}))}var rr=null,sr=null;function o2(e){i0(e,0)}function Fs(e){var t=Ce(e);if(lp(t))return e}function Ep(e,t){if(e==="change")return t}var Dp=!1;if(Ca){var iu;if(Ca){var lu="oninput"in document;if(!lu){var Tp=document.createElement("div");Tp.setAttribute("oninput","return;"),lu=typeof Tp.oninput=="function"}iu=lu}else iu=!1;Dp=iu&&(!document.documentMode||9<document.documentMode)}function Rp(){rr&&(rr.detachEvent("onpropertychange",Np),sr=rr=null)}function Np(e){if(e.propertyName==="value"&&Fs(sr)){var t=[];Cp(t,sr,e,Qc(e)),fp(o2,t)}}function c2(e,t,i){e==="focusin"?(Rp(),rr=t,sr=i,rr.attachEvent("onpropertychange",Np)):e==="focusout"&&Rp()}function u2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Fs(sr)}function d2(e,t){if(e==="click")return Fs(t)}function f2(e,t){if(e==="input"||e==="change")return Fs(t)}function h2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mn=typeof Object.is=="function"?Object.is:h2;function or(e,t){if(mn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(r=0;r<i.length;r++){var u=i[r];if(!ke.call(t,u)||!mn(e[u],t[u]))return!1}return!0}function Mp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ap(e,t){var i=Mp(e);e=0;for(var r;i;){if(i.nodeType===3){if(r=e+i.textContent.length,e<=t&&r>=t)return{node:i,offset:t-e};e=r}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Mp(i)}}function $p(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$p(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=$s(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=$s(e.document)}return t}function ru(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var m2=Ca&&"documentMode"in document&&11>=document.documentMode,il=null,su=null,cr=null,ou=!1;function Op(e,t,i){var r=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ou||il==null||il!==$s(r)||(r=il,"selectionStart"in r&&ru(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),cr&&or(cr,r)||(cr=r,r=Eo(su,"onSelect"),0<r.length&&(t=new Bs("onSelect","select",null,t,i),e.push({event:t,listeners:r}),t.target=il)))}function Ei(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var ll={animationend:Ei("Animation","AnimationEnd"),animationiteration:Ei("Animation","AnimationIteration"),animationstart:Ei("Animation","AnimationStart"),transitionrun:Ei("Transition","TransitionRun"),transitionstart:Ei("Transition","TransitionStart"),transitioncancel:Ei("Transition","TransitionCancel"),transitionend:Ei("Transition","TransitionEnd")},cu={},Up={};Ca&&(Up=document.createElement("div").style,"AnimationEvent"in window||(delete ll.animationend.animation,delete ll.animationiteration.animation,delete ll.animationstart.animation),"TransitionEvent"in window||delete ll.transitionend.transition);function Di(e){if(cu[e])return cu[e];if(!ll[e])return e;var t=ll[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Up)return cu[e]=t[i];return e}var zp=Di("animationend"),Bp=Di("animationiteration"),_p=Di("animationstart"),p2=Di("transitionrun"),g2=Di("transitionstart"),v2=Di("transitioncancel"),Fp=Di("transitionend"),qp=new Map,uu="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(" ");uu.push("scrollEnd");function Pn(e,t){qp.set(e,t),Ie(t,[e])}var Hp=new WeakMap;function Mn(e,t){if(typeof e=="object"&&e!==null){var i=Hp.get(e);return i!==void 0?i:(t={value:e,source:t,stack:wa(t)},Hp.set(e,t),t)}return{value:e,source:t,stack:wa(t)}}var An=[],rl=0,du=0;function qs(){for(var e=rl,t=du=rl=0;t<e;){var i=An[t];An[t++]=null;var r=An[t];An[t++]=null;var u=An[t];An[t++]=null;var h=An[t];if(An[t++]=null,r!==null&&u!==null){var y=r.pending;y===null?u.next=u:(u.next=y.next,y.next=u),r.pending=u}h!==0&&Pp(i,u,h)}}function Hs(e,t,i,r){An[rl++]=e,An[rl++]=t,An[rl++]=i,An[rl++]=r,du|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function fu(e,t,i,r){return Hs(e,t,i,r),Ps(e)}function sl(e,t){return Hs(e,null,null,t),Ps(e)}function Pp(e,t,i){e.lanes|=i;var r=e.alternate;r!==null&&(r.lanes|=i);for(var u=!1,h=e.return;h!==null;)h.childLanes|=i,r=h.alternate,r!==null&&(r.childLanes|=i),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&t!==null&&(u=31-Ve(i),e=h.hiddenUpdates,r=e[u],r===null?e[u]=[t]:r.push(t),t.lane=i|536870912),h):null}function Ps(e){if(50<Or)throw Or=0,bd=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ol={};function b2(e,t,i,r){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pn(e,t,i,r){return new b2(e,t,i,r)}function hu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ea(e,t){var i=e.alternate;return i===null?(i=pn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function kp(e,t){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ks(e,t,i,r,u,h){var y=0;if(r=e,typeof e=="function")hu(e)&&(y=1);else if(typeof e=="string")y=xw(e,i,Se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Q:return e=pn(31,i,t,u),e.elementType=Q,e.lanes=h,e;case D:return Ti(i.children,u,h,t);case S:y=8,u|=24;break;case R:return e=pn(12,i,t,u|2),e.elementType=R,e.lanes=h,e;case V:return e=pn(13,i,t,u),e.elementType=V,e.lanes=h,e;case K:return e=pn(19,i,t,u),e.elementType=K,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E:case B:y=10;break e;case A:y=9;break e;case H:y=11;break e;case T:y=14;break e;case O:y=16,r=null;break e}y=29,i=Error(o(130,e===null?"null":typeof e,"")),r=null}return t=pn(y,i,t,u),t.elementType=e,t.type=r,t.lanes=h,t}function Ti(e,t,i,r){return e=pn(7,e,r,t),e.lanes=i,e}function mu(e,t,i){return e=pn(6,e,null,t),e.lanes=i,e}function pu(e,t,i){return t=pn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var cl=[],ul=0,Is=null,Vs=0,$n=[],Ln=0,Ri=null,Da=1,Ta="";function Ni(e,t){cl[ul++]=Vs,cl[ul++]=Is,Is=e,Vs=t}function Ip(e,t,i){$n[Ln++]=Da,$n[Ln++]=Ta,$n[Ln++]=Ri,Ri=e;var r=Da;e=Ta;var u=32-Ve(r)-1;r&=~(1<<u),i+=1;var h=32-Ve(t)+u;if(30<h){var y=u-u%5;h=(r&(1<<y)-1).toString(32),r>>=y,u-=y,Da=1<<32-Ve(t)+u|i<<u|r,Ta=h+e}else Da=1<<h|i<<u|r,Ta=e}function gu(e){e.return!==null&&(Ni(e,1),Ip(e,1,0))}function vu(e){for(;e===Is;)Is=cl[--ul],cl[ul]=null,Vs=cl[--ul],cl[ul]=null;for(;e===Ri;)Ri=$n[--Ln],$n[Ln]=null,Ta=$n[--Ln],$n[Ln]=null,Da=$n[--Ln],$n[Ln]=null}var Zt=null,ht=null,He=!1,Mi=null,ra=!1,bu=Error(o(519));function Ai(e){var t=Error(o(418,""));throw fr(Mn(t,e)),bu}function Vp(e){var t=e.stateNode,i=e.type,r=e.memoizedProps;switch(t[M]=e,t[L]=r,i){case"dialog":Le("cancel",t),Le("close",t);break;case"iframe":case"object":case"embed":Le("load",t);break;case"video":case"audio":for(i=0;i<zr.length;i++)Le(zr[i],t);break;case"source":Le("error",t);break;case"img":case"image":case"link":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"input":Le("invalid",t),rp(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),As(t);break;case"select":Le("invalid",t);break;case"textarea":Le("invalid",t),op(t,r.value,r.defaultValue,r.children),As(t)}i=r.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||r.suppressHydrationWarning===!0||o0(t.textContent,i)?(r.popover!=null&&(Le("beforetoggle",t),Le("toggle",t)),r.onScroll!=null&&Le("scroll",t),r.onScrollEnd!=null&&Le("scrollend",t),r.onClick!=null&&(t.onclick=Do),t=!0):t=!1,t||Ai(e)}function Gp(e){for(Zt=e.return;Zt;)switch(Zt.tag){case 5:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:Zt=Zt.return}}function ur(e){if(e!==Zt)return!1;if(!He)return Gp(e),He=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Od(e.type,e.memoizedProps)),i=!i),i&&ht&&Ai(e),Gp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(i=e.data,i==="/$"){if(t===0){ht=In(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++;e=e.nextSibling}ht=null}}else t===27?(t=ht,ri(e.type)?(e=_d,_d=null,ht=e):ht=t):ht=Zt?In(e.stateNode.nextSibling):null;return!0}function dr(){ht=Zt=null,He=!1}function Yp(){var e=Mi;return e!==null&&(rn===null?rn=e:rn.push.apply(rn,e),Mi=null),e}function fr(e){Mi===null?Mi=[e]:Mi.push(e)}var yu=ge(null),$i=null,Ra=null;function Va(e,t,i){ce(yu,t._currentValue),t._currentValue=i}function Na(e){e._currentValue=yu.current,ie(yu)}function xu(e,t,i){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===i)break;e=e.return}}function ju(e,t,i,r){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var y=u.child;h=h.firstContext;e:for(;h!==null;){var w=h;h=u;for(var N=0;N<t.length;N++)if(w.context===t[N]){h.lanes|=i,w=h.alternate,w!==null&&(w.lanes|=i),xu(h.return,i,e),r||(y=null);break e}h=w.next}}else if(u.tag===18){if(y=u.return,y===null)throw Error(o(341));y.lanes|=i,h=y.alternate,h!==null&&(h.lanes|=i),xu(y,i,e),y=null}else y=u.child;if(y!==null)y.return=u;else for(y=u;y!==null;){if(y===e){y=null;break}if(u=y.sibling,u!==null){u.return=y.return,y=u;break}y=y.return}u=y}}function hr(e,t,i,r){e=null;for(var u=t,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var y=u.alternate;if(y===null)throw Error(o(387));if(y=y.memoizedProps,y!==null){var w=u.type;mn(u.pendingProps.value,y.value)||(e!==null?e.push(w):e=[w])}}else if(u===Ot.current){if(y=u.alternate,y===null)throw Error(o(387));y.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Pr):e=[Pr])}u=u.return}e!==null&&ju(t,e,i,r),t.flags|=262144}function Gs(e){for(e=e.firstContext;e!==null;){if(!mn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Li(e){$i=e,Ra=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gt(e){return Xp($i,e)}function Ys(e,t){return $i===null&&Li(e),Xp(e,t)}function Xp(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ra===null){if(e===null)throw Error(o(308));Ra=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ra=Ra.next=t;return i}var y2=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},x2=a.unstable_scheduleCallback,j2=a.unstable_NormalPriority,wt={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Su(){return{controller:new y2,data:new Map,refCount:0}}function mr(e){e.refCount--,e.refCount===0&&x2(j2,function(){e.controller.abort()})}var pr=null,wu=0,dl=0,fl=null;function S2(e,t){if(pr===null){var i=pr=[];wu=0,dl=Ed(),fl={status:"pending",value:void 0,then:function(r){i.push(r)}}}return wu++,t.then(Qp,Qp),t}function Qp(){if(--wu===0&&pr!==null){fl!==null&&(fl.status="fulfilled");var e=pr;pr=null,dl=0,fl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function w2(e,t){var i=[],r={status:"pending",value:null,reason:null,then:function(u){i.push(u)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var u=0;u<i.length;u++)(0,i[u])(t)},function(u){for(r.status="rejected",r.reason=u,u=0;u<i.length;u++)(0,i[u])(void 0)}),r}var Kp=U.S;U.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&S2(e,t),Kp!==null&&Kp(e,t)};var Oi=ge(null);function Cu(){var e=Oi.current;return e!==null?e:at.pooledCache}function Xs(e,t){t===null?ce(Oi,Oi.current):ce(Oi,t.pool)}function Zp(){var e=Cu();return e===null?null:{parent:wt._currentValue,pool:e}}var gr=Error(o(460)),Wp=Error(o(474)),Qs=Error(o(542)),Eu={then:function(){}};function Jp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ks(){}function eg(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Ks,Ks),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ng(e),e;default:if(typeof t.status=="string")t.then(Ks,Ks);else{if(e=at,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=r}},function(r){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ng(e),e}throw vr=t,gr}}var vr=null;function tg(){if(vr===null)throw Error(o(459));var e=vr;return vr=null,e}function ng(e){if(e===gr||e===Qs)throw Error(o(483))}var Ga=!1;function Du(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ya(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xa(e,t,i){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Xe&2)!==0){var u=r.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),r.pending=t,t=Ps(e),Pp(e,null,i),t}return Hs(e,r,t,i),Ps(e)}function br(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,dn(e,i)}}function Ru(e,t){var i=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,i===r)){var u=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var y={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};h===null?u=h=y:h=h.next=y,i=i.next}while(i!==null);h===null?u=h=t:h=h.next=t}else u=h=t;i={baseState:r.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:r.shared,callbacks:r.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Nu=!1;function yr(){if(Nu){var e=fl;if(e!==null)throw e}}function xr(e,t,i,r){Nu=!1;var u=e.updateQueue;Ga=!1;var h=u.firstBaseUpdate,y=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var N=w,F=N.next;N.next=null,y===null?h=F:y.next=F,y=N;var X=e.alternate;X!==null&&(X=X.updateQueue,w=X.lastBaseUpdate,w!==y&&(w===null?X.firstBaseUpdate=F:w.next=F,X.lastBaseUpdate=N))}if(h!==null){var J=u.baseState;y=0,X=F=N=null,w=h;do{var P=w.lane&-536870913,I=P!==w.lane;if(I?(Fe&P)===P:(r&P)===P){P!==0&&P===dl&&(Nu=!0),X!==null&&(X=X.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var we=e,ye=w;P=t;var et=i;switch(ye.tag){case 1:if(we=ye.payload,typeof we=="function"){J=we.call(et,J,P);break e}J=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=ye.payload,P=typeof we=="function"?we.call(et,J,P):we,P==null)break e;J=v({},J,P);break e;case 2:Ga=!0}}P=w.callback,P!==null&&(e.flags|=64,I&&(e.flags|=8192),I=u.callbacks,I===null?u.callbacks=[P]:I.push(P))}else I={lane:P,tag:w.tag,payload:w.payload,callback:w.callback,next:null},X===null?(F=X=I,N=J):X=X.next=I,y|=P;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;I=w,w=I.next,I.next=null,u.lastBaseUpdate=I,u.shared.pending=null}}while(!0);X===null&&(N=J),u.baseState=N,u.firstBaseUpdate=F,u.lastBaseUpdate=X,h===null&&(u.shared.lanes=0),ni|=y,e.lanes=y,e.memoizedState=J}}function ag(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function ig(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)ag(i[e],t)}var hl=ge(null),Zs=ge(0);function lg(e,t){e=za,ce(Zs,e),ce(hl,t),za=e|t.baseLanes}function Mu(){ce(Zs,za),ce(hl,hl.current)}function Au(){za=Zs.current,ie(hl),ie(Zs)}var Qa=0,Me=null,We=null,bt=null,Ws=!1,ml=!1,Ui=!1,Js=0,jr=0,pl=null,C2=0;function pt(){throw Error(o(321))}function $u(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!mn(e[i],t[i]))return!1;return!0}function Lu(e,t,i,r,u,h){return Qa=h,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Pg:kg,Ui=!1,h=i(r,u),Ui=!1,ml&&(h=sg(t,i,r,u)),rg(e),h}function rg(e){U.H=lo;var t=We!==null&&We.next!==null;if(Qa=0,bt=We=Me=null,Ws=!1,jr=0,pl=null,t)throw Error(o(300));e===null||Nt||(e=e.dependencies,e!==null&&Gs(e)&&(Nt=!0))}function sg(e,t,i,r){Me=e;var u=0;do{if(ml&&(pl=null),jr=0,ml=!1,25<=u)throw Error(o(301));if(u+=1,bt=We=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}U.H=A2,h=t(i,r)}while(ml);return h}function E2(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Sr(t):t,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(Me.flags|=1024),t}function Ou(){var e=Js!==0;return Js=0,e}function Uu(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function zu(e){if(Ws){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ws=!1}Qa=0,bt=We=Me=null,ml=!1,jr=Js=0,pl=null}function an(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Me.memoizedState=bt=e:bt=bt.next=e,bt}function yt(){if(We===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=bt===null?Me.memoizedState:bt.next;if(t!==null)bt=t,We=e;else{if(e===null)throw Me.alternate===null?Error(o(467)):Error(o(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},bt===null?Me.memoizedState=bt=e:bt=bt.next=e}return bt}function Bu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sr(e){var t=jr;return jr+=1,pl===null&&(pl=[]),e=eg(pl,e,t),t=Me,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Pg:kg),e}function eo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Sr(e);if(e.$$typeof===B)return Gt(e)}throw Error(o(438,String(e)))}function _u(e){var t=null,i=Me.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var r=Me.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Bu(),Me.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),r=0;r<e;r++)i[r]=te;return t.index++,i}function Ma(e,t){return typeof t=="function"?t(e):t}function to(e){var t=yt();return Fu(t,We,e)}function Fu(e,t,i){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=i;var u=e.baseQueue,h=r.pending;if(h!==null){if(u!==null){var y=u.next;u.next=h.next,h.next=y}t.baseQueue=u=h,r.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{t=u.next;var w=y=null,N=null,F=t,X=!1;do{var J=F.lane&-536870913;if(J!==F.lane?(Fe&J)===J:(Qa&J)===J){var P=F.revertLane;if(P===0)N!==null&&(N=N.next={lane:0,revertLane:0,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),J===dl&&(X=!0);else if((Qa&P)===P){F=F.next,P===dl&&(X=!0);continue}else J={lane:0,revertLane:F.revertLane,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},N===null?(w=N=J,y=h):N=N.next=J,Me.lanes|=P,ni|=P;J=F.action,Ui&&i(h,J),h=F.hasEagerState?F.eagerState:i(h,J)}else P={lane:J,revertLane:F.revertLane,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},N===null?(w=N=P,y=h):N=N.next=P,Me.lanes|=J,ni|=J;F=F.next}while(F!==null&&F!==t);if(N===null?y=h:N.next=w,!mn(h,e.memoizedState)&&(Nt=!0,X&&(i=fl,i!==null)))throw i;e.memoizedState=h,e.baseState=y,e.baseQueue=N,r.lastRenderedState=h}return u===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function qu(e){var t=yt(),i=t.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var r=i.dispatch,u=i.pending,h=t.memoizedState;if(u!==null){i.pending=null;var y=u=u.next;do h=e(h,y.action),y=y.next;while(y!==u);mn(h,t.memoizedState)||(Nt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),i.lastRenderedState=h}return[h,r]}function og(e,t,i){var r=Me,u=yt(),h=He;if(h){if(i===void 0)throw Error(o(407));i=i()}else i=t();var y=!mn((We||u).memoizedState,i);y&&(u.memoizedState=i,Nt=!0),u=u.queue;var w=dg.bind(null,r,u,e);if(wr(2048,8,w,[e]),u.getSnapshot!==t||y||bt!==null&&bt.memoizedState.tag&1){if(r.flags|=2048,gl(9,no(),ug.bind(null,r,u,i,t),null),at===null)throw Error(o(349));h||(Qa&124)!==0||cg(r,t,i)}return i}function cg(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Me.updateQueue,t===null?(t=Bu(),Me.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function ug(e,t,i,r){t.value=i,t.getSnapshot=r,fg(t)&&hg(e)}function dg(e,t,i){return i(function(){fg(t)&&hg(e)})}function fg(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!mn(e,i)}catch{return!0}}function hg(e){var t=sl(e,2);t!==null&&xn(t,e,2)}function Hu(e){var t=an();if(typeof e=="function"){var i=e;if(e=i(),Ui){st(!0);try{i()}finally{st(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:e},t}function mg(e,t,i,r){return e.baseState=i,Fu(e,We,typeof r=="function"?r:Ma)}function D2(e,t,i,r,u){if(io(e))throw Error(o(485));if(e=t.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){h.listeners.push(y)}};U.T!==null?i(!0):h.isTransition=!1,r(h),i=t.pending,i===null?(h.next=t.pending=h,pg(t,h)):(h.next=i.next,t.pending=i.next=h)}}function pg(e,t){var i=t.action,r=t.payload,u=e.state;if(t.isTransition){var h=U.T,y={};U.T=y;try{var w=i(u,r),N=U.S;N!==null&&N(y,w),gg(e,t,w)}catch(F){Pu(e,t,F)}finally{U.T=h}}else try{h=i(u,r),gg(e,t,h)}catch(F){Pu(e,t,F)}}function gg(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(r){vg(e,t,r)},function(r){return Pu(e,t,r)}):vg(e,t,i)}function vg(e,t,i){t.status="fulfilled",t.value=i,bg(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,pg(e,i)))}function Pu(e,t,i){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=i,bg(t),t=t.next;while(t!==r)}e.action=null}function bg(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function yg(e,t){return t}function xg(e,t){if(He){var i=at.formState;if(i!==null){e:{var r=Me;if(He){if(ht){t:{for(var u=ht,h=ra;u.nodeType!==8;){if(!h){u=null;break t}if(u=In(u.nextSibling),u===null){u=null;break t}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){ht=In(u.nextSibling),r=u.data==="F!";break e}}Ai(r)}r=!1}r&&(t=i[0])}}return i=an(),i.memoizedState=i.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yg,lastRenderedState:t},i.queue=r,i=Fg.bind(null,Me,r),r.dispatch=i,r=Hu(!1),h=Yu.bind(null,Me,!1,r.queue),r=an(),u={state:t,dispatch:null,action:e,pending:null},r.queue=u,i=D2.bind(null,Me,u,h,i),u.dispatch=i,r.memoizedState=e,[t,i,!1]}function jg(e){var t=yt();return Sg(t,We,e)}function Sg(e,t,i){if(t=Fu(e,t,yg)[0],e=to(Ma)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Sr(t)}catch(y){throw y===gr?Qs:y}else r=t;t=yt();var u=t.queue,h=u.dispatch;return i!==t.memoizedState&&(Me.flags|=2048,gl(9,no(),T2.bind(null,u,i),null)),[r,h,e]}function T2(e,t){e.action=t}function wg(e){var t=yt(),i=We;if(i!==null)return Sg(t,i,e);yt(),t=t.memoizedState,i=yt();var r=i.queue.dispatch;return i.memoizedState=e,[t,r,!1]}function gl(e,t,i,r){return e={tag:e,create:i,deps:r,inst:t,next:null},t=Me.updateQueue,t===null&&(t=Bu(),Me.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(r=i.next,i.next=e,e.next=r,t.lastEffect=e),e}function no(){return{destroy:void 0,resource:void 0}}function Cg(){return yt().memoizedState}function ao(e,t,i,r){var u=an();r=r===void 0?null:r,Me.flags|=e,u.memoizedState=gl(1|t,no(),i,r)}function wr(e,t,i,r){var u=yt();r=r===void 0?null:r;var h=u.memoizedState.inst;We!==null&&r!==null&&$u(r,We.memoizedState.deps)?u.memoizedState=gl(t,h,i,r):(Me.flags|=e,u.memoizedState=gl(1|t,h,i,r))}function Eg(e,t){ao(8390656,8,e,t)}function Dg(e,t){wr(2048,8,e,t)}function Tg(e,t){return wr(4,2,e,t)}function Rg(e,t){return wr(4,4,e,t)}function Ng(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Mg(e,t,i){i=i!=null?i.concat([e]):null,wr(4,4,Ng.bind(null,t,e),i)}function ku(){}function Ag(e,t){var i=yt();t=t===void 0?null:t;var r=i.memoizedState;return t!==null&&$u(t,r[1])?r[0]:(i.memoizedState=[e,t],e)}function $g(e,t){var i=yt();t=t===void 0?null:t;var r=i.memoizedState;if(t!==null&&$u(t,r[1]))return r[0];if(r=e(),Ui){st(!0);try{e()}finally{st(!1)}}return i.memoizedState=[r,t],r}function Iu(e,t,i){return i===void 0||(Qa&1073741824)!==0?e.memoizedState=t:(e.memoizedState=i,e=Uv(),Me.lanes|=e,ni|=e,i)}function Lg(e,t,i,r){return mn(i,t)?i:hl.current!==null?(e=Iu(e,i,r),mn(e,t)||(Nt=!0),e):(Qa&42)===0?(Nt=!0,e.memoizedState=i):(e=Uv(),Me.lanes|=e,ni|=e,t)}function Og(e,t,i,r,u){var h=k.p;k.p=h!==0&&8>h?h:8;var y=U.T,w={};U.T=w,Yu(e,!1,t,i);try{var N=u(),F=U.S;if(F!==null&&F(w,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var X=w2(N,r);Cr(e,t,X,yn(e))}else Cr(e,t,r,yn(e))}catch(J){Cr(e,t,{then:function(){},status:"rejected",reason:J},yn())}finally{k.p=h,U.T=y}}function R2(){}function Vu(e,t,i,r){if(e.tag!==5)throw Error(o(476));var u=Ug(e).queue;Og(e,u,t,Y,i===null?R2:function(){return zg(e),i(r)})}function Ug(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:Y},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zg(e){var t=Ug(e).next.queue;Cr(e,t,{},yn())}function Gu(){return Gt(Pr)}function Bg(){return yt().memoizedState}function _g(){return yt().memoizedState}function N2(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=yn();e=Ya(i);var r=Xa(t,e,i);r!==null&&(xn(r,t,i),br(r,t,i)),t={cache:Su()},e.payload=t;return}t=t.return}}function M2(e,t,i){var r=yn();i={lane:r,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null},io(e)?qg(t,i):(i=fu(e,t,i,r),i!==null&&(xn(i,e,r),Hg(i,t,r)))}function Fg(e,t,i){var r=yn();Cr(e,t,i,r)}function Cr(e,t,i,r){var u={lane:r,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null};if(io(e))qg(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var y=t.lastRenderedState,w=h(y,i);if(u.hasEagerState=!0,u.eagerState=w,mn(w,y))return Hs(e,t,u,0),at===null&&qs(),!1}catch{}finally{}if(i=fu(e,t,u,r),i!==null)return xn(i,e,r),Hg(i,t,r),!0}return!1}function Yu(e,t,i,r){if(r={lane:2,revertLane:Ed(),action:r,hasEagerState:!1,eagerState:null,next:null},io(e)){if(t)throw Error(o(479))}else t=fu(e,i,r,2),t!==null&&xn(t,e,2)}function io(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function qg(e,t){ml=Ws=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Hg(e,t,i){if((i&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,dn(e,i)}}var lo={readContext:Gt,use:eo,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt},Pg={readContext:Gt,use:eo,useCallback:function(e,t){return an().memoizedState=[e,t===void 0?null:t],e},useContext:Gt,useEffect:Eg,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,ao(4194308,4,Ng.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ao(4194308,4,e,t)},useInsertionEffect:function(e,t){ao(4,2,e,t)},useMemo:function(e,t){var i=an();t=t===void 0?null:t;var r=e();if(Ui){st(!0);try{e()}finally{st(!1)}}return i.memoizedState=[r,t],r},useReducer:function(e,t,i){var r=an();if(i!==void 0){var u=i(t);if(Ui){st(!0);try{i(t)}finally{st(!1)}}}else u=t;return r.memoizedState=r.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},r.queue=e,e=e.dispatch=M2.bind(null,Me,e),[r.memoizedState,e]},useRef:function(e){var t=an();return e={current:e},t.memoizedState=e},useState:function(e){e=Hu(e);var t=e.queue,i=Fg.bind(null,Me,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:ku,useDeferredValue:function(e,t){var i=an();return Iu(i,e,t)},useTransition:function(){var e=Hu(!1);return e=Og.bind(null,Me,e.queue,!0,!1),an().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var r=Me,u=an();if(He){if(i===void 0)throw Error(o(407));i=i()}else{if(i=t(),at===null)throw Error(o(349));(Fe&124)!==0||cg(r,t,i)}u.memoizedState=i;var h={value:i,getSnapshot:t};return u.queue=h,Eg(dg.bind(null,r,h,e),[e]),r.flags|=2048,gl(9,no(),ug.bind(null,r,h,i,t),null),i},useId:function(){var e=an(),t=at.identifierPrefix;if(He){var i=Ta,r=Da;i=(r&~(1<<32-Ve(r)-1)).toString(32)+i,t="«"+t+"R"+i,i=Js++,0<i&&(t+="H"+i.toString(32)),t+="»"}else i=C2++,t="«"+t+"r"+i.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Gu,useFormState:xg,useActionState:xg,useOptimistic:function(e){var t=an();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Yu.bind(null,Me,!0,i),i.dispatch=t,[e,t]},useMemoCache:_u,useCacheRefresh:function(){return an().memoizedState=N2.bind(null,Me)}},kg={readContext:Gt,use:eo,useCallback:Ag,useContext:Gt,useEffect:Dg,useImperativeHandle:Mg,useInsertionEffect:Tg,useLayoutEffect:Rg,useMemo:$g,useReducer:to,useRef:Cg,useState:function(){return to(Ma)},useDebugValue:ku,useDeferredValue:function(e,t){var i=yt();return Lg(i,We.memoizedState,e,t)},useTransition:function(){var e=to(Ma)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Sr(e),t]},useSyncExternalStore:og,useId:Bg,useHostTransitionStatus:Gu,useFormState:jg,useActionState:jg,useOptimistic:function(e,t){var i=yt();return mg(i,We,e,t)},useMemoCache:_u,useCacheRefresh:_g},A2={readContext:Gt,use:eo,useCallback:Ag,useContext:Gt,useEffect:Dg,useImperativeHandle:Mg,useInsertionEffect:Tg,useLayoutEffect:Rg,useMemo:$g,useReducer:qu,useRef:Cg,useState:function(){return qu(Ma)},useDebugValue:ku,useDeferredValue:function(e,t){var i=yt();return We===null?Iu(i,e,t):Lg(i,We.memoizedState,e,t)},useTransition:function(){var e=qu(Ma)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Sr(e),t]},useSyncExternalStore:og,useId:Bg,useHostTransitionStatus:Gu,useFormState:wg,useActionState:wg,useOptimistic:function(e,t){var i=yt();return We!==null?mg(i,We,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:_u,useCacheRefresh:_g},vl=null,Er=0;function ro(e){var t=Er;return Er+=1,vl===null&&(vl=[]),eg(vl,e,t)}function Dr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function so(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ig(e){var t=e._init;return t(e._payload)}function Vg(e){function t(z,$){if(e){var _=z.deletions;_===null?(z.deletions=[$],z.flags|=16):_.push($)}}function i(z,$){if(!e)return null;for(;$!==null;)t(z,$),$=$.sibling;return null}function r(z){for(var $=new Map;z!==null;)z.key!==null?$.set(z.key,z):$.set(z.index,z),z=z.sibling;return $}function u(z,$){return z=Ea(z,$),z.index=0,z.sibling=null,z}function h(z,$,_){return z.index=_,e?(_=z.alternate,_!==null?(_=_.index,_<$?(z.flags|=67108866,$):_):(z.flags|=67108866,$)):(z.flags|=1048576,$)}function y(z){return e&&z.alternate===null&&(z.flags|=67108866),z}function w(z,$,_,Z){return $===null||$.tag!==6?($=mu(_,z.mode,Z),$.return=z,$):($=u($,_),$.return=z,$)}function N(z,$,_,Z){var pe=_.type;return pe===D?X(z,$,_.props.children,Z,_.key):$!==null&&($.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===O&&Ig(pe)===$.type)?($=u($,_.props),Dr($,_),$.return=z,$):($=ks(_.type,_.key,_.props,null,z.mode,Z),Dr($,_),$.return=z,$)}function F(z,$,_,Z){return $===null||$.tag!==4||$.stateNode.containerInfo!==_.containerInfo||$.stateNode.implementation!==_.implementation?($=pu(_,z.mode,Z),$.return=z,$):($=u($,_.children||[]),$.return=z,$)}function X(z,$,_,Z,pe){return $===null||$.tag!==7?($=Ti(_,z.mode,Z,pe),$.return=z,$):($=u($,_),$.return=z,$)}function J(z,$,_){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=mu(""+$,z.mode,_),$.return=z,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case x:return _=ks($.type,$.key,$.props,null,z.mode,_),Dr(_,$),_.return=z,_;case j:return $=pu($,z.mode,_),$.return=z,$;case O:var Z=$._init;return $=Z($._payload),J(z,$,_)}if(W($)||se($))return $=Ti($,z.mode,_,null),$.return=z,$;if(typeof $.then=="function")return J(z,ro($),_);if($.$$typeof===B)return J(z,Ys(z,$),_);so(z,$)}return null}function P(z,$,_,Z){var pe=$!==null?$.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return pe!==null?null:w(z,$,""+_,Z);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case x:return _.key===pe?N(z,$,_,Z):null;case j:return _.key===pe?F(z,$,_,Z):null;case O:return pe=_._init,_=pe(_._payload),P(z,$,_,Z)}if(W(_)||se(_))return pe!==null?null:X(z,$,_,Z,null);if(typeof _.then=="function")return P(z,$,ro(_),Z);if(_.$$typeof===B)return P(z,$,Ys(z,_),Z);so(z,_)}return null}function I(z,$,_,Z,pe){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return z=z.get(_)||null,w($,z,""+Z,pe);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case x:return z=z.get(Z.key===null?_:Z.key)||null,N($,z,Z,pe);case j:return z=z.get(Z.key===null?_:Z.key)||null,F($,z,Z,pe);case O:var Ae=Z._init;return Z=Ae(Z._payload),I(z,$,_,Z,pe)}if(W(Z)||se(Z))return z=z.get(_)||null,X($,z,Z,pe,null);if(typeof Z.then=="function")return I(z,$,_,ro(Z),pe);if(Z.$$typeof===B)return I(z,$,_,Ys($,Z),pe);so($,Z)}return null}function we(z,$,_,Z){for(var pe=null,Ae=null,ve=$,xe=$=0,At=null;ve!==null&&xe<_.length;xe++){ve.index>xe?(At=ve,ve=null):At=ve.sibling;var qe=P(z,ve,_[xe],Z);if(qe===null){ve===null&&(ve=At);break}e&&ve&&qe.alternate===null&&t(z,ve),$=h(qe,$,xe),Ae===null?pe=qe:Ae.sibling=qe,Ae=qe,ve=At}if(xe===_.length)return i(z,ve),He&&Ni(z,xe),pe;if(ve===null){for(;xe<_.length;xe++)ve=J(z,_[xe],Z),ve!==null&&($=h(ve,$,xe),Ae===null?pe=ve:Ae.sibling=ve,Ae=ve);return He&&Ni(z,xe),pe}for(ve=r(ve);xe<_.length;xe++)At=I(ve,z,xe,_[xe],Z),At!==null&&(e&&At.alternate!==null&&ve.delete(At.key===null?xe:At.key),$=h(At,$,xe),Ae===null?pe=At:Ae.sibling=At,Ae=At);return e&&ve.forEach(function(di){return t(z,di)}),He&&Ni(z,xe),pe}function ye(z,$,_,Z){if(_==null)throw Error(o(151));for(var pe=null,Ae=null,ve=$,xe=$=0,At=null,qe=_.next();ve!==null&&!qe.done;xe++,qe=_.next()){ve.index>xe?(At=ve,ve=null):At=ve.sibling;var di=P(z,ve,qe.value,Z);if(di===null){ve===null&&(ve=At);break}e&&ve&&di.alternate===null&&t(z,ve),$=h(di,$,xe),Ae===null?pe=di:Ae.sibling=di,Ae=di,ve=At}if(qe.done)return i(z,ve),He&&Ni(z,xe),pe;if(ve===null){for(;!qe.done;xe++,qe=_.next())qe=J(z,qe.value,Z),qe!==null&&($=h(qe,$,xe),Ae===null?pe=qe:Ae.sibling=qe,Ae=qe);return He&&Ni(z,xe),pe}for(ve=r(ve);!qe.done;xe++,qe=_.next())qe=I(ve,z,xe,qe.value,Z),qe!==null&&(e&&qe.alternate!==null&&ve.delete(qe.key===null?xe:qe.key),$=h(qe,$,xe),Ae===null?pe=qe:Ae.sibling=qe,Ae=qe);return e&&ve.forEach(function($w){return t(z,$w)}),He&&Ni(z,xe),pe}function et(z,$,_,Z){if(typeof _=="object"&&_!==null&&_.type===D&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case x:e:{for(var pe=_.key;$!==null;){if($.key===pe){if(pe=_.type,pe===D){if($.tag===7){i(z,$.sibling),Z=u($,_.props.children),Z.return=z,z=Z;break e}}else if($.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===O&&Ig(pe)===$.type){i(z,$.sibling),Z=u($,_.props),Dr(Z,_),Z.return=z,z=Z;break e}i(z,$);break}else t(z,$);$=$.sibling}_.type===D?(Z=Ti(_.props.children,z.mode,Z,_.key),Z.return=z,z=Z):(Z=ks(_.type,_.key,_.props,null,z.mode,Z),Dr(Z,_),Z.return=z,z=Z)}return y(z);case j:e:{for(pe=_.key;$!==null;){if($.key===pe)if($.tag===4&&$.stateNode.containerInfo===_.containerInfo&&$.stateNode.implementation===_.implementation){i(z,$.sibling),Z=u($,_.children||[]),Z.return=z,z=Z;break e}else{i(z,$);break}else t(z,$);$=$.sibling}Z=pu(_,z.mode,Z),Z.return=z,z=Z}return y(z);case O:return pe=_._init,_=pe(_._payload),et(z,$,_,Z)}if(W(_))return we(z,$,_,Z);if(se(_)){if(pe=se(_),typeof pe!="function")throw Error(o(150));return _=pe.call(_),ye(z,$,_,Z)}if(typeof _.then=="function")return et(z,$,ro(_),Z);if(_.$$typeof===B)return et(z,$,Ys(z,_),Z);so(z,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,$!==null&&$.tag===6?(i(z,$.sibling),Z=u($,_),Z.return=z,z=Z):(i(z,$),Z=mu(_,z.mode,Z),Z.return=z,z=Z),y(z)):i(z,$)}return function(z,$,_,Z){try{Er=0;var pe=et(z,$,_,Z);return vl=null,pe}catch(ve){if(ve===gr||ve===Qs)throw ve;var Ae=pn(29,ve,null,z.mode);return Ae.lanes=Z,Ae.return=z,Ae}finally{}}}var bl=Vg(!0),Gg=Vg(!1),On=ge(null),sa=null;function Ka(e){var t=e.alternate;ce(Ct,Ct.current&1),ce(On,e),sa===null&&(t===null||hl.current!==null||t.memoizedState!==null)&&(sa=e)}function Yg(e){if(e.tag===22){if(ce(Ct,Ct.current),ce(On,e),sa===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(sa=e)}}else Za()}function Za(){ce(Ct,Ct.current),ce(On,On.current)}function Aa(e){ie(On),sa===e&&(sa=null),ie(Ct)}var Ct=ge(0);function oo(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||Bd(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Xu(e,t,i,r){t=e.memoizedState,i=i(r,t),i=i==null?t:v({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Qu={enqueueSetState:function(e,t,i){e=e._reactInternals;var r=yn(),u=Ya(r);u.payload=t,i!=null&&(u.callback=i),t=Xa(e,u,r),t!==null&&(xn(t,e,r),br(t,e,r))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var r=yn(),u=Ya(r);u.tag=1,u.payload=t,i!=null&&(u.callback=i),t=Xa(e,u,r),t!==null&&(xn(t,e,r),br(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=yn(),r=Ya(i);r.tag=2,t!=null&&(r.callback=t),t=Xa(e,r,i),t!==null&&(xn(t,e,i),br(t,e,i))}};function Xg(e,t,i,r,u,h,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,h,y):t.prototype&&t.prototype.isPureReactComponent?!or(i,r)||!or(u,h):!0}function Qg(e,t,i,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,r),t.state!==e&&Qu.enqueueReplaceState(t,t.state,null)}function zi(e,t){var i=t;if("ref"in t){i={};for(var r in t)r!=="ref"&&(i[r]=t[r])}if(e=e.defaultProps){i===t&&(i=v({},i));for(var u in e)i[u]===void 0&&(i[u]=e[u])}return i}var co=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Kg(e){co(e)}function Zg(e){console.error(e)}function Wg(e){co(e)}function uo(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Jg(e,t,i){try{var r=e.onCaughtError;r(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Ku(e,t,i){return i=Ya(i),i.tag=3,i.payload={element:null},i.callback=function(){uo(e,t)},i}function ev(e){return e=Ya(e),e.tag=3,e}function tv(e,t,i,r){var u=i.type.getDerivedStateFromError;if(typeof u=="function"){var h=r.value;e.payload=function(){return u(h)},e.callback=function(){Jg(t,i,r)}}var y=i.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Jg(t,i,r),typeof u!="function"&&(ai===null?ai=new Set([this]):ai.add(this));var w=r.stack;this.componentDidCatch(r.value,{componentStack:w!==null?w:""})})}function $2(e,t,i,r,u){if(i.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=i.alternate,t!==null&&hr(t,i,u,!0),i=On.current,i!==null){switch(i.tag){case 13:return sa===null?xd():i.alternate===null&&mt===0&&(mt=3),i.flags&=-257,i.flags|=65536,i.lanes=u,r===Eu?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([r]):t.add(r),Sd(e,r,u)),!1;case 22:return i.flags|=65536,r===Eu?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([r]):i.add(r)),Sd(e,r,u)),!1}throw Error(o(435,i.tag))}return Sd(e,r,u),xd(),!1}if(He)return t=On.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,r!==bu&&(e=Error(o(422),{cause:r}),fr(Mn(e,i)))):(r!==bu&&(t=Error(o(423),{cause:r}),fr(Mn(t,i))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,r=Mn(r,i),u=Ku(e.stateNode,r,u),Ru(e,u),mt!==4&&(mt=2)),!1;var h=Error(o(520),{cause:r});if(h=Mn(h,i),Lr===null?Lr=[h]:Lr.push(h),mt!==4&&(mt=2),t===null)return!0;r=Mn(r,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=u&-u,i.lanes|=e,e=Ku(i.stateNode,r,e),Ru(i,e),!1;case 1:if(t=i.type,h=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(ai===null||!ai.has(h))))return i.flags|=65536,u&=-u,i.lanes|=u,u=ev(u),tv(u,e,i,r),Ru(i,u),!1}i=i.return}while(i!==null);return!1}var nv=Error(o(461)),Nt=!1;function Bt(e,t,i,r){t.child=e===null?Gg(t,null,i,r):bl(t,e.child,i,r)}function av(e,t,i,r,u){i=i.render;var h=t.ref;if("ref"in r){var y={};for(var w in r)w!=="ref"&&(y[w]=r[w])}else y=r;return Li(t),r=Lu(e,t,i,y,h,u),w=Ou(),e!==null&&!Nt?(Uu(e,t,u),$a(e,t,u)):(He&&w&&gu(t),t.flags|=1,Bt(e,t,r,u),t.child)}function iv(e,t,i,r,u){if(e===null){var h=i.type;return typeof h=="function"&&!hu(h)&&h.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=h,lv(e,t,h,r,u)):(e=ks(i.type,null,r,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!id(e,u)){var y=h.memoizedProps;if(i=i.compare,i=i!==null?i:or,i(y,r)&&e.ref===t.ref)return $a(e,t,u)}return t.flags|=1,e=Ea(h,r),e.ref=t.ref,e.return=t,t.child=e}function lv(e,t,i,r,u){if(e!==null){var h=e.memoizedProps;if(or(h,r)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=r=h,id(e,u))(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,$a(e,t,u)}return Zu(e,t,i,r,u)}function rv(e,t,i){var r=t.pendingProps,u=r.children,h=e!==null?e.memoizedState:null;if(r.mode==="hidden"){if((t.flags&128)!==0){if(r=h!==null?h.baseLanes|i:i,e!==null){for(u=t.child=e.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;t.childLanes=h&~r}else t.childLanes=0,t.child=null;return sv(e,t,r,i)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xs(t,h!==null?h.cachePool:null),h!==null?lg(t,h):Mu(),Yg(t);else return t.lanes=t.childLanes=536870912,sv(e,t,h!==null?h.baseLanes|i:i,i)}else h!==null?(Xs(t,h.cachePool),lg(t,h),Za(),t.memoizedState=null):(e!==null&&Xs(t,null),Mu(),Za());return Bt(e,t,u,i),t.child}function sv(e,t,i,r){var u=Cu();return u=u===null?null:{parent:wt._currentValue,pool:u},t.memoizedState={baseLanes:i,cachePool:u},e!==null&&Xs(t,null),Mu(),Yg(t),e!==null&&hr(e,t,r,!0),null}function fo(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Zu(e,t,i,r,u){return Li(t),i=Lu(e,t,i,r,void 0,u),r=Ou(),e!==null&&!Nt?(Uu(e,t,u),$a(e,t,u)):(He&&r&&gu(t),t.flags|=1,Bt(e,t,i,u),t.child)}function ov(e,t,i,r,u,h){return Li(t),t.updateQueue=null,i=sg(t,r,i,u),rg(e),r=Ou(),e!==null&&!Nt?(Uu(e,t,h),$a(e,t,h)):(He&&r&&gu(t),t.flags|=1,Bt(e,t,i,h),t.child)}function cv(e,t,i,r,u){if(Li(t),t.stateNode===null){var h=ol,y=i.contextType;typeof y=="object"&&y!==null&&(h=Gt(y)),h=new i(r,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Qu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=r,h.state=t.memoizedState,h.refs={},Du(t),y=i.contextType,h.context=typeof y=="object"&&y!==null?Gt(y):ol,h.state=t.memoizedState,y=i.getDerivedStateFromProps,typeof y=="function"&&(Xu(t,i,y,r),h.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(y=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),y!==h.state&&Qu.enqueueReplaceState(h,h.state,null),xr(t,r,h,u),yr(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){h=t.stateNode;var w=t.memoizedProps,N=zi(i,w);h.props=N;var F=h.context,X=i.contextType;y=ol,typeof X=="object"&&X!==null&&(y=Gt(X));var J=i.getDerivedStateFromProps;X=typeof J=="function"||typeof h.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,X||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(w||F!==y)&&Qg(t,h,r,y),Ga=!1;var P=t.memoizedState;h.state=P,xr(t,r,h,u),yr(),F=t.memoizedState,w||P!==F||Ga?(typeof J=="function"&&(Xu(t,i,J,r),F=t.memoizedState),(N=Ga||Xg(t,i,N,r,P,F,y))?(X||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=F),h.props=r,h.state=F,h.context=y,r=N):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{h=t.stateNode,Tu(e,t),y=t.memoizedProps,X=zi(i,y),h.props=X,J=t.pendingProps,P=h.context,F=i.contextType,N=ol,typeof F=="object"&&F!==null&&(N=Gt(F)),w=i.getDerivedStateFromProps,(F=typeof w=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(y!==J||P!==N)&&Qg(t,h,r,N),Ga=!1,P=t.memoizedState,h.state=P,xr(t,r,h,u),yr();var I=t.memoizedState;y!==J||P!==I||Ga||e!==null&&e.dependencies!==null&&Gs(e.dependencies)?(typeof w=="function"&&(Xu(t,i,w,r),I=t.memoizedState),(X=Ga||Xg(t,i,X,r,P,I,N)||e!==null&&e.dependencies!==null&&Gs(e.dependencies))?(F||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(r,I,N),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(r,I,N)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=I),h.props=r,h.state=I,h.context=N,r=X):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),r=!1)}return h=r,fo(e,t),r=(t.flags&128)!==0,h||r?(h=t.stateNode,i=r&&typeof i.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&r?(t.child=bl(t,e.child,null,u),t.child=bl(t,null,i,u)):Bt(e,t,i,u),t.memoizedState=h.state,e=t.child):e=$a(e,t,u),e}function uv(e,t,i,r){return dr(),t.flags|=256,Bt(e,t,i,r),t.child}var Wu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ju(e){return{baseLanes:e,cachePool:Zp()}}function ed(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Un),e}function dv(e,t,i){var r=t.pendingProps,u=!1,h=(t.flags&128)!==0,y;if((y=h)||(y=e!==null&&e.memoizedState===null?!1:(Ct.current&2)!==0),y&&(u=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(u?Ka(t):Za(),He){var w=ht,N;if(N=w){e:{for(N=w,w=ra;N.nodeType!==8;){if(!w){w=null;break e}if(N=In(N.nextSibling),N===null){w=null;break e}}w=N}w!==null?(t.memoizedState={dehydrated:w,treeContext:Ri!==null?{id:Da,overflow:Ta}:null,retryLane:536870912,hydrationErrors:null},N=pn(18,null,null,0),N.stateNode=w,N.return=t,t.child=N,Zt=t,ht=null,N=!0):N=!1}N||Ai(t)}if(w=t.memoizedState,w!==null&&(w=w.dehydrated,w!==null))return Bd(w)?t.lanes=32:t.lanes=536870912,null;Aa(t)}return w=r.children,r=r.fallback,u?(Za(),u=t.mode,w=ho({mode:"hidden",children:w},u),r=Ti(r,u,i,null),w.return=t,r.return=t,w.sibling=r,t.child=w,u=t.child,u.memoizedState=Ju(i),u.childLanes=ed(e,y,i),t.memoizedState=Wu,r):(Ka(t),td(t,w))}if(N=e.memoizedState,N!==null&&(w=N.dehydrated,w!==null)){if(h)t.flags&256?(Ka(t),t.flags&=-257,t=nd(e,t,i)):t.memoizedState!==null?(Za(),t.child=e.child,t.flags|=128,t=null):(Za(),u=r.fallback,w=t.mode,r=ho({mode:"visible",children:r.children},w),u=Ti(u,w,i,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,bl(t,e.child,null,i),r=t.child,r.memoizedState=Ju(i),r.childLanes=ed(e,y,i),t.memoizedState=Wu,t=u);else if(Ka(t),Bd(w)){if(y=w.nextSibling&&w.nextSibling.dataset,y)var F=y.dgst;y=F,r=Error(o(419)),r.stack="",r.digest=y,fr({value:r,source:null,stack:null}),t=nd(e,t,i)}else if(Nt||hr(e,t,i,!1),y=(i&e.childLanes)!==0,Nt||y){if(y=at,y!==null&&(r=i&-i,r=(r&42)!==0?1:St(r),r=(r&(y.suspendedLanes|i))!==0?0:r,r!==0&&r!==N.retryLane))throw N.retryLane=r,sl(e,r),xn(y,e,r),nv;w.data==="$?"||xd(),t=nd(e,t,i)}else w.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=N.treeContext,ht=In(w.nextSibling),Zt=t,He=!0,Mi=null,ra=!1,e!==null&&($n[Ln++]=Da,$n[Ln++]=Ta,$n[Ln++]=Ri,Da=e.id,Ta=e.overflow,Ri=t),t=td(t,r.children),t.flags|=4096);return t}return u?(Za(),u=r.fallback,w=t.mode,N=e.child,F=N.sibling,r=Ea(N,{mode:"hidden",children:r.children}),r.subtreeFlags=N.subtreeFlags&65011712,F!==null?u=Ea(F,u):(u=Ti(u,w,i,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,r=u,u=t.child,w=e.child.memoizedState,w===null?w=Ju(i):(N=w.cachePool,N!==null?(F=wt._currentValue,N=N.parent!==F?{parent:F,pool:F}:N):N=Zp(),w={baseLanes:w.baseLanes|i,cachePool:N}),u.memoizedState=w,u.childLanes=ed(e,y,i),t.memoizedState=Wu,r):(Ka(t),i=e.child,e=i.sibling,i=Ea(i,{mode:"visible",children:r.children}),i.return=t,i.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=i,t.memoizedState=null,i)}function td(e,t){return t=ho({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ho(e,t){return e=pn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function nd(e,t,i){return bl(t,e.child,null,i),e=td(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function fv(e,t,i){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),xu(e.return,t,i)}function ad(e,t,i,r,u){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:i,tailMode:u}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=r,h.tail=i,h.tailMode=u)}function hv(e,t,i){var r=t.pendingProps,u=r.revealOrder,h=r.tail;if(Bt(e,t,r.children,i),r=Ct.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fv(e,i,t);else if(e.tag===19)fv(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}switch(ce(Ct,r),u){case"forwards":for(i=t.child,u=null;i!==null;)e=i.alternate,e!==null&&oo(e)===null&&(u=i),i=i.sibling;i=u,i===null?(u=t.child,t.child=null):(u=i.sibling,i.sibling=null),ad(t,!1,u,i,h);break;case"backwards":for(i=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&oo(e)===null){t.child=u;break}e=u.sibling,u.sibling=i,i=u,u=e}ad(t,!0,i,null,h);break;case"together":ad(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $a(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ni|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(hr(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,i=Ea(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Ea(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function id(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Gs(e)))}function L2(e,t,i){switch(t.tag){case 3:Dt(t,t.stateNode.containerInfo),Va(t,wt,e.memoizedState.cache),dr();break;case 27:case 5:Be(t);break;case 4:Dt(t,t.stateNode.containerInfo);break;case 10:Va(t,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Ka(t),t.flags|=128,null):(i&t.child.childLanes)!==0?dv(e,t,i):(Ka(t),e=$a(e,t,i),e!==null?e.sibling:null);Ka(t);break;case 19:var u=(e.flags&128)!==0;if(r=(i&t.childLanes)!==0,r||(hr(e,t,i,!1),r=(i&t.childLanes)!==0),u){if(r)return hv(e,t,i);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ce(Ct,Ct.current),r)break;return null;case 22:case 23:return t.lanes=0,rv(e,t,i);case 24:Va(t,wt,e.memoizedState.cache)}return $a(e,t,i)}function mv(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Nt=!0;else{if(!id(e,i)&&(t.flags&128)===0)return Nt=!1,L2(e,t,i);Nt=(e.flags&131072)!==0}else Nt=!1,He&&(t.flags&1048576)!==0&&Ip(t,Vs,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var r=t.elementType,u=r._init;if(r=u(r._payload),t.type=r,typeof r=="function")hu(r)?(e=zi(r,e),t.tag=1,t=cv(null,t,r,e,i)):(t.tag=0,t=Zu(null,t,r,e,i));else{if(r!=null){if(u=r.$$typeof,u===H){t.tag=11,t=av(null,t,r,e,i);break e}else if(u===T){t.tag=14,t=iv(null,t,r,e,i);break e}}throw t=G(r)||r,Error(o(306,t,""))}}return t;case 0:return Zu(e,t,t.type,t.pendingProps,i);case 1:return r=t.type,u=zi(r,t.pendingProps),cv(e,t,r,u,i);case 3:e:{if(Dt(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var h=t.memoizedState;u=h.element,Tu(e,t),xr(t,r,null,i);var y=t.memoizedState;if(r=y.cache,Va(t,wt,r),r!==h.cache&&ju(t,[wt],i,!0),yr(),r=y.element,h.isDehydrated)if(h={element:r,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=uv(e,t,r,i);break e}else if(r!==u){u=Mn(Error(o(424)),t),fr(u),t=uv(e,t,r,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ht=In(e.firstChild),Zt=t,He=!0,Mi=null,ra=!0,i=Gg(t,null,r,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(dr(),r===u){t=$a(e,t,i);break e}Bt(e,t,r,i)}t=t.child}return t;case 26:return fo(e,t),e===null?(i=b0(t.type,null,t.pendingProps,null))?t.memoizedState=i:He||(i=t.type,e=t.pendingProps,r=To(Ue.current).createElement(i),r[M]=t,r[L]=e,Ft(r,i,e),Oe(r),t.stateNode=r):t.memoizedState=b0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Be(t),e===null&&He&&(r=t.stateNode=p0(t.type,t.pendingProps,Ue.current),Zt=t,ra=!0,u=ht,ri(t.type)?(_d=u,ht=In(r.firstChild)):ht=u),Bt(e,t,t.pendingProps.children,i),fo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((u=r=ht)&&(r=sw(r,t.type,t.pendingProps,ra),r!==null?(t.stateNode=r,Zt=t,ht=In(r.firstChild),ra=!1,u=!0):u=!1),u||Ai(t)),Be(t),u=t.type,h=t.pendingProps,y=e!==null?e.memoizedProps:null,r=h.children,Od(u,h)?r=null:y!==null&&Od(u,y)&&(t.flags|=32),t.memoizedState!==null&&(u=Lu(e,t,E2,null,null,i),Pr._currentValue=u),fo(e,t),Bt(e,t,r,i),t.child;case 6:return e===null&&He&&((e=i=ht)&&(i=ow(i,t.pendingProps,ra),i!==null?(t.stateNode=i,Zt=t,ht=null,e=!0):e=!1),e||Ai(t)),null;case 13:return dv(e,t,i);case 4:return Dt(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=bl(t,null,r,i):Bt(e,t,r,i),t.child;case 11:return av(e,t,t.type,t.pendingProps,i);case 7:return Bt(e,t,t.pendingProps,i),t.child;case 8:return Bt(e,t,t.pendingProps.children,i),t.child;case 12:return Bt(e,t,t.pendingProps.children,i),t.child;case 10:return r=t.pendingProps,Va(t,t.type,r.value),Bt(e,t,r.children,i),t.child;case 9:return u=t.type._context,r=t.pendingProps.children,Li(t),u=Gt(u),r=r(u),t.flags|=1,Bt(e,t,r,i),t.child;case 14:return iv(e,t,t.type,t.pendingProps,i);case 15:return lv(e,t,t.type,t.pendingProps,i);case 19:return hv(e,t,i);case 31:return r=t.pendingProps,i=t.mode,r={mode:r.mode,children:r.children},e===null?(i=ho(r,i),i.ref=t.ref,t.child=i,i.return=t,t=i):(i=Ea(e.child,r),i.ref=t.ref,t.child=i,i.return=t,t=i),t;case 22:return rv(e,t,i);case 24:return Li(t),r=Gt(wt),e===null?(u=Cu(),u===null&&(u=at,h=Su(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=i),u=h),t.memoizedState={parent:r,cache:u},Du(t),Va(t,wt,u)):((e.lanes&i)!==0&&(Tu(e,t),xr(t,null,null,i),yr()),u=e.memoizedState,h=t.memoizedState,u.parent!==r?(u={parent:r,cache:r},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Va(t,wt,r)):(r=h.cache,Va(t,wt,r),r!==u.cache&&ju(t,[wt],i,!0))),Bt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function La(e){e.flags|=4}function pv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!w0(t)){if(t=On.current,t!==null&&((Fe&4194048)===Fe?sa!==null:(Fe&62914560)!==Fe&&(Fe&536870912)===0||t!==sa))throw vr=Eu,Wp;e.flags|=8192}}function mo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Si():536870912,e.lanes|=t,Sl|=t)}function Tr(e,t){if(!He)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var r=null;i!==null;)i.alternate!==null&&(r=i),i=i.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,r=0;if(t)for(var u=e.child;u!==null;)i|=u.lanes|u.childLanes,r|=u.subtreeFlags&65011712,r|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)i|=u.lanes|u.childLanes,r|=u.subtreeFlags,r|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=r,e.childLanes=i,t}function O2(e,t,i){var r=t.pendingProps;switch(vu(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return ut(t),null;case 3:return i=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Na(wt),Tt(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ur(t)?La(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Yp())),ut(t),null;case 26:return i=t.memoizedState,e===null?(La(t),i!==null?(ut(t),pv(t,i)):(ut(t),t.flags&=-16777217)):i?i!==e.memoizedState?(La(t),ut(t),pv(t,i)):(ut(t),t.flags&=-16777217):(e.memoizedProps!==r&&La(t),ut(t),t.flags&=-16777217),null;case 27:En(t),i=Ue.current;var u=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==r&&La(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return ut(t),null}e=Se.current,ur(t)?Vp(t):(e=p0(u,r,i),t.stateNode=e,La(t))}return ut(t),null;case 5:if(En(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&La(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return ut(t),null}if(e=Se.current,ur(t))Vp(t);else{switch(u=To(Ue.current),e){case 1:e=u.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:e=u.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":e=u.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":e=u.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":e=u.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof r.is=="string"?u.createElement("select",{is:r.is}):u.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e=typeof r.is=="string"?u.createElement(i,{is:r.is}):u.createElement(i)}}e[M]=t,e[L]=r;e:for(u=t.child;u!==null;){if(u.tag===5||u.tag===6)e.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===t)break e;for(;u.sibling===null;){if(u.return===null||u.return===t)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}t.stateNode=e;e:switch(Ft(e,i,r),i){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&La(t)}}return ut(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&La(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(o(166));if(e=Ue.current,ur(t)){if(e=t.stateNode,i=t.memoizedProps,r=null,u=Zt,u!==null)switch(u.tag){case 27:case 5:r=u.memoizedProps}e[M]=t,e=!!(e.nodeValue===i||r!==null&&r.suppressHydrationWarning===!0||o0(e.nodeValue,i)),e||Ai(t)}else e=To(e).createTextNode(r),e[M]=t,t.stateNode=e}return ut(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ur(t),r!==null&&r.dehydrated!==null){if(e===null){if(!u)throw Error(o(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[M]=t}else dr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ut(t),u=!1}else u=Yp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Aa(t),t):(Aa(t),null)}if(Aa(t),(t.flags&128)!==0)return t.lanes=i,t;if(i=r!==null,e=e!==null&&e.memoizedState!==null,i){r=t.child,u=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(u=r.alternate.memoizedState.cachePool.pool);var h=null;r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(h=r.memoizedState.cachePool.pool),h!==u&&(r.flags|=2048)}return i!==e&&i&&(t.child.flags|=8192),mo(t,t.updateQueue),ut(t),null;case 4:return Tt(),e===null&&Nd(t.stateNode.containerInfo),ut(t),null;case 10:return Na(t.type),ut(t),null;case 19:if(ie(Ct),u=t.memoizedState,u===null)return ut(t),null;if(r=(t.flags&128)!==0,h=u.rendering,h===null)if(r)Tr(u,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=oo(e),h!==null){for(t.flags|=128,Tr(u,!1),e=h.updateQueue,t.updateQueue=e,mo(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)kp(i,e),i=i.sibling;return ce(Ct,Ct.current&1|2),t.child}e=e.sibling}u.tail!==null&&Yt()>vo&&(t.flags|=128,r=!0,Tr(u,!1),t.lanes=4194304)}else{if(!r)if(e=oo(h),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,mo(t,e),Tr(u,!0),u.tail===null&&u.tailMode==="hidden"&&!h.alternate&&!He)return ut(t),null}else 2*Yt()-u.renderingStartTime>vo&&i!==536870912&&(t.flags|=128,r=!0,Tr(u,!1),t.lanes=4194304);u.isBackwards?(h.sibling=t.child,t.child=h):(e=u.last,e!==null?e.sibling=h:t.child=h,u.last=h)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Yt(),t.sibling=null,e=Ct.current,ce(Ct,r?e&1|2:e&1),t):(ut(t),null);case 22:case 23:return Aa(t),Au(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(i&536870912)!==0&&(t.flags&128)===0&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),i=t.updateQueue,i!==null&&mo(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==i&&(t.flags|=2048),e!==null&&ie(Oi),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Na(wt),ut(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function U2(e,t){switch(vu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Na(wt),Tt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return En(t),null;case 13:if(Aa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));dr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ie(Ct),null;case 4:return Tt(),null;case 10:return Na(t.type),null;case 22:case 23:return Aa(t),Au(),e!==null&&ie(Oi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Na(wt),null;case 25:return null;default:return null}}function gv(e,t){switch(vu(t),t.tag){case 3:Na(wt),Tt();break;case 26:case 27:case 5:En(t);break;case 4:Tt();break;case 13:Aa(t);break;case 19:ie(Ct);break;case 10:Na(t.type);break;case 22:case 23:Aa(t),Au(),e!==null&&ie(Oi);break;case 24:Na(wt)}}function Rr(e,t){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var u=r.next;i=u;do{if((i.tag&e)===e){r=void 0;var h=i.create,y=i.inst;r=h(),y.destroy=r}i=i.next}while(i!==u)}}catch(w){tt(t,t.return,w)}}function Wa(e,t,i){try{var r=t.updateQueue,u=r!==null?r.lastEffect:null;if(u!==null){var h=u.next;r=h;do{if((r.tag&e)===e){var y=r.inst,w=y.destroy;if(w!==void 0){y.destroy=void 0,u=t;var N=i,F=w;try{F()}catch(X){tt(u,N,X)}}}r=r.next}while(r!==h)}}catch(X){tt(t,t.return,X)}}function vv(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{ig(t,i)}catch(r){tt(e,e.return,r)}}}function bv(e,t,i){i.props=zi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(r){tt(e,t,r)}}function Nr(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof i=="function"?e.refCleanup=i(r):i.current=r}}catch(u){tt(e,t,u)}}function oa(e,t){var i=e.ref,r=e.refCleanup;if(i!==null)if(typeof r=="function")try{r()}catch(u){tt(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(u){tt(e,t,u)}else i.current=null}function yv(e){var t=e.type,i=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&r.focus();break e;case"img":i.src?r.src=i.src:i.srcSet&&(r.srcset=i.srcSet)}}catch(u){tt(e,e.return,u)}}function ld(e,t,i){try{var r=e.stateNode;nw(r,e.type,i,t),r[L]=t}catch(u){tt(e,e.return,u)}}function xv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ri(e.type)||e.tag===4}function rd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ri(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function sd(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Do));else if(r!==4&&(r===27&&ri(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(sd(e,t,i),e=e.sibling;e!==null;)sd(e,t,i),e=e.sibling}function po(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(r!==4&&(r===27&&ri(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(po(e,t,i),e=e.sibling;e!==null;)po(e,t,i),e=e.sibling}function jv(e){var t=e.stateNode,i=e.memoizedProps;try{for(var r=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Ft(t,r,i),t[M]=e,t[L]=i}catch(h){tt(e,e.return,h)}}var Oa=!1,gt=!1,od=!1,Sv=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function z2(e,t){if(e=e.containerInfo,$d=Lo,e=Lp(e),ru(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var r=i.getSelection&&i.getSelection();if(r&&r.rangeCount!==0){i=r.anchorNode;var u=r.anchorOffset,h=r.focusNode;r=r.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var y=0,w=-1,N=-1,F=0,X=0,J=e,P=null;t:for(;;){for(var I;J!==i||u!==0&&J.nodeType!==3||(w=y+u),J!==h||r!==0&&J.nodeType!==3||(N=y+r),J.nodeType===3&&(y+=J.nodeValue.length),(I=J.firstChild)!==null;)P=J,J=I;for(;;){if(J===e)break t;if(P===i&&++F===u&&(w=y),P===h&&++X===r&&(N=y),(I=J.nextSibling)!==null)break;J=P,P=J.parentNode}J=I}i=w===-1||N===-1?null:{start:w,end:N}}else i=null}i=i||{start:0,end:0}}else i=null;for(Ld={focusedElem:e,selectionRange:i},Lo=!1,Mt=t;Mt!==null;)if(t=Mt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Mt=e;else for(;Mt!==null;){switch(t=Mt,h=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,i=t,u=h.memoizedProps,h=h.memoizedState,r=i.stateNode;try{var we=zi(i.type,u,i.elementType===i.type);e=r.getSnapshotBeforeUpdate(we,h),r.__reactInternalSnapshotBeforeUpdate=e}catch(ye){tt(i,i.return,ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)zd(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":zd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Mt=e;break}Mt=t.return}}function wv(e,t,i){var r=i.flags;switch(i.tag){case 0:case 11:case 15:Ja(e,i),r&4&&Rr(5,i);break;case 1:if(Ja(e,i),r&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(y){tt(i,i.return,y)}else{var u=zi(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){tt(i,i.return,y)}}r&64&&vv(i),r&512&&Nr(i,i.return);break;case 3:if(Ja(e,i),r&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{ig(e,t)}catch(y){tt(i,i.return,y)}}break;case 27:t===null&&r&4&&jv(i);case 26:case 5:Ja(e,i),t===null&&r&4&&yv(i),r&512&&Nr(i,i.return);break;case 12:Ja(e,i);break;case 13:Ja(e,i),r&4&&Dv(e,i),r&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=V2.bind(null,i),cw(e,i))));break;case 22:if(r=i.memoizedState!==null||Oa,!r){t=t!==null&&t.memoizedState!==null||gt,u=Oa;var h=gt;Oa=r,(gt=t)&&!h?ei(e,i,(i.subtreeFlags&8772)!==0):Ja(e,i),Oa=u,gt=h}break;case 30:break;default:Ja(e,i)}}function Cv(e){var t=e.alternate;t!==null&&(e.alternate=null,Cv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&he(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ot=null,ln=!1;function Ua(e,t,i){for(i=i.child;i!==null;)Ev(e,t,i),i=i.sibling}function Ev(e,t,i){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(ta,i)}catch{}switch(i.tag){case 26:gt||oa(i,t),Ua(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:gt||oa(i,t);var r=ot,u=ln;ri(i.type)&&(ot=i.stateNode,ln=!1),Ua(e,t,i),_r(i.stateNode),ot=r,ln=u;break;case 5:gt||oa(i,t);case 6:if(r=ot,u=ln,ot=null,Ua(e,t,i),ot=r,ln=u,ot!==null)if(ln)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(i.stateNode)}catch(h){tt(i,t,h)}else try{ot.removeChild(i.stateNode)}catch(h){tt(i,t,h)}break;case 18:ot!==null&&(ln?(e=ot,h0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Gr(e)):h0(ot,i.stateNode));break;case 4:r=ot,u=ln,ot=i.stateNode.containerInfo,ln=!0,Ua(e,t,i),ot=r,ln=u;break;case 0:case 11:case 14:case 15:gt||Wa(2,i,t),gt||Wa(4,i,t),Ua(e,t,i);break;case 1:gt||(oa(i,t),r=i.stateNode,typeof r.componentWillUnmount=="function"&&bv(i,t,r)),Ua(e,t,i);break;case 21:Ua(e,t,i);break;case 22:gt=(r=gt)||i.memoizedState!==null,Ua(e,t,i),gt=r;break;default:Ua(e,t,i)}}function Dv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gr(e)}catch(i){tt(t,t.return,i)}}function B2(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Sv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Sv),t;default:throw Error(o(435,e.tag))}}function cd(e,t){var i=B2(e);t.forEach(function(r){var u=G2.bind(null,e,r);i.has(r)||(i.add(r),r.then(u,u))})}function gn(e,t){var i=t.deletions;if(i!==null)for(var r=0;r<i.length;r++){var u=i[r],h=e,y=t,w=y;e:for(;w!==null;){switch(w.tag){case 27:if(ri(w.type)){ot=w.stateNode,ln=!1;break e}break;case 5:ot=w.stateNode,ln=!1;break e;case 3:case 4:ot=w.stateNode.containerInfo,ln=!0;break e}w=w.return}if(ot===null)throw Error(o(160));Ev(h,y,u),ot=null,ln=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Tv(t,e),t=t.sibling}var kn=null;function Tv(e,t){var i=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gn(t,e),vn(e),r&4&&(Wa(3,e,e.return),Rr(3,e),Wa(5,e,e.return));break;case 1:gn(t,e),vn(e),r&512&&(gt||i===null||oa(i,i.return)),r&64&&Oa&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?r:i.concat(r))));break;case 26:var u=kn;if(gn(t,e),vn(e),r&512&&(gt||i===null||oa(i,i.return)),r&4){var h=i!==null?i.memoizedState:null;if(r=e.memoizedState,i===null)if(r===null)if(e.stateNode===null){e:{r=e.type,i=e.memoizedProps,u=u.ownerDocument||u;t:switch(r){case"title":h=u.getElementsByTagName("title")[0],(!h||h[oe]||h[M]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=u.createElement(r),u.head.insertBefore(h,u.querySelector("head > title"))),Ft(h,r,i),h[M]=e,Oe(h),r=h;break e;case"link":var y=j0("link","href",u).get(r+(i.href||""));if(y){for(var w=0;w<y.length;w++)if(h=y[w],h.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&h.getAttribute("rel")===(i.rel==null?null:i.rel)&&h.getAttribute("title")===(i.title==null?null:i.title)&&h.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){y.splice(w,1);break t}}h=u.createElement(r),Ft(h,r,i),u.head.appendChild(h);break;case"meta":if(y=j0("meta","content",u).get(r+(i.content||""))){for(w=0;w<y.length;w++)if(h=y[w],h.getAttribute("content")===(i.content==null?null:""+i.content)&&h.getAttribute("name")===(i.name==null?null:i.name)&&h.getAttribute("property")===(i.property==null?null:i.property)&&h.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&h.getAttribute("charset")===(i.charSet==null?null:i.charSet)){y.splice(w,1);break t}}h=u.createElement(r),Ft(h,r,i),u.head.appendChild(h);break;default:throw Error(o(468,r))}h[M]=e,Oe(h),r=h}e.stateNode=r}else S0(u,e.type,e.stateNode);else e.stateNode=x0(u,r,e.memoizedProps);else h!==r?(h===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):h.count--,r===null?S0(u,e.type,e.stateNode):x0(u,r,e.memoizedProps)):r===null&&e.stateNode!==null&&ld(e,e.memoizedProps,i.memoizedProps)}break;case 27:gn(t,e),vn(e),r&512&&(gt||i===null||oa(i,i.return)),i!==null&&r&4&&ld(e,e.memoizedProps,i.memoizedProps);break;case 5:if(gn(t,e),vn(e),r&512&&(gt||i===null||oa(i,i.return)),e.flags&32){u=e.stateNode;try{el(u,"")}catch(I){tt(e,e.return,I)}}r&4&&e.stateNode!=null&&(u=e.memoizedProps,ld(e,u,i!==null?i.memoizedProps:u)),r&1024&&(od=!0);break;case 6:if(gn(t,e),vn(e),r&4){if(e.stateNode===null)throw Error(o(162));r=e.memoizedProps,i=e.stateNode;try{i.nodeValue=r}catch(I){tt(e,e.return,I)}}break;case 3:if(Mo=null,u=kn,kn=Ro(t.containerInfo),gn(t,e),kn=u,vn(e),r&4&&i!==null&&i.memoizedState.isDehydrated)try{Gr(t.containerInfo)}catch(I){tt(e,e.return,I)}od&&(od=!1,Rv(e));break;case 4:r=kn,kn=Ro(e.stateNode.containerInfo),gn(t,e),vn(e),kn=r;break;case 12:gn(t,e),vn(e);break;case 13:gn(t,e),vn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(pd=Yt()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cd(e,r)));break;case 22:u=e.memoizedState!==null;var N=i!==null&&i.memoizedState!==null,F=Oa,X=gt;if(Oa=F||u,gt=X||N,gn(t,e),gt=X,Oa=F,vn(e),r&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(i===null||N||Oa||gt||Bi(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){N=i=t;try{if(h=N.stateNode,u)y=h.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{w=N.stateNode;var J=N.memoizedProps.style,P=J!=null&&J.hasOwnProperty("display")?J.display:null;w.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(I){tt(N,N.return,I)}}}else if(t.tag===6){if(i===null){N=t;try{N.stateNode.nodeValue=u?"":N.memoizedProps}catch(I){tt(N,N.return,I)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(i=r.retryQueue,i!==null&&(r.retryQueue=null,cd(e,i))));break;case 19:gn(t,e),vn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cd(e,r)));break;case 30:break;case 21:break;default:gn(t,e),vn(e)}}function vn(e){var t=e.flags;if(t&2){try{for(var i,r=e.return;r!==null;){if(xv(r)){i=r;break}r=r.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var u=i.stateNode,h=rd(e);po(e,h,u);break;case 5:var y=i.stateNode;i.flags&32&&(el(y,""),i.flags&=-33);var w=rd(e);po(e,w,y);break;case 3:case 4:var N=i.stateNode.containerInfo,F=rd(e);sd(e,F,N);break;default:throw Error(o(161))}}catch(X){tt(e,e.return,X)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Rv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ja(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)wv(e,t.alternate,t),t=t.sibling}function Bi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Wa(4,t,t.return),Bi(t);break;case 1:oa(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&bv(t,t.return,i),Bi(t);break;case 27:_r(t.stateNode);case 26:case 5:oa(t,t.return),Bi(t);break;case 22:t.memoizedState===null&&Bi(t);break;case 30:Bi(t);break;default:Bi(t)}e=e.sibling}}function ei(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,u=e,h=t,y=h.flags;switch(h.tag){case 0:case 11:case 15:ei(u,h,i),Rr(4,h);break;case 1:if(ei(u,h,i),r=h,u=r.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(F){tt(r,r.return,F)}if(r=h,u=r.updateQueue,u!==null){var w=r.stateNode;try{var N=u.shared.hiddenCallbacks;if(N!==null)for(u.shared.hiddenCallbacks=null,u=0;u<N.length;u++)ag(N[u],w)}catch(F){tt(r,r.return,F)}}i&&y&64&&vv(h),Nr(h,h.return);break;case 27:jv(h);case 26:case 5:ei(u,h,i),i&&r===null&&y&4&&yv(h),Nr(h,h.return);break;case 12:ei(u,h,i);break;case 13:ei(u,h,i),i&&y&4&&Dv(u,h);break;case 22:h.memoizedState===null&&ei(u,h,i),Nr(h,h.return);break;case 30:break;default:ei(u,h,i)}t=t.sibling}}function ud(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&mr(i))}function dd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mr(e))}function ca(e,t,i,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Nv(e,t,i,r),t=t.sibling}function Nv(e,t,i,r){var u=t.flags;switch(t.tag){case 0:case 11:case 15:ca(e,t,i,r),u&2048&&Rr(9,t);break;case 1:ca(e,t,i,r);break;case 3:ca(e,t,i,r),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mr(e)));break;case 12:if(u&2048){ca(e,t,i,r),e=t.stateNode;try{var h=t.memoizedProps,y=h.id,w=h.onPostCommit;typeof w=="function"&&w(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){tt(t,t.return,N)}}else ca(e,t,i,r);break;case 13:ca(e,t,i,r);break;case 23:break;case 22:h=t.stateNode,y=t.alternate,t.memoizedState!==null?h._visibility&2?ca(e,t,i,r):Mr(e,t):h._visibility&2?ca(e,t,i,r):(h._visibility|=2,yl(e,t,i,r,(t.subtreeFlags&10256)!==0)),u&2048&&ud(y,t);break;case 24:ca(e,t,i,r),u&2048&&dd(t.alternate,t);break;default:ca(e,t,i,r)}}function yl(e,t,i,r,u){for(u=u&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var h=e,y=t,w=i,N=r,F=y.flags;switch(y.tag){case 0:case 11:case 15:yl(h,y,w,N,u),Rr(8,y);break;case 23:break;case 22:var X=y.stateNode;y.memoizedState!==null?X._visibility&2?yl(h,y,w,N,u):Mr(h,y):(X._visibility|=2,yl(h,y,w,N,u)),u&&F&2048&&ud(y.alternate,y);break;case 24:yl(h,y,w,N,u),u&&F&2048&&dd(y.alternate,y);break;default:yl(h,y,w,N,u)}t=t.sibling}}function Mr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,r=t,u=r.flags;switch(r.tag){case 22:Mr(i,r),u&2048&&ud(r.alternate,r);break;case 24:Mr(i,r),u&2048&&dd(r.alternate,r);break;default:Mr(i,r)}t=t.sibling}}var Ar=8192;function xl(e){if(e.subtreeFlags&Ar)for(e=e.child;e!==null;)Mv(e),e=e.sibling}function Mv(e){switch(e.tag){case 26:xl(e),e.flags&Ar&&e.memoizedState!==null&&Sw(kn,e.memoizedState,e.memoizedProps);break;case 5:xl(e);break;case 3:case 4:var t=kn;kn=Ro(e.stateNode.containerInfo),xl(e),kn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=Ar,Ar=16777216,xl(e),Ar=t):xl(e));break;default:xl(e)}}function Av(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function $r(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];Mt=r,Lv(r,e)}Av(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$v(e),e=e.sibling}function $v(e){switch(e.tag){case 0:case 11:case 15:$r(e),e.flags&2048&&Wa(9,e,e.return);break;case 3:$r(e);break;case 12:$r(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,go(e)):$r(e);break;default:$r(e)}}function go(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];Mt=r,Lv(r,e)}Av(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Wa(8,t,t.return),go(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,go(t));break;default:go(t)}e=e.sibling}}function Lv(e,t){for(;Mt!==null;){var i=Mt;switch(i.tag){case 0:case 11:case 15:Wa(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var r=i.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:mr(i.memoizedState.cache)}if(r=i.child,r!==null)r.return=i,Mt=r;else e:for(i=e;Mt!==null;){r=Mt;var u=r.sibling,h=r.return;if(Cv(r),r===i){Mt=null;break e}if(u!==null){u.return=h,Mt=u;break e}Mt=h}}}var _2={getCacheForType:function(e){var t=Gt(wt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i}},F2=typeof WeakMap=="function"?WeakMap:Map,Xe=0,at=null,$e=null,Fe=0,Qe=0,bn=null,ti=!1,jl=!1,fd=!1,za=0,mt=0,ni=0,_i=0,hd=0,Un=0,Sl=0,Lr=null,rn=null,md=!1,pd=0,vo=1/0,bo=null,ai=null,_t=0,ii=null,wl=null,Cl=0,gd=0,vd=null,Ov=null,Or=0,bd=null;function yn(){if((Xe&2)!==0&&Fe!==0)return Fe&-Fe;if(U.T!==null){var e=dl;return e!==0?e:Ed()}return Rt()}function Uv(){Un===0&&(Un=(Fe&536870912)===0||He?xa():536870912);var e=On.current;return e!==null&&(e.flags|=32),Un}function xn(e,t,i){(e===at&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(El(e,0),li(e,Fe,Un,!1)),nt(e,i),((Xe&2)===0||e!==at)&&(e===at&&((Xe&2)===0&&(_i|=i),mt===4&&li(e,Fe,Un,!1)),ua(e))}function zv(e,t,i){if((Xe&6)!==0)throw Error(o(327));var r=!i&&(t&124)===0&&(t&e.expiredLanes)===0||ya(e,t),u=r?P2(e,t):jd(e,t,!0),h=r;do{if(u===0){jl&&!r&&li(e,t,0,!1);break}else{if(i=e.current.alternate,h&&!q2(i)){u=jd(e,t,!1),h=!1;continue}if(u===2){if(h=t,e.errorRecoveryDisabledLanes&h)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var w=e;u=Lr;var N=w.current.memoizedState.isDehydrated;if(N&&(El(w,y).flags|=256),y=jd(w,y,!1),y!==2){if(fd&&!N){w.errorRecoveryDisabledLanes|=h,_i|=h,u=4;break e}h=rn,rn=u,h!==null&&(rn===null?rn=h:rn.push.apply(rn,h))}u=y}if(h=!1,u!==2)continue}}if(u===1){El(e,0),li(e,t,0,!0);break}e:{switch(r=e,h=u,h){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:li(r,t,Un,!ti);break e;case 2:rn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(u=pd+300-Yt(),10<u)){if(li(r,t,Un,!ti),na(r,0,!0)!==0)break e;r.timeoutHandle=d0(Bv.bind(null,r,i,rn,bo,md,t,Un,_i,Sl,ti,h,2,-0,0),u);break e}Bv(r,i,rn,bo,md,t,Un,_i,Sl,ti,h,0,-0,0)}}break}while(!0);ua(e)}function Bv(e,t,i,r,u,h,y,w,N,F,X,J,P,I){if(e.timeoutHandle=-1,J=t.subtreeFlags,(J&8192||(J&16785408)===16785408)&&(Hr={stylesheets:null,count:0,unsuspend:jw},Mv(t),J=ww(),J!==null)){e.cancelPendingCommit=J(Iv.bind(null,e,t,h,i,r,u,y,w,N,X,1,P,I)),li(e,h,y,!F);return}Iv(e,t,h,i,r,u,y,w,N)}function q2(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var r=0;r<i.length;r++){var u=i[r],h=u.getSnapshot;u=u.value;try{if(!mn(h(),u))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function li(e,t,i,r){t&=~hd,t&=~_i,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var u=t;0<u;){var h=31-Ve(u),y=1<<h;r[h]=-1,u&=~y}i!==0&&jt(e,i,t)}function yo(){return(Xe&6)===0?(Ur(0),!1):!0}function yd(){if($e!==null){if(Qe===0)var e=$e.return;else e=$e,Ra=$i=null,zu(e),vl=null,Er=0,e=$e;for(;e!==null;)gv(e.alternate,e),e=e.return;$e=null}}function El(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,iw(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),yd(),at=e,$e=i=Ea(e.current,null),Fe=t,Qe=0,bn=null,ti=!1,jl=ya(e,t),fd=!1,Sl=Un=hd=_i=ni=mt=0,rn=Lr=null,md=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var u=31-Ve(r),h=1<<u;t|=e[u],r&=~h}return za=t,qs(),i}function _v(e,t){Me=null,U.H=lo,t===gr||t===Qs?(t=tg(),Qe=3):t===Wp?(t=tg(),Qe=4):Qe=t===nv?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,bn=t,$e===null&&(mt=1,uo(e,Mn(t,e.current)))}function Fv(){var e=U.H;return U.H=lo,e===null?lo:e}function qv(){var e=U.A;return U.A=_2,e}function xd(){mt=4,ti||(Fe&4194048)!==Fe&&On.current!==null||(jl=!0),(ni&134217727)===0&&(_i&134217727)===0||at===null||li(at,Fe,Un,!1)}function jd(e,t,i){var r=Xe;Xe|=2;var u=Fv(),h=qv();(at!==e||Fe!==t)&&(bo=null,El(e,t)),t=!1;var y=mt;e:do try{if(Qe!==0&&$e!==null){var w=$e,N=bn;switch(Qe){case 8:yd(),y=6;break e;case 3:case 2:case 9:case 6:On.current===null&&(t=!0);var F=Qe;if(Qe=0,bn=null,Dl(e,w,N,F),i&&jl){y=0;break e}break;default:F=Qe,Qe=0,bn=null,Dl(e,w,N,F)}}H2(),y=mt;break}catch(X){_v(e,X)}while(!0);return t&&e.shellSuspendCounter++,Ra=$i=null,Xe=r,U.H=u,U.A=h,$e===null&&(at=null,Fe=0,qs()),y}function H2(){for(;$e!==null;)Hv($e)}function P2(e,t){var i=Xe;Xe|=2;var r=Fv(),u=qv();at!==e||Fe!==t?(bo=null,vo=Yt()+500,El(e,t)):jl=ya(e,t);e:do try{if(Qe!==0&&$e!==null){t=$e;var h=bn;t:switch(Qe){case 1:Qe=0,bn=null,Dl(e,t,h,1);break;case 2:case 9:if(Jp(h)){Qe=0,bn=null,Pv(t);break}t=function(){Qe!==2&&Qe!==9||at!==e||(Qe=7),ua(e)},h.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:Jp(h)?(Qe=0,bn=null,Pv(t)):(Qe=0,bn=null,Dl(e,t,h,7));break;case 5:var y=null;switch($e.tag){case 26:y=$e.memoizedState;case 5:case 27:var w=$e;if(!y||w0(y)){Qe=0,bn=null;var N=w.sibling;if(N!==null)$e=N;else{var F=w.return;F!==null?($e=F,xo(F)):$e=null}break t}}Qe=0,bn=null,Dl(e,t,h,5);break;case 6:Qe=0,bn=null,Dl(e,t,h,6);break;case 8:yd(),mt=6;break e;default:throw Error(o(462))}}k2();break}catch(X){_v(e,X)}while(!0);return Ra=$i=null,U.H=r,U.A=u,Xe=i,$e!==null?0:(at=null,Fe=0,qs(),mt)}function k2(){for(;$e!==null&&!ea();)Hv($e)}function Hv(e){var t=mv(e.alternate,e,za);e.memoizedProps=e.pendingProps,t===null?xo(e):$e=t}function Pv(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=ov(i,t,t.pendingProps,t.type,void 0,Fe);break;case 11:t=ov(i,t,t.pendingProps,t.type.render,t.ref,Fe);break;case 5:zu(t);default:gv(i,t),t=$e=kp(t,za),t=mv(i,t,za)}e.memoizedProps=e.pendingProps,t===null?xo(e):$e=t}function Dl(e,t,i,r){Ra=$i=null,zu(t),vl=null,Er=0;var u=t.return;try{if($2(e,u,t,i,Fe)){mt=1,uo(e,Mn(i,e.current)),$e=null;return}}catch(h){if(u!==null)throw $e=u,h;mt=1,uo(e,Mn(i,e.current)),$e=null;return}t.flags&32768?(He||r===1?e=!0:jl||(Fe&536870912)!==0?e=!1:(ti=e=!0,(r===2||r===9||r===3||r===6)&&(r=On.current,r!==null&&r.tag===13&&(r.flags|=16384))),kv(t,e)):xo(t)}function xo(e){var t=e;do{if((t.flags&32768)!==0){kv(t,ti);return}e=t.return;var i=O2(t.alternate,t,za);if(i!==null){$e=i;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);mt===0&&(mt=5)}function kv(e,t){do{var i=U2(e.alternate,e);if(i!==null){i.flags&=32767,$e=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){$e=e;return}$e=e=i}while(e!==null);mt=6,$e=null}function Iv(e,t,i,r,u,h,y,w,N){e.cancelPendingCommit=null;do jo();while(_t!==0);if((Xe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(h=t.lanes|t.childLanes,h|=du,zt(e,i,h,y,w,N),e===at&&($e=at=null,Fe=0),wl=t,ii=e,Cl=i,gd=h,vd=u,Ov=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Y2(Hn,function(){return Qv(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=U.T,U.T=null,u=k.p,k.p=2,y=Xe,Xe|=4;try{z2(e,t,i)}finally{Xe=y,k.p=u,U.T=r}}_t=1,Vv(),Gv(),Yv()}}function Vv(){if(_t===1){_t=0;var e=ii,t=wl,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=U.T,U.T=null;var r=k.p;k.p=2;var u=Xe;Xe|=4;try{Tv(t,e);var h=Ld,y=Lp(e.containerInfo),w=h.focusedElem,N=h.selectionRange;if(y!==w&&w&&w.ownerDocument&&$p(w.ownerDocument.documentElement,w)){if(N!==null&&ru(w)){var F=N.start,X=N.end;if(X===void 0&&(X=F),"selectionStart"in w)w.selectionStart=F,w.selectionEnd=Math.min(X,w.value.length);else{var J=w.ownerDocument||document,P=J&&J.defaultView||window;if(P.getSelection){var I=P.getSelection(),we=w.textContent.length,ye=Math.min(N.start,we),et=N.end===void 0?ye:Math.min(N.end,we);!I.extend&&ye>et&&(y=et,et=ye,ye=y);var z=Ap(w,ye),$=Ap(w,et);if(z&&$&&(I.rangeCount!==1||I.anchorNode!==z.node||I.anchorOffset!==z.offset||I.focusNode!==$.node||I.focusOffset!==$.offset)){var _=J.createRange();_.setStart(z.node,z.offset),I.removeAllRanges(),ye>et?(I.addRange(_),I.extend($.node,$.offset)):(_.setEnd($.node,$.offset),I.addRange(_))}}}}for(J=[],I=w;I=I.parentNode;)I.nodeType===1&&J.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<J.length;w++){var Z=J[w];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}Lo=!!$d,Ld=$d=null}finally{Xe=u,k.p=r,U.T=i}}e.current=t,_t=2}}function Gv(){if(_t===2){_t=0;var e=ii,t=wl,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=U.T,U.T=null;var r=k.p;k.p=2;var u=Xe;Xe|=4;try{wv(e,t.alternate,t)}finally{Xe=u,k.p=r,U.T=i}}_t=3}}function Yv(){if(_t===4||_t===3){_t=0,Vt();var e=ii,t=wl,i=Cl,r=Ov;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?_t=5:(_t=0,wl=ii=null,Xv(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(ai=null),dt(i),t=t.stateNode,rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(ta,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=U.T,u=k.p,k.p=2,U.T=null;try{for(var h=e.onRecoverableError,y=0;y<r.length;y++){var w=r[y];h(w.value,{componentStack:w.stack})}}finally{U.T=t,k.p=u}}(Cl&3)!==0&&jo(),ua(e),u=e.pendingLanes,(i&4194090)!==0&&(u&42)!==0?e===bd?Or++:(Or=0,bd=e):Or=0,Ur(0)}}function Xv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,mr(t)))}function jo(e){return Vv(),Gv(),Yv(),Qv()}function Qv(){if(_t!==5)return!1;var e=ii,t=gd;gd=0;var i=dt(Cl),r=U.T,u=k.p;try{k.p=32>i?32:i,U.T=null,i=vd,vd=null;var h=ii,y=Cl;if(_t=0,wl=ii=null,Cl=0,(Xe&6)!==0)throw Error(o(331));var w=Xe;if(Xe|=4,$v(h.current),Nv(h,h.current,y,i),Xe=w,Ur(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(ta,h)}catch{}return!0}finally{k.p=u,U.T=r,Xv(e,t)}}function Kv(e,t,i){t=Mn(i,t),t=Ku(e.stateNode,t,2),e=Xa(e,t,2),e!==null&&(nt(e,2),ua(e))}function tt(e,t,i){if(e.tag===3)Kv(e,e,i);else for(;t!==null;){if(t.tag===3){Kv(t,e,i);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ai===null||!ai.has(r))){e=Mn(i,e),i=ev(2),r=Xa(t,i,2),r!==null&&(tv(i,r,t,e),nt(r,2),ua(r));break}}t=t.return}}function Sd(e,t,i){var r=e.pingCache;if(r===null){r=e.pingCache=new F2;var u=new Set;r.set(t,u)}else u=r.get(t),u===void 0&&(u=new Set,r.set(t,u));u.has(i)||(fd=!0,u.add(i),e=I2.bind(null,e,t,i),t.then(e,e))}function I2(e,t,i){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,at===e&&(Fe&i)===i&&(mt===4||mt===3&&(Fe&62914560)===Fe&&300>Yt()-pd?(Xe&2)===0&&El(e,0):hd|=i,Sl===Fe&&(Sl=0)),ua(e)}function Zv(e,t){t===0&&(t=Si()),e=sl(e,t),e!==null&&(nt(e,t),ua(e))}function V2(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Zv(e,i)}function G2(e,t){var i=0;switch(e.tag){case 13:var r=e.stateNode,u=e.memoizedState;u!==null&&(i=u.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),Zv(e,i)}function Y2(e,t){return Ut(e,t)}var So=null,Tl=null,wd=!1,wo=!1,Cd=!1,Fi=0;function ua(e){e!==Tl&&e.next===null&&(Tl===null?So=Tl=e:Tl=Tl.next=e),wo=!0,wd||(wd=!0,Q2())}function Ur(e,t){if(!Cd&&wo){Cd=!0;do for(var i=!1,r=So;r!==null;){if(e!==0){var u=r.pendingLanes;if(u===0)var h=0;else{var y=r.suspendedLanes,w=r.pingedLanes;h=(1<<31-Ve(42|e)+1)-1,h&=u&~(y&~w),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(i=!0,t0(r,h))}else h=Fe,h=na(r,r===at?h:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(h&3)===0||ya(r,h)||(i=!0,t0(r,h));r=r.next}while(i);Cd=!1}}function X2(){Wv()}function Wv(){wo=wd=!1;var e=0;Fi!==0&&(aw()&&(e=Fi),Fi=0);for(var t=Yt(),i=null,r=So;r!==null;){var u=r.next,h=Jv(r,t);h===0?(r.next=null,i===null?So=u:i.next=u,u===null&&(Tl=i)):(i=r,(e!==0||(h&3)!==0)&&(wo=!0)),r=u}Ur(e)}function Jv(e,t){for(var i=e.suspendedLanes,r=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var y=31-Ve(h),w=1<<y,N=u[y];N===-1?((w&i)===0||(w&r)!==0)&&(u[y]=ji(w,t)):N<=t&&(e.expiredLanes|=w),h&=~w}if(t=at,i=Fe,i=na(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,i===0||e===t&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&It(r),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||ya(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(r!==null&&It(r),dt(i)){case 2:case 8:i=un;break;case 32:i=Hn;break;case 268435456:i=yi;break;default:i=Hn}return r=e0.bind(null,e),i=Ut(i,r),e.callbackPriority=t,e.callbackNode=i,t}return r!==null&&r!==null&&It(r),e.callbackPriority=2,e.callbackNode=null,2}function e0(e,t){if(_t!==0&&_t!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(jo()&&e.callbackNode!==i)return null;var r=Fe;return r=na(e,e===at?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(zv(e,r,t),Jv(e,Yt()),e.callbackNode!=null&&e.callbackNode===i?e0.bind(null,e):null)}function t0(e,t){if(jo())return null;zv(e,t,!0)}function Q2(){lw(function(){(Xe&6)!==0?Ut(ga,X2):Wv()})}function Ed(){return Fi===0&&(Fi=xa()),Fi}function n0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ls(""+e)}function a0(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function K2(e,t,i,r,u){if(t==="submit"&&i&&i.stateNode===u){var h=n0((u[L]||null).action),y=r.submitter;y&&(t=(t=y[L]||null)?n0(t.formAction):y.getAttribute("formAction"),t!==null&&(h=t,y=null));var w=new Bs("action","action",null,r,u);e.push({event:w,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Fi!==0){var N=y?a0(u,y):new FormData(u);Vu(i,{pending:!0,data:N,method:u.method,action:h},null,N)}}else typeof h=="function"&&(w.preventDefault(),N=y?a0(u,y):new FormData(u),Vu(i,{pending:!0,data:N,method:u.method,action:h},h,N))},currentTarget:u}]})}}for(var Dd=0;Dd<uu.length;Dd++){var Td=uu[Dd],Z2=Td.toLowerCase(),W2=Td[0].toUpperCase()+Td.slice(1);Pn(Z2,"on"+W2)}Pn(zp,"onAnimationEnd"),Pn(Bp,"onAnimationIteration"),Pn(_p,"onAnimationStart"),Pn("dblclick","onDoubleClick"),Pn("focusin","onFocus"),Pn("focusout","onBlur"),Pn(p2,"onTransitionRun"),Pn(g2,"onTransitionStart"),Pn(v2,"onTransitionCancel"),Pn(Fp,"onTransitionEnd"),fn("onMouseEnter",["mouseout","mouseover"]),fn("onMouseLeave",["mouseout","mouseover"]),fn("onPointerEnter",["pointerout","pointerover"]),fn("onPointerLeave",["pointerout","pointerover"]),Ie("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ie("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ie("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ie("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ie("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ie("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zr="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(" "),J2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zr));function i0(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var r=e[i],u=r.event;r=r.listeners;e:{var h=void 0;if(t)for(var y=r.length-1;0<=y;y--){var w=r[y],N=w.instance,F=w.currentTarget;if(w=w.listener,N!==h&&u.isPropagationStopped())break e;h=w,u.currentTarget=F;try{h(u)}catch(X){co(X)}u.currentTarget=null,h=N}else for(y=0;y<r.length;y++){if(w=r[y],N=w.instance,F=w.currentTarget,w=w.listener,N!==h&&u.isPropagationStopped())break e;h=w,u.currentTarget=F;try{h(u)}catch(X){co(X)}u.currentTarget=null,h=N}}}}function Le(e,t){var i=t[ee];i===void 0&&(i=t[ee]=new Set);var r=e+"__bubble";i.has(r)||(l0(t,e,2,!1),i.add(r))}function Rd(e,t,i){var r=0;t&&(r|=4),l0(i,e,r,t)}var Co="_reactListening"+Math.random().toString(36).slice(2);function Nd(e){if(!e[Co]){e[Co]=!0,Ge.forEach(function(i){i!=="selectionchange"&&(J2.has(i)||Rd(i,!1,e),Rd(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Co]||(t[Co]=!0,Rd("selectionchange",!1,t))}}function l0(e,t,i,r){switch(N0(t)){case 2:var u=Dw;break;case 8:u=Tw;break;default:u=kd}i=u.bind(null,t,i,e),u=void 0,!Zc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),r?u!==void 0?e.addEventListener(t,i,{capture:!0,passive:u}):e.addEventListener(t,i,!0):u!==void 0?e.addEventListener(t,i,{passive:u}):e.addEventListener(t,i,!1)}function Md(e,t,i,r,u){var h=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var y=r.tag;if(y===3||y===4){var w=r.stateNode.containerInfo;if(w===u)break;if(y===4)for(y=r.return;y!==null;){var N=y.tag;if((N===3||N===4)&&y.stateNode.containerInfo===u)return;y=y.return}for(;w!==null;){if(y=ue(w),y===null)return;if(N=y.tag,N===5||N===6||N===26||N===27){r=h=y;continue e}w=w.parentNode}}r=r.return}fp(function(){var F=h,X=Qc(i),J=[];e:{var P=qp.get(e);if(P!==void 0){var I=Bs,we=e;switch(e){case"keypress":if(Us(i)===0)break e;case"keydown":case"keyup":I=YS;break;case"focusin":we="focus",I=tu;break;case"focusout":we="blur",I=tu;break;case"beforeblur":case"afterblur":I=tu;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":I=pp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=US;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=KS;break;case zp:case Bp:case _p:I=_S;break;case Fp:I=WS;break;case"scroll":case"scrollend":I=LS;break;case"wheel":I=e2;break;case"copy":case"cut":case"paste":I=qS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=vp;break;case"toggle":case"beforetoggle":I=n2}var ye=(t&4)!==0,et=!ye&&(e==="scroll"||e==="scrollend"),z=ye?P!==null?P+"Capture":null:P;ye=[];for(var $=F,_;$!==null;){var Z=$;if(_=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||_===null||z===null||(Z=tr($,z),Z!=null&&ye.push(Br($,Z,_))),et)break;$=$.return}0<ye.length&&(P=new I(P,we,null,i,X),J.push({event:P,listeners:ye}))}}if((t&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",I=e==="mouseout"||e==="pointerout",P&&i!==Xc&&(we=i.relatedTarget||i.fromElement)&&(ue(we)||we[q]))break e;if((I||P)&&(P=X.window===X?X:(P=X.ownerDocument)?P.defaultView||P.parentWindow:window,I?(we=i.relatedTarget||i.toElement,I=F,we=we?ue(we):null,we!==null&&(et=d(we),ye=we.tag,we!==et||ye!==5&&ye!==27&&ye!==6)&&(we=null)):(I=null,we=F),I!==we)){if(ye=pp,Z="onMouseLeave",z="onMouseEnter",$="mouse",(e==="pointerout"||e==="pointerover")&&(ye=vp,Z="onPointerLeave",z="onPointerEnter",$="pointer"),et=I==null?P:Ce(I),_=we==null?P:Ce(we),P=new ye(Z,$+"leave",I,i,X),P.target=et,P.relatedTarget=_,Z=null,ue(X)===F&&(ye=new ye(z,$+"enter",we,i,X),ye.target=_,ye.relatedTarget=et,Z=ye),et=Z,I&&we)t:{for(ye=I,z=we,$=0,_=ye;_;_=Rl(_))$++;for(_=0,Z=z;Z;Z=Rl(Z))_++;for(;0<$-_;)ye=Rl(ye),$--;for(;0<_-$;)z=Rl(z),_--;for(;$--;){if(ye===z||z!==null&&ye===z.alternate)break t;ye=Rl(ye),z=Rl(z)}ye=null}else ye=null;I!==null&&r0(J,P,I,ye,!1),we!==null&&et!==null&&r0(J,et,we,ye,!0)}}e:{if(P=F?Ce(F):window,I=P.nodeName&&P.nodeName.toLowerCase(),I==="select"||I==="input"&&P.type==="file")var pe=Ep;else if(wp(P))if(Dp)pe=f2;else{pe=u2;var Ae=c2}else I=P.nodeName,!I||I.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?F&&Yc(F.elementType)&&(pe=Ep):pe=d2;if(pe&&(pe=pe(e,F))){Cp(J,pe,i,X);break e}Ae&&Ae(e,P,F),e==="focusout"&&F&&P.type==="number"&&F.memoizedProps.value!=null&&Gc(P,"number",P.value)}switch(Ae=F?Ce(F):window,e){case"focusin":(wp(Ae)||Ae.contentEditable==="true")&&(il=Ae,su=F,cr=null);break;case"focusout":cr=su=il=null;break;case"mousedown":ou=!0;break;case"contextmenu":case"mouseup":case"dragend":ou=!1,Op(J,i,X);break;case"selectionchange":if(m2)break;case"keydown":case"keyup":Op(J,i,X)}var ve;if(au)e:{switch(e){case"compositionstart":var xe="onCompositionStart";break e;case"compositionend":xe="onCompositionEnd";break e;case"compositionupdate":xe="onCompositionUpdate";break e}xe=void 0}else al?jp(e,i)&&(xe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(xe="onCompositionStart");xe&&(bp&&i.locale!=="ko"&&(al||xe!=="onCompositionStart"?xe==="onCompositionEnd"&&al&&(ve=hp()):(Ia=X,Wc="value"in Ia?Ia.value:Ia.textContent,al=!0)),Ae=Eo(F,xe),0<Ae.length&&(xe=new gp(xe,e,null,i,X),J.push({event:xe,listeners:Ae}),ve?xe.data=ve:(ve=Sp(i),ve!==null&&(xe.data=ve)))),(ve=i2?l2(e,i):r2(e,i))&&(xe=Eo(F,"onBeforeInput"),0<xe.length&&(Ae=new gp("onBeforeInput","beforeinput",null,i,X),J.push({event:Ae,listeners:xe}),Ae.data=ve)),K2(J,e,F,i,X)}i0(J,t)})}function Br(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Eo(e,t){for(var i=t+"Capture",r=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=tr(e,i),u!=null&&r.unshift(Br(e,u,h)),u=tr(e,t),u!=null&&r.push(Br(e,u,h))),e.tag===3)return r;e=e.return}return[]}function Rl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function r0(e,t,i,r,u){for(var h=t._reactName,y=[];i!==null&&i!==r;){var w=i,N=w.alternate,F=w.stateNode;if(w=w.tag,N!==null&&N===r)break;w!==5&&w!==26&&w!==27||F===null||(N=F,u?(F=tr(i,h),F!=null&&y.unshift(Br(i,F,N))):u||(F=tr(i,h),F!=null&&y.push(Br(i,F,N)))),i=i.return}y.length!==0&&e.push({event:t,listeners:y})}var ew=/\r\n?/g,tw=/\u0000|\uFFFD/g;function s0(e){return(typeof e=="string"?e:""+e).replace(ew,`
|
|
25
|
+
`).replace(tw,"")}function o0(e,t){return t=s0(t),s0(e)===t}function Do(){}function Je(e,t,i,r,u,h){switch(i){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||el(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&el(e,""+r);break;case"className":Rn(e,"class",r);break;case"tabIndex":Rn(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Rn(e,i,r);break;case"style":up(e,r,h);break;case"data":if(t!=="object"){Rn(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=Ls(""+r),e.setAttribute(i,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(i,"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 h=="function"&&(i==="formAction"?(t!=="input"&&Je(e,t,"name",u.name,u,null),Je(e,t,"formEncType",u.formEncType,u,null),Je(e,t,"formMethod",u.formMethod,u,null),Je(e,t,"formTarget",u.formTarget,u,null)):(Je(e,t,"encType",u.encType,u,null),Je(e,t,"method",u.method,u,null),Je(e,t,"target",u.target,u,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=Ls(""+r),e.setAttribute(i,r);break;case"onClick":r!=null&&(e.onclick=Do);break;case"onScroll":r!=null&&Le("scroll",e);break;case"onScrollEnd":r!=null&&Le("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(o(61));if(i=r.__html,i!=null){if(u.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}i=Ls(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""+r):e.removeAttribute(i);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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":r===!0?e.setAttribute(i,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,r):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(i,r):e.removeAttribute(i);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(i):e.setAttribute(i,r);break;case"popover":Le("beforetoggle",e),Le("toggle",e),ia(e,"popover",r);break;case"xlinkActuate":tn(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":tn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":tn(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":tn(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":tn(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":tn(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":tn(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":tn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":tn(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":ia(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=AS.get(i)||i,ia(e,i,r))}}function Ad(e,t,i,r,u,h){switch(i){case"style":up(e,r,h);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(o(61));if(i=r.__html,i!=null){if(u.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"children":typeof r=="string"?el(e,r):(typeof r=="number"||typeof r=="bigint")&&el(e,""+r);break;case"onScroll":r!=null&&Le("scroll",e);break;case"onScrollEnd":r!=null&&Le("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Do);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_e.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(u=i.endsWith("Capture"),t=i.slice(2,u?i.length-7:void 0),h=e[L]||null,h=h!=null?h[i]:null,typeof h=="function"&&e.removeEventListener(t,h,u),typeof r=="function")){typeof h!="function"&&h!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,r,u);break e}i in e?e[i]=r:r===!0?e.setAttribute(i,""):ia(e,i,r)}}}function Ft(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",e),Le("load",e);var r=!1,u=!1,h;for(h in i)if(i.hasOwnProperty(h)){var y=i[h];if(y!=null)switch(h){case"src":r=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Je(e,t,h,y,i,null)}}u&&Je(e,t,"srcSet",i.srcSet,i,null),r&&Je(e,t,"src",i.src,i,null);return;case"input":Le("invalid",e);var w=h=y=u=null,N=null,F=null;for(r in i)if(i.hasOwnProperty(r)){var X=i[r];if(X!=null)switch(r){case"name":u=X;break;case"type":y=X;break;case"checked":N=X;break;case"defaultChecked":F=X;break;case"value":h=X;break;case"defaultValue":w=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(o(137,t));break;default:Je(e,t,r,X,i,null)}}rp(e,h,w,N,F,y,u,!1),As(e);return;case"select":Le("invalid",e),r=y=h=null;for(u in i)if(i.hasOwnProperty(u)&&(w=i[u],w!=null))switch(u){case"value":h=w;break;case"defaultValue":y=w;break;case"multiple":r=w;default:Je(e,t,u,w,i,null)}t=h,i=y,e.multiple=!!r,t!=null?Ji(e,!!r,t,!1):i!=null&&Ji(e,!!r,i,!0);return;case"textarea":Le("invalid",e),h=u=r=null;for(y in i)if(i.hasOwnProperty(y)&&(w=i[y],w!=null))switch(y){case"value":r=w;break;case"defaultValue":u=w;break;case"children":h=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(o(91));break;default:Je(e,t,y,w,i,null)}op(e,r,u,h),As(e);return;case"option":for(N in i)if(i.hasOwnProperty(N)&&(r=i[N],r!=null))switch(N){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Je(e,t,N,r,i,null)}return;case"dialog":Le("beforetoggle",e),Le("toggle",e),Le("cancel",e),Le("close",e);break;case"iframe":case"object":Le("load",e);break;case"video":case"audio":for(r=0;r<zr.length;r++)Le(zr[r],e);break;case"image":Le("error",e),Le("load",e);break;case"details":Le("toggle",e);break;case"embed":case"source":case"link":Le("error",e),Le("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in i)if(i.hasOwnProperty(F)&&(r=i[F],r!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Je(e,t,F,r,i,null)}return;default:if(Yc(t)){for(X in i)i.hasOwnProperty(X)&&(r=i[X],r!==void 0&&Ad(e,t,X,r,i,void 0));return}}for(w in i)i.hasOwnProperty(w)&&(r=i[w],r!=null&&Je(e,t,w,r,i,null))}function nw(e,t,i,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,y=null,w=null,N=null,F=null,X=null;for(I in i){var J=i[I];if(i.hasOwnProperty(I)&&J!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":N=J;default:r.hasOwnProperty(I)||Je(e,t,I,null,r,J)}}for(var P in r){var I=r[P];if(J=i[P],r.hasOwnProperty(P)&&(I!=null||J!=null))switch(P){case"type":h=I;break;case"name":u=I;break;case"checked":F=I;break;case"defaultChecked":X=I;break;case"value":y=I;break;case"defaultValue":w=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(o(137,t));break;default:I!==J&&Je(e,t,P,I,r,J)}}Vc(e,y,w,N,F,X,h,u);return;case"select":I=y=w=P=null;for(h in i)if(N=i[h],i.hasOwnProperty(h)&&N!=null)switch(h){case"value":break;case"multiple":I=N;default:r.hasOwnProperty(h)||Je(e,t,h,null,r,N)}for(u in r)if(h=r[u],N=i[u],r.hasOwnProperty(u)&&(h!=null||N!=null))switch(u){case"value":P=h;break;case"defaultValue":w=h;break;case"multiple":y=h;default:h!==N&&Je(e,t,u,h,r,N)}t=w,i=y,r=I,P!=null?Ji(e,!!i,P,!1):!!r!=!!i&&(t!=null?Ji(e,!!i,t,!0):Ji(e,!!i,i?[]:"",!1));return;case"textarea":I=P=null;for(w in i)if(u=i[w],i.hasOwnProperty(w)&&u!=null&&!r.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Je(e,t,w,null,r,u)}for(y in r)if(u=r[y],h=i[y],r.hasOwnProperty(y)&&(u!=null||h!=null))switch(y){case"value":P=u;break;case"defaultValue":I=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(o(91));break;default:u!==h&&Je(e,t,y,u,r,h)}sp(e,P,I);return;case"option":for(var we in i)if(P=i[we],i.hasOwnProperty(we)&&P!=null&&!r.hasOwnProperty(we))switch(we){case"selected":e.selected=!1;break;default:Je(e,t,we,null,r,P)}for(N in r)if(P=r[N],I=i[N],r.hasOwnProperty(N)&&P!==I&&(P!=null||I!=null))switch(N){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:Je(e,t,N,P,r,I)}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 ye in i)P=i[ye],i.hasOwnProperty(ye)&&P!=null&&!r.hasOwnProperty(ye)&&Je(e,t,ye,null,r,P);for(F in r)if(P=r[F],I=i[F],r.hasOwnProperty(F)&&P!==I&&(P!=null||I!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(o(137,t));break;default:Je(e,t,F,P,r,I)}return;default:if(Yc(t)){for(var et in i)P=i[et],i.hasOwnProperty(et)&&P!==void 0&&!r.hasOwnProperty(et)&&Ad(e,t,et,void 0,r,P);for(X in r)P=r[X],I=i[X],!r.hasOwnProperty(X)||P===I||P===void 0&&I===void 0||Ad(e,t,X,P,r,I);return}}for(var z in i)P=i[z],i.hasOwnProperty(z)&&P!=null&&!r.hasOwnProperty(z)&&Je(e,t,z,null,r,P);for(J in r)P=r[J],I=i[J],!r.hasOwnProperty(J)||P===I||P==null&&I==null||Je(e,t,J,P,r,I)}var $d=null,Ld=null;function To(e){return e.nodeType===9?e:e.ownerDocument}function c0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function u0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Od(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ud=null;function aw(){var e=window.event;return e&&e.type==="popstate"?e===Ud?!1:(Ud=e,!0):(Ud=null,!1)}var d0=typeof setTimeout=="function"?setTimeout:void 0,iw=typeof clearTimeout=="function"?clearTimeout:void 0,f0=typeof Promise=="function"?Promise:void 0,lw=typeof queueMicrotask=="function"?queueMicrotask:typeof f0<"u"?function(e){return f0.resolve(null).then(e).catch(rw)}:d0;function rw(e){setTimeout(function(){throw e})}function ri(e){return e==="head"}function h0(e,t){var i=t,r=0,u=0;do{var h=i.nextSibling;if(e.removeChild(i),h&&h.nodeType===8)if(i=h.data,i==="/$"){if(0<r&&8>r){i=r;var y=e.ownerDocument;if(i&1&&_r(y.documentElement),i&2&&_r(y.body),i&4)for(i=y.head,_r(i),y=i.firstChild;y;){var w=y.nextSibling,N=y.nodeName;y[oe]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&y.rel.toLowerCase()==="stylesheet"||i.removeChild(y),y=w}}if(u===0){e.removeChild(h),Gr(t);return}u--}else i==="$"||i==="$?"||i==="$!"?u++:r=i.charCodeAt(0)-48;else r=0;i=h}while(i);Gr(t)}function zd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":zd(i),he(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function sw(e,t,i,r){for(;e.nodeType===1;){var u=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[oe])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=In(e.nextSibling),e===null)break}return null}function ow(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=In(e.nextSibling),e===null))return null;return e}function Bd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function cw(e,t){var i=e.ownerDocument;if(e.data!=="$?"||i.readyState==="complete")t();else{var r=function(){t(),i.removeEventListener("DOMContentLoaded",r)};i.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function In(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var _d=null;function m0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return e;t--}else i==="/$"&&t++}e=e.previousSibling}return null}function p0(e,t,i){switch(t=To(i),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function _r(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);he(e)}var zn=new Map,g0=new Set;function Ro(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ba=k.d;k.d={f:uw,r:dw,D:fw,C:hw,L:mw,m:pw,X:vw,S:gw,M:bw};function uw(){var e=Ba.f(),t=yo();return e||t}function dw(e){var t=me(e);t!==null&&t.tag===5&&t.type==="form"?zg(t):Ba.r(e)}var Nl=typeof document>"u"?null:document;function v0(e,t,i){var r=Nl;if(r&&typeof t=="string"&&t){var u=Nn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof i=="string"&&(u+='[crossorigin="'+i+'"]'),g0.has(u)||(g0.add(u),e={rel:e,crossOrigin:i,href:t},r.querySelector(u)===null&&(t=r.createElement("link"),Ft(t,"link",e),Oe(t),r.head.appendChild(t)))}}function fw(e){Ba.D(e),v0("dns-prefetch",e,null)}function hw(e,t){Ba.C(e,t),v0("preconnect",e,t)}function mw(e,t,i){Ba.L(e,t,i);var r=Nl;if(r&&e&&t){var u='link[rel="preload"][as="'+Nn(t)+'"]';t==="image"&&i&&i.imageSrcSet?(u+='[imagesrcset="'+Nn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(u+='[imagesizes="'+Nn(i.imageSizes)+'"]')):u+='[href="'+Nn(e)+'"]';var h=u;switch(t){case"style":h=Ml(e);break;case"script":h=Al(e)}zn.has(h)||(e=v({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),zn.set(h,e),r.querySelector(u)!==null||t==="style"&&r.querySelector(Fr(h))||t==="script"&&r.querySelector(qr(h))||(t=r.createElement("link"),Ft(t,"link",e),Oe(t),r.head.appendChild(t)))}}function pw(e,t){Ba.m(e,t);var i=Nl;if(i&&e){var r=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Nn(r)+'"][href="'+Nn(e)+'"]',h=u;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Al(e)}if(!zn.has(h)&&(e=v({rel:"modulepreload",href:e},t),zn.set(h,e),i.querySelector(u)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(qr(h)))return}r=i.createElement("link"),Ft(r,"link",e),Oe(r),i.head.appendChild(r)}}}function gw(e,t,i){Ba.S(e,t,i);var r=Nl;if(r&&e){var u=Ne(r).hoistableStyles,h=Ml(e);t=t||"default";var y=u.get(h);if(!y){var w={loading:0,preload:null};if(y=r.querySelector(Fr(h)))w.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},i),(i=zn.get(h))&&Fd(e,i);var N=y=r.createElement("link");Oe(N),Ft(N,"link",e),N._p=new Promise(function(F,X){N.onload=F,N.onerror=X}),N.addEventListener("load",function(){w.loading|=1}),N.addEventListener("error",function(){w.loading|=2}),w.loading|=4,No(y,t,r)}y={type:"stylesheet",instance:y,count:1,state:w},u.set(h,y)}}}function vw(e,t){Ba.X(e,t);var i=Nl;if(i&&e){var r=Ne(i).hoistableScripts,u=Al(e),h=r.get(u);h||(h=i.querySelector(qr(u)),h||(e=v({src:e,async:!0},t),(t=zn.get(u))&&qd(e,t),h=i.createElement("script"),Oe(h),Ft(h,"link",e),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},r.set(u,h))}}function bw(e,t){Ba.M(e,t);var i=Nl;if(i&&e){var r=Ne(i).hoistableScripts,u=Al(e),h=r.get(u);h||(h=i.querySelector(qr(u)),h||(e=v({src:e,async:!0,type:"module"},t),(t=zn.get(u))&&qd(e,t),h=i.createElement("script"),Oe(h),Ft(h,"link",e),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},r.set(u,h))}}function b0(e,t,i,r){var u=(u=Ue.current)?Ro(u):null;if(!u)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Ml(i.href),i=Ne(u).hoistableStyles,r=i.get(t),r||(r={type:"style",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Ml(i.href);var h=Ne(u).hoistableStyles,y=h.get(e);if(y||(u=u.ownerDocument||u,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,y),(h=u.querySelector(Fr(e)))&&!h._p&&(y.instance=h,y.state.loading=5),zn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},zn.set(e,i),h||yw(u,e,i,y.state))),t&&r===null)throw Error(o(528,""));return y}if(t&&r!==null)throw Error(o(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Al(i),i=Ne(u).hoistableScripts,r=i.get(t),r||(r={type:"script",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ml(e){return'href="'+Nn(e)+'"'}function Fr(e){return'link[rel="stylesheet"]['+e+"]"}function y0(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function yw(e,t,i,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Ft(t,"link",i),Oe(t),e.head.appendChild(t))}function Al(e){return'[src="'+Nn(e)+'"]'}function qr(e){return"script[async]"+e}function x0(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Nn(i.href)+'"]');if(r)return t.instance=r,Oe(r),r;var u=v({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Oe(r),Ft(r,"style",u),No(r,i.precedence,e),t.instance=r;case"stylesheet":u=Ml(i.href);var h=e.querySelector(Fr(u));if(h)return t.state.loading|=4,t.instance=h,Oe(h),h;r=y0(i),(u=zn.get(u))&&Fd(r,u),h=(e.ownerDocument||e).createElement("link"),Oe(h);var y=h;return y._p=new Promise(function(w,N){y.onload=w,y.onerror=N}),Ft(h,"link",r),t.state.loading|=4,No(h,i.precedence,e),t.instance=h;case"script":return h=Al(i.src),(u=e.querySelector(qr(h)))?(t.instance=u,Oe(u),u):(r=i,(u=zn.get(h))&&(r=v({},i),qd(r,u)),e=e.ownerDocument||e,u=e.createElement("script"),Oe(u),Ft(u,"link",r),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,No(r,i.precedence,e));return t.instance}function No(e,t,i){for(var r=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=r.length?r[r.length-1]:null,h=u,y=0;y<r.length;y++){var w=r[y];if(w.dataset.precedence===t)h=w;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Fd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function qd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Mo=null;function j0(e,t,i){if(Mo===null){var r=new Map,u=Mo=new Map;u.set(i,r)}else u=Mo,r=u.get(i),r||(r=new Map,u.set(i,r));if(r.has(e))return r;for(r.set(e,null),i=i.getElementsByTagName(e),u=0;u<i.length;u++){var h=i[u];if(!(h[oe]||h[M]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var y=h.getAttribute(t)||"";y=e+y;var w=r.get(y);w?w.push(h):r.set(y,[h])}}return r}function S0(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function xw(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function w0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var Hr=null;function jw(){}function Sw(e,t,i){if(Hr===null)throw Error(o(475));var r=Hr;if(t.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var u=Ml(i.href),h=e.querySelector(Fr(u));if(h){e=h._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(r.count++,r=Ao.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=h,Oe(h);return}h=e.ownerDocument||e,i=y0(i),(u=zn.get(u))&&Fd(i,u),h=h.createElement("link"),Oe(h);var y=h;y._p=new Promise(function(w,N){y.onload=w,y.onerror=N}),Ft(h,"link",i),t.instance=h}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(r.count++,t=Ao.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}function ww(){if(Hr===null)throw Error(o(475));var e=Hr;return e.stylesheets&&e.count===0&&Hd(e,e.stylesheets),0<e.count?function(t){var i=setTimeout(function(){if(e.stylesheets&&Hd(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(i)}}:null}function Ao(){if(this.count--,this.count===0){if(this.stylesheets)Hd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $o=null;function Hd(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$o=new Map,t.forEach(Cw,e),$o=null,Ao.call(e))}function Cw(e,t){if(!(t.state.loading&4)){var i=$o.get(e);if(i)var r=i.get(null);else{i=new Map,$o.set(e,i);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var y=u[h];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(i.set(y.dataset.precedence,y),r=y)}r&&i.set(null,r)}u=t.instance,y=u.getAttribute("data-precedence"),h=i.get(y)||r,h===r&&i.set(null,u),i.set(y,u),this.count++,r=Ao.bind(this),u.addEventListener("load",r),u.addEventListener("error",r),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Pr={$$typeof:B,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function Ew(e,t,i,r,u,h,y,w){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ja(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ja(0),this.hiddenUpdates=ja(null),this.identifierPrefix=r,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function C0(e,t,i,r,u,h,y,w,N,F,X,J){return e=new Ew(e,t,i,y,w,N,F,J),t=1,h===!0&&(t|=24),h=pn(3,null,null,t),e.current=h,h.stateNode=e,t=Su(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:r,isDehydrated:i,cache:t},Du(h),e}function E0(e){return e?(e=ol,e):ol}function D0(e,t,i,r,u,h){u=E0(u),r.context===null?r.context=u:r.pendingContext=u,r=Ya(t),r.payload={element:i},h=h===void 0?null:h,h!==null&&(r.callback=h),i=Xa(e,r,t),i!==null&&(xn(i,e,t),br(i,e,t))}function T0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Pd(e,t){T0(e,t),(e=e.alternate)&&T0(e,t)}function R0(e){if(e.tag===13){var t=sl(e,67108864);t!==null&&xn(t,e,67108864),Pd(e,67108864)}}var Lo=!0;function Dw(e,t,i,r){var u=U.T;U.T=null;var h=k.p;try{k.p=2,kd(e,t,i,r)}finally{k.p=h,U.T=u}}function Tw(e,t,i,r){var u=U.T;U.T=null;var h=k.p;try{k.p=8,kd(e,t,i,r)}finally{k.p=h,U.T=u}}function kd(e,t,i,r){if(Lo){var u=Id(r);if(u===null)Md(e,t,r,Oo,i),M0(e,r);else if(Nw(u,e,t,i,r))r.stopPropagation();else if(M0(e,r),t&4&&-1<Rw.indexOf(e)){for(;u!==null;){var h=me(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var y=en(h.pendingLanes);if(y!==0){var w=h;for(w.pendingLanes|=2,w.entangledLanes|=2;y;){var N=1<<31-Ve(y);w.entanglements[1]|=N,y&=~N}ua(h),(Xe&6)===0&&(vo=Yt()+500,Ur(0))}}break;case 13:w=sl(h,2),w!==null&&xn(w,h,2),yo(),Pd(h,2)}if(h=Id(r),h===null&&Md(e,t,r,Oo,i),h===u)break;u=h}u!==null&&r.stopPropagation()}else Md(e,t,r,null,i)}}function Id(e){return e=Qc(e),Vd(e)}var Oo=null;function Vd(e){if(Oo=null,e=ue(e),e!==null){var t=d(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=f(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Oo=e,null}function N0(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"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(Zi()){case ga:return 2;case un:return 8;case Hn:case Pa:return 32;case yi:return 268435456;default:return 32}default:return 32}}var Gd=!1,si=null,oi=null,ci=null,kr=new Map,Ir=new Map,ui=[],Rw="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 M0(e,t){switch(e){case"focusin":case"focusout":si=null;break;case"dragenter":case"dragleave":oi=null;break;case"mouseover":case"mouseout":ci=null;break;case"pointerover":case"pointerout":kr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ir.delete(t.pointerId)}}function Vr(e,t,i,r,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:i,eventSystemFlags:r,nativeEvent:h,targetContainers:[u]},t!==null&&(t=me(t),t!==null&&R0(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function Nw(e,t,i,r,u){switch(t){case"focusin":return si=Vr(si,e,t,i,r,u),!0;case"dragenter":return oi=Vr(oi,e,t,i,r,u),!0;case"mouseover":return ci=Vr(ci,e,t,i,r,u),!0;case"pointerover":var h=u.pointerId;return kr.set(h,Vr(kr.get(h)||null,e,t,i,r,u)),!0;case"gotpointercapture":return h=u.pointerId,Ir.set(h,Vr(Ir.get(h)||null,e,t,i,r,u)),!0}return!1}function A0(e){var t=ue(e.target);if(t!==null){var i=d(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,aa(e.priority,function(){if(i.tag===13){var r=yn();r=St(r);var u=sl(i,r);u!==null&&xn(u,i,r),Pd(i,r)}});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Id(e.nativeEvent);if(i===null){i=e.nativeEvent;var r=new i.constructor(i.type,i);Xc=r,i.target.dispatchEvent(r),Xc=null}else return t=me(i),t!==null&&R0(t),e.blockedOn=i,!1;t.shift()}return!0}function $0(e,t,i){Uo(e)&&i.delete(t)}function Mw(){Gd=!1,si!==null&&Uo(si)&&(si=null),oi!==null&&Uo(oi)&&(oi=null),ci!==null&&Uo(ci)&&(ci=null),kr.forEach($0),Ir.forEach($0)}function zo(e,t){e.blockedOn===t&&(e.blockedOn=null,Gd||(Gd=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Mw)))}var Bo=null;function L0(e){Bo!==e&&(Bo=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Bo===e&&(Bo=null);for(var t=0;t<e.length;t+=3){var i=e[t],r=e[t+1],u=e[t+2];if(typeof r!="function"){if(Vd(r||i)===null)continue;break}var h=me(i);h!==null&&(e.splice(t,3),t-=3,Vu(h,{pending:!0,data:u,method:i.method,action:r},r,u))}}))}function Gr(e){function t(N){return zo(N,e)}si!==null&&zo(si,e),oi!==null&&zo(oi,e),ci!==null&&zo(ci,e),kr.forEach(t),Ir.forEach(t);for(var i=0;i<ui.length;i++){var r=ui[i];r.blockedOn===e&&(r.blockedOn=null)}for(;0<ui.length&&(i=ui[0],i.blockedOn===null);)A0(i),i.blockedOn===null&&ui.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(r=0;r<i.length;r+=3){var u=i[r],h=i[r+1],y=u[L]||null;if(typeof h=="function")y||L0(i);else if(y){var w=null;if(h&&h.hasAttribute("formAction")){if(u=h,y=h[L]||null)w=y.formAction;else if(Vd(u)!==null)continue}else w=y.action;typeof w=="function"?i[r+1]=w:(i.splice(r,3),r-=3),L0(i)}}}function Yd(e){this._internalRoot=e}_o.prototype.render=Yd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var i=t.current,r=yn();D0(i,r,e,t,null,null)},_o.prototype.unmount=Yd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;D0(e.current,2,null,e,null,null),yo(),t[q]=null}};function _o(e){this._internalRoot=e}_o.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rt();e={blockedOn:null,target:e,priority:t};for(var i=0;i<ui.length&&t!==0&&t<ui[i].priority;i++);ui.splice(i,0,e),i===0&&A0(e)}};var O0=n.version;if(O0!=="19.1.0")throw Error(o(527,O0,"19.1.0"));k.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=m(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var Aw={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fo.isDisabled&&Fo.supportsFiber)try{ta=Fo.inject(Aw),rt=Fo}catch{}}return Yr.createRoot=function(e,t){if(!c(e))throw Error(o(299));var i=!1,r="",u=Kg,h=Zg,y=Wg,w=null;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(w=t.unstable_transitionCallbacks)),t=C0(e,1,!1,null,null,i,r,u,h,y,w,null),e[q]=t.current,Nd(e),new Yd(t)},Yr.hydrateRoot=function(e,t,i){if(!c(e))throw Error(o(299));var r=!1,u="",h=Kg,y=Zg,w=Wg,N=null,F=null;return i!=null&&(i.unstable_strictMode===!0&&(r=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(N=i.unstable_transitionCallbacks),i.formState!==void 0&&(F=i.formState)),t=C0(e,1,!0,t,i??null,r,u,h,y,w,N,F),t.context=E0(null),i=t.current,r=yn(),r=St(r),u=Ya(r),u.callback=null,Xa(i,u,r),i=r,t.current.lanes=i,nt(t,i),ua(t),e[q]=t.current,Nd(e),new _o(t)},Yr.version="19.1.0",Yr}var F0;function s4(){if(F0)return Qd.exports;F0=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(n){console.error(n)}}return a(),Qd.exports=r4(),Qd.exports}var o4=s4();/**
|
|
26
|
+
* @remix-run/router v1.23.0
|
|
27
|
+
*
|
|
28
|
+
* Copyright (c) Remix Software Inc.
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the MIT license found in the
|
|
31
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
32
|
+
*
|
|
33
|
+
* @license MIT
|
|
34
|
+
*/function ct(){return ct=Object.assign?Object.assign.bind():function(a){for(var n=1;n<arguments.length;n++){var l=arguments[n];for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(a[o]=l[o])}return a},ct.apply(this,arguments)}var vt;(function(a){a.Pop="POP",a.Push="PUSH",a.Replace="REPLACE"})(vt||(vt={}));const q0="popstate";function c4(a){a===void 0&&(a={});function n(o,c){let{pathname:d,search:f,hash:p}=o.location;return os("",{pathname:d,search:f,hash:p},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function l(o,c){return typeof c=="string"?c:Vi(c)}return d4(n,l,null,a)}function De(a,n){if(a===!1||a===null||typeof a>"u")throw new Error(n)}function Pl(a,n){if(!a){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function u4(){return Math.random().toString(36).substr(2,8)}function H0(a,n){return{usr:a.state,key:a.key,idx:n}}function os(a,n,l,o){return l===void 0&&(l=null),ct({pathname:typeof a=="string"?a:a.pathname,search:"",hash:""},typeof n=="string"?qa(n):n,{state:l,key:n&&n.key||o||u4()})}function Vi(a){let{pathname:n="/",search:l="",hash:o=""}=a;return l&&l!=="?"&&(n+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(n+=o.charAt(0)==="#"?o:"#"+o),n}function qa(a){let n={};if(a){let l=a.indexOf("#");l>=0&&(n.hash=a.substr(l),a=a.substr(0,l));let o=a.indexOf("?");o>=0&&(n.search=a.substr(o),a=a.substr(0,o)),a&&(n.pathname=a)}return n}function d4(a,n,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:d=!1}=o,f=c.history,p=vt.Pop,m=null,g=v();g==null&&(g=0,f.replaceState(ct({},f.state,{idx:g}),""));function v(){return(f.state||{idx:null}).idx}function b(){p=vt.Pop;let R=v(),E=R==null?null:R-g;g=R,m&&m({action:p,location:S.location,delta:E})}function x(R,E){p=vt.Push;let A=os(S.location,R,E);g=v()+1;let B=H0(A,g),H=S.createHref(A);try{f.pushState(B,"",H)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;c.location.assign(H)}d&&m&&m({action:p,location:S.location,delta:1})}function j(R,E){p=vt.Replace;let A=os(S.location,R,E);g=v();let B=H0(A,g),H=S.createHref(A);f.replaceState(B,"",H),d&&m&&m({action:p,location:S.location,delta:0})}function D(R){let E=c.location.origin!=="null"?c.location.origin:c.location.href,A=typeof R=="string"?R:Vi(R);return A=A.replace(/ $/,"%20"),De(E,"No window.location.(origin|href) available to create URL for href: "+A),new URL(A,E)}let S={get action(){return p},get location(){return a(c,f)},listen(R){if(m)throw new Error("A history only accepts one active listener");return c.addEventListener(q0,b),m=R,()=>{c.removeEventListener(q0,b),m=null}},createHref(R){return n(c,R)},createURL:D,encodeLocation(R){let E=D(R);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:x,replace:j,go(R){return f.go(R)}};return S}var Ke;(function(a){a.data="data",a.deferred="deferred",a.redirect="redirect",a.error="error"})(Ke||(Ke={}));const f4=new Set(["lazy","caseSensitive","path","id","index","children"]);function h4(a){return a.index===!0}function vc(a,n,l,o){return l===void 0&&(l=[]),o===void 0&&(o={}),a.map((c,d)=>{let f=[...l,String(d)],p=typeof c.id=="string"?c.id:f.join("-");if(De(c.index!==!0||!c.children,"Cannot specify children on an index route"),De(!o[p],'Found a route id collision on id "'+p+`". Route id's must be globally unique within Data Router usages`),h4(c)){let m=ct({},c,n(c),{id:p});return o[p]=m,m}else{let m=ct({},c,n(c),{id:p,children:void 0});return o[p]=m,c.children&&(m.children=vc(c.children,n,f,o)),m}})}function Pi(a,n,l){return l===void 0&&(l="/"),mc(a,n,l,!1)}function mc(a,n,l,o){let c=typeof n=="string"?qa(n):n,d=Xn(c.pathname||"/",l);if(d==null)return null;let f=Bx(a);m4(f);let p=null;for(let m=0;p==null&&m<f.length;++m){let g=Fx(d);p=w4(f[m],g,o)}return p}function zx(a,n){let{route:l,pathname:o,params:c}=a;return{id:l.id,pathname:o,params:c,data:n[l.id],handle:l.handle}}function Bx(a,n,l,o){n===void 0&&(n=[]),l===void 0&&(l=[]),o===void 0&&(o="");let c=(d,f,p)=>{let m={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};m.relativePath.startsWith("/")&&(De(m.relativePath.startsWith(o),'Absolute route path "'+m.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),m.relativePath=m.relativePath.slice(o.length));let g=Fa([o,m.relativePath]),v=l.concat(m);d.children&&d.children.length>0&&(De(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),Bx(d.children,n,v,g)),!(d.path==null&&!d.index)&&n.push({path:g,score:j4(g,d.index),routesMeta:v})};return a.forEach((d,f)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))c(d,f);else for(let m of _x(d.path))c(d,f,m)}),n}function _x(a){let n=a.split("/");if(n.length===0)return[];let[l,...o]=n,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(o.length===0)return c?[d,""]:[d];let f=_x(o.join("/")),p=[];return p.push(...f.map(m=>m===""?d:[d,m].join("/"))),c&&p.push(...f),p.map(m=>a.startsWith("/")&&m===""?"/":m)}function m4(a){a.sort((n,l)=>n.score!==l.score?l.score-n.score:S4(n.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}const p4=/^:[\w-]+$/,g4=3,v4=2,b4=1,y4=10,x4=-2,P0=a=>a==="*";function j4(a,n){let l=a.split("/"),o=l.length;return l.some(P0)&&(o+=x4),n&&(o+=v4),l.filter(c=>!P0(c)).reduce((c,d)=>c+(p4.test(d)?g4:d===""?b4:y4),o)}function S4(a,n){return a.length===n.length&&a.slice(0,-1).every((o,c)=>o===n[c])?a[a.length-1]-n[n.length-1]:0}function w4(a,n,l){l===void 0&&(l=!1);let{routesMeta:o}=a,c={},d="/",f=[];for(let p=0;p<o.length;++p){let m=o[p],g=p===o.length-1,v=d==="/"?n:n.slice(d.length)||"/",b=cs({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},v),x=m.route;if(!b&&g&&l&&!o[o.length-1].route.index&&(b=cs({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:Fa([d,b.pathname]),pathnameBase:T4(Fa([d,b.pathnameBase])),route:x}),b.pathnameBase!=="/"&&(d=Fa([d,b.pathnameBase]))}return f}function cs(a,n){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[l,o]=C4(a.path,a.caseSensitive,a.end),c=n.match(l);if(!c)return null;let d=c[0],f=d.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:o.reduce((g,v,b)=>{let{paramName:x,isOptional:j}=v;if(x==="*"){let S=p[b]||"";f=d.slice(0,d.length-S.length).replace(/(.)\/+$/,"$1")}const D=p[b];return j&&!D?g[x]=void 0:g[x]=(D||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:f,pattern:a}}function C4(a,n,l){n===void 0&&(n=!1),l===void 0&&(l=!0),Pl(a==="*"||!a.endsWith("*")||a.endsWith("/*"),'Route path "'+a+'" will be treated as if it were '+('"'+a.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+a.replace(/\*$/,"/*")+'".'));let o=[],c="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,m)=>(o.push({paramName:p,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return a.endsWith("*")?(o.push({paramName:"*"}),c+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":a!==""&&a!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,n?void 0:"i"),o]}function Fx(a){try{return a.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Pl(!1,'The URL path "'+a+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+n+").")),a}}function Xn(a,n){if(n==="/")return a;if(!a.toLowerCase().startsWith(n.toLowerCase()))return null;let l=n.endsWith("/")?n.length-1:n.length,o=a.charAt(l);return o&&o!=="/"?null:a.slice(l)||"/"}function E4(a,n){n===void 0&&(n="/");let{pathname:l,search:o="",hash:c=""}=typeof a=="string"?qa(a):a;return{pathname:l?l.startsWith("/")?l:D4(l,n):n,search:R4(o),hash:N4(c)}}function D4(a,n){let l=n.replace(/\/+$/,"").split("/");return a.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function Wd(a,n,l,o){return"Cannot include a '"+a+"' character in a manually specified "+("`to."+n+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function qx(a){return a.filter((n,l)=>l===0||n.route.path&&n.route.path.length>0)}function Ac(a,n){let l=qx(a);return n?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function $c(a,n,l,o){o===void 0&&(o=!1);let c;typeof a=="string"?c=qa(a):(c=ct({},a),De(!c.pathname||!c.pathname.includes("?"),Wd("?","pathname","search",c)),De(!c.pathname||!c.pathname.includes("#"),Wd("#","pathname","hash",c)),De(!c.search||!c.search.includes("#"),Wd("#","search","hash",c)));let d=a===""||c.pathname==="",f=d?"/":c.pathname,p;if(f==null)p=l;else{let b=n.length-1;if(!o&&f.startsWith("..")){let x=f.split("/");for(;x[0]==="..";)x.shift(),b-=1;c.pathname=x.join("/")}p=b>=0?n[b]:"/"}let m=E4(c,p),g=f&&f!=="/"&&f.endsWith("/"),v=(d||f===".")&&l.endsWith("/");return!m.pathname.endsWith("/")&&(g||v)&&(m.pathname+="/"),m}const Fa=a=>a.join("/").replace(/\/\/+/g,"/"),T4=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),R4=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,N4=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a;class M4 extends Error{}class bc{constructor(n,l,o,c){c===void 0&&(c=!1),this.status=n,this.statusText=l||"",this.internal=c,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}}function us(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}const Hx=["post","put","patch","delete"],A4=new Set(Hx),$4=["get",...Hx],L4=new Set($4),O4=new Set([301,302,303,307,308]),U4=new Set([307,308]),Jd={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},z4={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Bl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Rm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,B4=a=>({hasErrorBoundary:!!a.hasErrorBoundary}),Px="remix-router-transitions";function _4(a){const n=a.window?a.window:typeof window<"u"?window:void 0,l=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u",o=!l;De(a.routes.length>0,"You must provide a non-empty routes array to createRouter");let c;if(a.mapRouteProperties)c=a.mapRouteProperties;else if(a.detectErrorBoundary){let M=a.detectErrorBoundary;c=L=>({hasErrorBoundary:M(L)})}else c=B4;let d={},f=vc(a.routes,c,void 0,d),p,m=a.basename||"/",g=a.dataStrategy||P4,v=a.patchRoutesOnNavigation,b=ct({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},a.future),x=null,j=new Set,D=null,S=null,R=null,E=a.hydrationData!=null,A=Pi(f,a.history.location,m),B=!1,H=null;if(A==null&&!v){let M=sn(404,{pathname:a.history.location.pathname}),{matches:L,route:q}=J0(f);A=L,H={[q.id]:M}}A&&!a.hydrationData&&dt(A,f,a.history.location.pathname).active&&(A=null);let V;if(A)if(A.some(M=>M.route.lazy))V=!1;else if(!A.some(M=>M.route.loader))V=!0;else if(b.v7_partialHydration){let M=a.hydrationData?a.hydrationData.loaderData:null,L=a.hydrationData?a.hydrationData.errors:null;if(L){let q=A.findIndex(ee=>L[ee.route.id]!==void 0);V=A.slice(0,q+1).every(ee=>!sm(ee.route,M,L))}else V=A.every(q=>!sm(q.route,M,L))}else V=a.hydrationData!=null;else if(V=!1,A=[],b.v7_partialHydration){let M=dt(null,f,a.history.location.pathname);M.active&&M.matches&&(B=!0,A=M.matches)}let K,T={historyAction:a.history.action,location:a.history.location,matches:A,initialized:V,navigation:Jd,restoreScrollPosition:a.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:a.hydrationData&&a.hydrationData.loaderData||{},actionData:a.hydrationData&&a.hydrationData.actionData||null,errors:a.hydrationData&&a.hydrationData.errors||H,fetchers:new Map,blockers:new Map},O=vt.Pop,Q=!1,te,ae=!1,se=new Map,Ee=null,G=!1,W=!1,U=[],k=new Set,Y=new Map,ne=0,re=-1,ge=new Map,ie=new Set,ce=new Map,Se=new Map,je=new Set,Ue=new Map,Ot=new Map,Dt;function Tt(){if(x=a.history.listen(M=>{let{action:L,location:q,delta:ee}=M;if(Dt){Dt(),Dt=void 0;return}Pl(Ot.size===0||ee!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let le=Si({currentLocation:T.location,nextLocation:q,historyAction:L});if(le&&ee!=null){let fe=new Promise(be=>{Dt=be});a.history.go(ee*-1),xa(le,{state:"blocked",location:q,proceed(){xa(le,{state:"proceeding",proceed:void 0,reset:void 0,location:q}),fe.then(()=>a.history.go(ee))},reset(){let be=new Map(T.blockers);be.set(le,Bl),ke({blockers:be})}});return}return Vt(L,q)}),l){nC(n,se);let M=()=>aC(n,se);n.addEventListener("pagehide",M),Ee=()=>n.removeEventListener("pagehide",M)}return T.initialized||Vt(vt.Pop,T.location,{initialHydration:!0}),K}function Be(){x&&x(),Ee&&Ee(),j.clear(),te&&te.abort(),T.fetchers.forEach((M,L)=>Xt(L)),T.blockers.forEach((M,L)=>ji(L))}function En(M){return j.add(M),()=>j.delete(M)}function ke(M,L){L===void 0&&(L={}),T=ct({},T,M);let q=[],ee=[];b.v7_fetcherPersist&&T.fetchers.forEach((le,fe)=>{le.state==="idle"&&(je.has(fe)?ee.push(fe):q.push(fe))}),je.forEach(le=>{!T.fetchers.has(le)&&!Y.has(le)&&ee.push(le)}),[...j].forEach(le=>le(T,{deletedFetchers:ee,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),b.v7_fetcherPersist?(q.forEach(le=>T.fetchers.delete(le)),ee.forEach(le=>Xt(le))):ee.forEach(le=>je.delete(le))}function Ut(M,L,q){var ee,le;let{flushSync:fe}=q===void 0?{}:q,be=T.actionData!=null&&T.navigation.formMethod!=null&&Vn(T.navigation.formMethod)&&T.navigation.state==="loading"&&((ee=M.state)==null?void 0:ee._isRedirect)!==!0,oe;L.actionData?Object.keys(L.actionData).length>0?oe=L.actionData:oe=null:be?oe=T.actionData:oe=null;let he=L.loaderData?Z0(T.loaderData,L.loaderData,L.matches||[],L.errors):T.loaderData,ue=T.blockers;ue.size>0&&(ue=new Map(ue),ue.forEach((Ne,Oe)=>ue.set(Oe,Bl)));let me=Q===!0||T.navigation.formMethod!=null&&Vn(T.navigation.formMethod)&&((le=M.state)==null?void 0:le._isRedirect)!==!0;p&&(f=p,p=void 0),G||O===vt.Pop||(O===vt.Push?a.history.push(M,M.state):O===vt.Replace&&a.history.replace(M,M.state));let Ce;if(O===vt.Pop){let Ne=se.get(T.location.pathname);Ne&&Ne.has(M.pathname)?Ce={currentLocation:T.location,nextLocation:M}:se.has(M.pathname)&&(Ce={currentLocation:M,nextLocation:T.location})}else if(ae){let Ne=se.get(T.location.pathname);Ne?Ne.add(M.pathname):(Ne=new Set([M.pathname]),se.set(T.location.pathname,Ne)),Ce={currentLocation:T.location,nextLocation:M}}ke(ct({},L,{actionData:oe,loaderData:he,historyAction:O,location:M,initialized:!0,navigation:Jd,revalidation:"idle",restoreScrollPosition:St(M,L.matches||T.matches),preventScrollReset:me,blockers:ue}),{viewTransitionOpts:Ce,flushSync:fe===!0}),O=vt.Pop,Q=!1,ae=!1,G=!1,W=!1,U=[]}async function It(M,L){if(typeof M=="number"){a.history.go(M);return}let q=rm(T.location,T.matches,m,b.v7_prependBasename,M,b.v7_relativeSplatPath,L?.fromRouteId,L?.relative),{path:ee,submission:le,error:fe}=k0(b.v7_normalizeFormMethod,!1,q,L),be=T.location,oe=os(T.location,ee,L&&L.state);oe=ct({},oe,a.history.encodeLocation(oe));let he=L&&L.replace!=null?L.replace:void 0,ue=vt.Push;he===!0?ue=vt.Replace:he===!1||le!=null&&Vn(le.formMethod)&&le.formAction===T.location.pathname+T.location.search&&(ue=vt.Replace);let me=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,Ce=(L&&L.flushSync)===!0,Ne=Si({currentLocation:be,nextLocation:oe,historyAction:ue});if(Ne){xa(Ne,{state:"blocked",location:oe,proceed(){xa(Ne,{state:"proceeding",proceed:void 0,reset:void 0,location:oe}),It(M,L)},reset(){let Oe=new Map(T.blockers);Oe.set(Ne,Bl),ke({blockers:Oe})}});return}return await Vt(ue,oe,{submission:le,pendingError:fe,preventScrollReset:me,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:Ce})}function ea(){if(rt(),ke({revalidation:"loading"}),T.navigation.state!=="submitting"){if(T.navigation.state==="idle"){Vt(T.historyAction,T.location,{startUninterruptedRevalidation:!0});return}Vt(O||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:ae===!0})}}async function Vt(M,L,q){te&&te.abort(),te=null,O=M,G=(q&&q.startUninterruptedRevalidation)===!0,dn(T.location,T.matches),Q=(q&&q.preventScrollReset)===!0,ae=(q&&q.enableViewTransition)===!0;let ee=p||f,le=q&&q.overrideNavigation,fe=q!=null&&q.initialHydration&&T.matches&&T.matches.length>0&&!B?T.matches:Pi(ee,L,m),be=(q&&q.flushSync)===!0;if(fe&&T.initialized&&!W&&X4(T.location,L)&&!(q&&q.submission&&Vn(q.submission.formMethod))){Ut(L,{matches:fe},{flushSync:be});return}let oe=dt(fe,ee,L.pathname);if(oe.active&&oe.matches&&(fe=oe.matches),!fe){let{error:Ge,notFoundMatches:_e,route:Ie}=ja(L.pathname);Ut(L,{matches:_e,loaderData:{},errors:{[Ie.id]:Ge}},{flushSync:be});return}te=new AbortController;let he=$l(a.history,L,te.signal,q&&q.submission),ue;if(q&&q.pendingError)ue=[ki(fe).route.id,{type:Ke.error,error:q.pendingError}];else if(q&&q.submission&&Vn(q.submission.formMethod)){let Ge=await Yt(he,L,q.submission,fe,oe.active,{replace:q.replace,flushSync:be});if(Ge.shortCircuited)return;if(Ge.pendingActionResult){let[_e,Ie]=Ge.pendingActionResult;if(jn(Ie)&&us(Ie.error)&&Ie.error.status===404){te=null,Ut(L,{matches:Ge.matches,loaderData:{},errors:{[_e]:Ie.error}});return}}fe=Ge.matches||fe,ue=Ge.pendingActionResult,le=ef(L,q.submission),be=!1,oe.active=!1,he=$l(a.history,he.url,he.signal)}let{shortCircuited:me,matches:Ce,loaderData:Ne,errors:Oe}=await Zi(he,L,fe,oe.active,le,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,be,ue);me||(te=null,Ut(L,ct({matches:Ce||fe},W0(ue),{loaderData:Ne,errors:Oe})))}async function Yt(M,L,q,ee,le,fe){fe===void 0&&(fe={}),rt();let be=eC(L,q);if(ke({navigation:be},{flushSync:fe.flushSync===!0}),le){let ue=await Rt(ee,L.pathname,M.signal);if(ue.type==="aborted")return{shortCircuited:!0};if(ue.type==="error"){let me=ki(ue.partialMatches).route.id;return{matches:ue.partialMatches,pendingActionResult:[me,{type:Ke.error,error:ue.error}]}}else if(ue.matches)ee=ue.matches;else{let{notFoundMatches:me,error:Ce,route:Ne}=ja(L.pathname);return{matches:me,pendingActionResult:[Ne.id,{type:Ke.error,error:Ce}]}}}let oe,he=ts(ee,L);if(!he.route.action&&!he.route.lazy)oe={type:Ke.error,error:sn(405,{method:M.method,pathname:L.pathname,routeId:he.route.id})};else if(oe=(await va("action",T,M,[he],ee,null))[he.route.id],M.signal.aborted)return{shortCircuited:!0};if(Ii(oe)){let ue;return fe&&fe.replace!=null?ue=fe.replace:ue=X0(oe.response.headers.get("Location"),new URL(M.url),m)===T.location.pathname+T.location.search,await Dn(M,oe,!0,{submission:q,replace:ue}),{shortCircuited:!0}}if(pi(oe))throw sn(400,{type:"defer-action"});if(jn(oe)){let ue=ki(ee,he.route.id);return(fe&&fe.replace)!==!0&&(O=vt.Push),{matches:ee,pendingActionResult:[ue.route.id,oe]}}return{matches:ee,pendingActionResult:[he.route.id,oe]}}async function Zi(M,L,q,ee,le,fe,be,oe,he,ue,me){let Ce=le||ef(L,fe),Ne=fe||be||tb(Ce),Oe=!G&&(!b.v7_partialHydration||!he);if(ee){if(Oe){let Ye=ga(me);ke(ct({navigation:Ce},Ye!==void 0?{actionData:Ye}:{}),{flushSync:ue})}let ze=await Rt(q,L.pathname,M.signal);if(ze.type==="aborted")return{shortCircuited:!0};if(ze.type==="error"){let Ye=ki(ze.partialMatches).route.id;return{matches:ze.partialMatches,loaderData:{},errors:{[Ye]:ze.error}}}else if(ze.matches)q=ze.matches;else{let{error:Ye,notFoundMatches:la,route:Sa}=ja(L.pathname);return{matches:la,loaderData:{},errors:{[Sa.id]:Ye}}}}let Ge=p||f,[_e,Ie]=V0(a.history,T,q,Ne,L,b.v7_partialHydration&&he===!0,b.v7_skipActionErrorRevalidation,W,U,k,je,ce,ie,Ge,m,me);if(nt(ze=>!(q&&q.some(Ye=>Ye.route.id===ze))||_e&&_e.some(Ye=>Ye.route.id===ze)),re=++ne,_e.length===0&&Ie.length===0){let ze=en();return Ut(L,ct({matches:q,loaderData:{},errors:me&&jn(me[1])?{[me[0]]:me[1].error}:null},W0(me),ze?{fetchers:new Map(T.fetchers)}:{}),{flushSync:ue}),{shortCircuited:!0}}if(Oe){let ze={};if(!ee){ze.navigation=Ce;let Ye=ga(me);Ye!==void 0&&(ze.actionData=Ye)}Ie.length>0&&(ze.fetchers=un(Ie)),ke(ze,{flushSync:ue})}Ie.forEach(ze=>{Qt(ze.key),ze.controller&&Y.set(ze.key,ze.controller)});let fn=()=>Ie.forEach(ze=>Qt(ze.key));te&&te.signal.addEventListener("abort",fn);let{loaderResults:wi,fetcherResults:Tn}=await ta(T,q,_e,Ie,M);if(M.signal.aborted)return{shortCircuited:!0};te&&te.signal.removeEventListener("abort",fn),Ie.forEach(ze=>Y.delete(ze.key));let hn=qo(wi);if(hn)return await Dn(M,hn.result,!0,{replace:oe}),{shortCircuited:!0};if(hn=qo(Tn),hn)return ie.add(hn.key),await Dn(M,hn.result,!0,{replace:oe}),{shortCircuited:!0};let{loaderData:er,errors:ia}=K0(T,q,wi,me,Ie,Tn,Ue);Ue.forEach((ze,Ye)=>{ze.subscribe(la=>{(la||ze.done)&&Ue.delete(Ye)})}),b.v7_partialHydration&&he&&T.errors&&(ia=ct({},T.errors,ia));let Rn=en(),tn=na(re),ka=Rn||tn||Ie.length>0;return ct({matches:q,loaderData:er,errors:ia},ka?{fetchers:new Map(T.fetchers)}:{})}function ga(M){if(M&&!jn(M[1]))return{[M[0]]:M[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function un(M){return M.forEach(L=>{let q=T.fetchers.get(L.key),ee=Xr(void 0,q?q.data:void 0);T.fetchers.set(L.key,ee)}),new Map(T.fetchers)}function Hn(M,L,q,ee){if(o)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Qt(M);let le=(ee&&ee.flushSync)===!0,fe=p||f,be=rm(T.location,T.matches,m,b.v7_prependBasename,q,b.v7_relativeSplatPath,L,ee?.relative),oe=Pi(fe,be,m),he=dt(oe,fe,be);if(he.active&&he.matches&&(oe=he.matches),!oe){Ve(M,L,sn(404,{pathname:be}),{flushSync:le});return}let{path:ue,submission:me,error:Ce}=k0(b.v7_normalizeFormMethod,!0,be,ee);if(Ce){Ve(M,L,Ce,{flushSync:le});return}let Ne=ts(oe,ue),Oe=(ee&&ee.preventScrollReset)===!0;if(me&&Vn(me.formMethod)){Pa(M,L,ue,Ne,oe,he.active,le,Oe,me);return}ce.set(M,{routeId:L,path:ue}),yi(M,L,ue,Ne,oe,he.active,le,Oe,me)}async function Pa(M,L,q,ee,le,fe,be,oe,he){rt(),ce.delete(M);function ue(ft){if(!ft.route.action&&!ft.route.lazy){let wa=sn(405,{method:he.formMethod,pathname:q,routeId:L});return Ve(M,L,wa,{flushSync:be}),!0}return!1}if(!fe&&ue(ee))return;let me=T.fetchers.get(M);st(M,tC(he,me),{flushSync:be});let Ce=new AbortController,Ne=$l(a.history,q,Ce.signal,he);if(fe){let ft=await Rt(le,new URL(Ne.url).pathname,Ne.signal,M);if(ft.type==="aborted")return;if(ft.type==="error"){Ve(M,L,ft.error,{flushSync:be});return}else if(ft.matches){if(le=ft.matches,ee=ts(le,q),ue(ee))return}else{Ve(M,L,sn(404,{pathname:q}),{flushSync:be});return}}Y.set(M,Ce);let Oe=ne,_e=(await va("action",T,Ne,[ee],le,M))[ee.route.id];if(Ne.signal.aborted){Y.get(M)===Ce&&Y.delete(M);return}if(b.v7_fetcherPersist&&je.has(M)){if(Ii(_e)||jn(_e)){st(M,fi(void 0));return}}else{if(Ii(_e))if(Y.delete(M),re>Oe){st(M,fi(void 0));return}else return ie.add(M),st(M,Xr(he)),Dn(Ne,_e,!1,{fetcherSubmission:he,preventScrollReset:oe});if(jn(_e)){Ve(M,L,_e.error);return}}if(pi(_e))throw sn(400,{type:"defer-action"});let Ie=T.navigation.location||T.location,fn=$l(a.history,Ie,Ce.signal),wi=p||f,Tn=T.navigation.state!=="idle"?Pi(wi,T.navigation.location,m):T.matches;De(Tn,"Didn't find any matches after fetcher action");let hn=++ne;ge.set(M,hn);let er=Xr(he,_e.data);T.fetchers.set(M,er);let[ia,Rn]=V0(a.history,T,Tn,he,Ie,!1,b.v7_skipActionErrorRevalidation,W,U,k,je,ce,ie,wi,m,[ee.route.id,_e]);Rn.filter(ft=>ft.key!==M).forEach(ft=>{let wa=ft.key,Kt=T.fetchers.get(wa),Ms=Xr(void 0,Kt?Kt.data:void 0);T.fetchers.set(wa,Ms),Qt(wa),ft.controller&&Y.set(wa,ft.controller)}),ke({fetchers:new Map(T.fetchers)});let tn=()=>Rn.forEach(ft=>Qt(ft.key));Ce.signal.addEventListener("abort",tn);let{loaderResults:ka,fetcherResults:ze}=await ta(T,Tn,ia,Rn,fn);if(Ce.signal.aborted)return;Ce.signal.removeEventListener("abort",tn),ge.delete(M),Y.delete(M),Rn.forEach(ft=>Y.delete(ft.key));let Ye=qo(ka);if(Ye)return Dn(fn,Ye.result,!1,{preventScrollReset:oe});if(Ye=qo(ze),Ye)return ie.add(Ye.key),Dn(fn,Ye.result,!1,{preventScrollReset:oe});let{loaderData:la,errors:Sa}=K0(T,Tn,ka,void 0,Rn,ze,Ue);if(T.fetchers.has(M)){let ft=fi(_e.data);T.fetchers.set(M,ft)}na(hn),T.navigation.state==="loading"&&hn>re?(De(O,"Expected pending action"),te&&te.abort(),Ut(T.navigation.location,{matches:Tn,loaderData:la,errors:Sa,fetchers:new Map(T.fetchers)})):(ke({errors:Sa,loaderData:Z0(T.loaderData,la,Tn,Sa),fetchers:new Map(T.fetchers)}),W=!1)}async function yi(M,L,q,ee,le,fe,be,oe,he){let ue=T.fetchers.get(M);st(M,Xr(he,ue?ue.data:void 0),{flushSync:be});let me=new AbortController,Ce=$l(a.history,q,me.signal);if(fe){let _e=await Rt(le,new URL(Ce.url).pathname,Ce.signal,M);if(_e.type==="aborted")return;if(_e.type==="error"){Ve(M,L,_e.error,{flushSync:be});return}else if(_e.matches)le=_e.matches,ee=ts(le,q);else{Ve(M,L,sn(404,{pathname:q}),{flushSync:be});return}}Y.set(M,me);let Ne=ne,Ge=(await va("loader",T,Ce,[ee],le,M))[ee.route.id];if(pi(Ge)&&(Ge=await Nm(Ge,Ce.signal,!0)||Ge),Y.get(M)===me&&Y.delete(M),!Ce.signal.aborted){if(je.has(M)){st(M,fi(void 0));return}if(Ii(Ge))if(re>Ne){st(M,fi(void 0));return}else{ie.add(M),await Dn(Ce,Ge,!1,{preventScrollReset:oe});return}if(jn(Ge)){Ve(M,L,Ge.error);return}De(!pi(Ge),"Unhandled fetcher deferred data"),st(M,fi(Ge.data))}}async function Dn(M,L,q,ee){let{submission:le,fetcherSubmission:fe,preventScrollReset:be,replace:oe}=ee===void 0?{}:ee;L.response.headers.has("X-Remix-Revalidate")&&(W=!0);let he=L.response.headers.get("Location");De(he,"Expected a Location header on the redirect Response"),he=X0(he,new URL(M.url),m);let ue=os(T.location,he,{_isRedirect:!0});if(l){let _e=!1;if(L.response.headers.has("X-Remix-Reload-Document"))_e=!0;else if(Rm.test(he)){const Ie=a.history.createURL(he);_e=Ie.origin!==n.location.origin||Xn(Ie.pathname,m)==null}if(_e){oe?n.location.replace(he):n.location.assign(he);return}}te=null;let me=oe===!0||L.response.headers.has("X-Remix-Replace")?vt.Replace:vt.Push,{formMethod:Ce,formAction:Ne,formEncType:Oe}=T.navigation;!le&&!fe&&Ce&&Ne&&Oe&&(le=tb(T.navigation));let Ge=le||fe;if(U4.has(L.response.status)&&Ge&&Vn(Ge.formMethod))await Vt(me,ue,{submission:ct({},Ge,{formAction:he}),preventScrollReset:be||Q,enableViewTransition:q?ae:void 0});else{let _e=ef(ue,le);await Vt(me,ue,{overrideNavigation:_e,fetcherSubmission:fe,preventScrollReset:be||Q,enableViewTransition:q?ae:void 0})}}async function va(M,L,q,ee,le,fe){let be,oe={};try{be=await k4(g,M,L,q,ee,le,fe,d,c)}catch(he){return ee.forEach(ue=>{oe[ue.route.id]={type:Ke.error,error:he}}),oe}for(let[he,ue]of Object.entries(be))if(Q4(ue)){let me=ue.result;oe[he]={type:Ke.redirect,response:G4(me,q,he,le,m,b.v7_relativeSplatPath)}}else oe[he]=await V4(ue);return oe}async function ta(M,L,q,ee,le){let fe=M.matches,be=va("loader",M,le,q,L,null),oe=Promise.all(ee.map(async me=>{if(me.matches&&me.match&&me.controller){let Ne=(await va("loader",M,$l(a.history,me.path,me.controller.signal),[me.match],me.matches,me.key))[me.match.route.id];return{[me.key]:Ne}}else return Promise.resolve({[me.key]:{type:Ke.error,error:sn(404,{pathname:me.path})}})})),he=await be,ue=(await oe).reduce((me,Ce)=>Object.assign(me,Ce),{});return await Promise.all([W4(L,he,le.signal,fe,M.loaderData),J4(L,ue,ee)]),{loaderResults:he,fetcherResults:ue}}function rt(){W=!0,U.push(...nt()),ce.forEach((M,L)=>{Y.has(L)&&k.add(L),Qt(L)})}function st(M,L,q){q===void 0&&(q={}),T.fetchers.set(M,L),ke({fetchers:new Map(T.fetchers)},{flushSync:(q&&q.flushSync)===!0})}function Ve(M,L,q,ee){ee===void 0&&(ee={});let le=ki(T.matches,L);Xt(M),ke({errors:{[le.route.id]:q},fetchers:new Map(T.fetchers)},{flushSync:(ee&&ee.flushSync)===!0})}function xi(M){return Se.set(M,(Se.get(M)||0)+1),je.has(M)&&je.delete(M),T.fetchers.get(M)||z4}function Xt(M){let L=T.fetchers.get(M);Y.has(M)&&!(L&&L.state==="loading"&&ge.has(M))&&Qt(M),ce.delete(M),ge.delete(M),ie.delete(M),b.v7_fetcherPersist&&je.delete(M),k.delete(M),T.fetchers.delete(M)}function Wi(M){let L=(Se.get(M)||0)-1;L<=0?(Se.delete(M),je.add(M),b.v7_fetcherPersist||Xt(M)):Se.set(M,L),ke({fetchers:new Map(T.fetchers)})}function Qt(M){let L=Y.get(M);L&&(L.abort(),Y.delete(M))}function ba(M){for(let L of M){let q=xi(L),ee=fi(q.data);T.fetchers.set(L,ee)}}function en(){let M=[],L=!1;for(let q of ie){let ee=T.fetchers.get(q);De(ee,"Expected fetcher: "+q),ee.state==="loading"&&(ie.delete(q),M.push(q),L=!0)}return ba(M),L}function na(M){let L=[];for(let[q,ee]of ge)if(ee<M){let le=T.fetchers.get(q);De(le,"Expected fetcher: "+q),le.state==="loading"&&(Qt(q),ge.delete(q),L.push(q))}return ba(L),L.length>0}function ya(M,L){let q=T.blockers.get(M)||Bl;return Ot.get(M)!==L&&Ot.set(M,L),q}function ji(M){T.blockers.delete(M),Ot.delete(M)}function xa(M,L){let q=T.blockers.get(M)||Bl;De(q.state==="unblocked"&&L.state==="blocked"||q.state==="blocked"&&L.state==="blocked"||q.state==="blocked"&&L.state==="proceeding"||q.state==="blocked"&&L.state==="unblocked"||q.state==="proceeding"&&L.state==="unblocked","Invalid blocker state transition: "+q.state+" -> "+L.state);let ee=new Map(T.blockers);ee.set(M,L),ke({blockers:ee})}function Si(M){let{currentLocation:L,nextLocation:q,historyAction:ee}=M;if(Ot.size===0)return;Ot.size>1&&Pl(!1,"A router only supports one blocker at a time");let le=Array.from(Ot.entries()),[fe,be]=le[le.length-1],oe=T.blockers.get(fe);if(!(oe&&oe.state==="proceeding")&&be({currentLocation:L,nextLocation:q,historyAction:ee}))return fe}function ja(M){let L=sn(404,{pathname:M}),q=p||f,{matches:ee,route:le}=J0(q);return nt(),{notFoundMatches:ee,route:le,error:L}}function nt(M){let L=[];return Ue.forEach((q,ee)=>{(!M||M(ee))&&(q.cancel(),L.push(ee),Ue.delete(ee))}),L}function zt(M,L,q){if(D=M,R=L,S=q||null,!E&&T.navigation===Jd){E=!0;let ee=St(T.location,T.matches);ee!=null&&ke({restoreScrollPosition:ee})}return()=>{D=null,R=null,S=null}}function jt(M,L){return S&&S(M,L.map(ee=>zx(ee,T.loaderData)))||M.key}function dn(M,L){if(D&&R){let q=jt(M,L);D[q]=R()}}function St(M,L){if(D){let q=jt(M,L),ee=D[q];if(typeof ee=="number")return ee}return null}function dt(M,L,q){if(v)if(M){if(Object.keys(M[0].params).length>0)return{active:!0,matches:mc(L,q,m,!0)}}else return{active:!0,matches:mc(L,q,m,!0)||[]};return{active:!1,matches:null}}async function Rt(M,L,q,ee){if(!v)return{type:"success",matches:M};let le=M;for(;;){let fe=p==null,be=p||f,oe=d;try{await v({signal:q,path:L,matches:le,fetcherKey:ee,patch:(me,Ce)=>{q.aborted||Y0(me,Ce,be,oe,c)}})}catch(me){return{type:"error",error:me,partialMatches:le}}finally{fe&&!q.aborted&&(f=[...f])}if(q.aborted)return{type:"aborted"};let he=Pi(be,L,m);if(he)return{type:"success",matches:he};let ue=mc(be,L,m,!0);if(!ue||le.length===ue.length&&le.every((me,Ce)=>me.route.id===ue[Ce].route.id))return{type:"success",matches:null};le=ue}}function aa(M){d={},p=vc(M,c,void 0,d)}function Ze(M,L){let q=p==null;Y0(M,L,p||f,d,c),q&&(f=[...f],ke({}))}return K={get basename(){return m},get future(){return b},get state(){return T},get routes(){return f},get window(){return n},initialize:Tt,subscribe:En,enableScrollRestoration:zt,navigate:It,fetch:Hn,revalidate:ea,createHref:M=>a.history.createHref(M),encodeLocation:M=>a.history.encodeLocation(M),getFetcher:xi,deleteFetcher:Wi,dispose:Be,getBlocker:ya,deleteBlocker:ji,patchRoutes:Ze,_internalFetchControllers:Y,_internalActiveDeferreds:Ue,_internalSetRoutes:aa},K}function F4(a){return a!=null&&("formData"in a&&a.formData!=null||"body"in a&&a.body!==void 0)}function rm(a,n,l,o,c,d,f,p){let m,g;if(f){m=[];for(let b of n)if(m.push(b),b.route.id===f){g=b;break}}else m=n,g=n[n.length-1];let v=$c(c||".",Ac(m,d),Xn(a.pathname,l)||a.pathname,p==="path");if(c==null&&(v.search=a.search,v.hash=a.hash),(c==null||c===""||c===".")&&g){let b=Mm(v.search);if(g.route.index&&!b)v.search=v.search?v.search.replace(/^\?/,"?index&"):"?index";else if(!g.route.index&&b){let x=new URLSearchParams(v.search),j=x.getAll("index");x.delete("index"),j.filter(S=>S).forEach(S=>x.append("index",S));let D=x.toString();v.search=D?"?"+D:""}}return o&&l!=="/"&&(v.pathname=v.pathname==="/"?l:Fa([l,v.pathname])),Vi(v)}function k0(a,n,l,o){if(!o||!F4(o))return{path:l};if(o.formMethod&&!Z4(o.formMethod))return{path:l,error:sn(405,{method:o.formMethod})};let c=()=>({path:l,error:sn(400,{type:"invalid-body"})}),d=o.formMethod||"get",f=a?d.toUpperCase():d.toLowerCase(),p=Vx(l);if(o.body!==void 0){if(o.formEncType==="text/plain"){if(!Vn(f))return c();let x=typeof o.body=="string"?o.body:o.body instanceof FormData||o.body instanceof URLSearchParams?Array.from(o.body.entries()).reduce((j,D)=>{let[S,R]=D;return""+j+S+"="+R+`
|
|
35
|
+
`},""):String(o.body);return{path:l,submission:{formMethod:f,formAction:p,formEncType:o.formEncType,formData:void 0,json:void 0,text:x}}}else if(o.formEncType==="application/json"){if(!Vn(f))return c();try{let x=typeof o.body=="string"?JSON.parse(o.body):o.body;return{path:l,submission:{formMethod:f,formAction:p,formEncType:o.formEncType,formData:void 0,json:x,text:void 0}}}catch{return c()}}}De(typeof FormData=="function","FormData is not available in this environment");let m,g;if(o.formData)m=om(o.formData),g=o.formData;else if(o.body instanceof FormData)m=om(o.body),g=o.body;else if(o.body instanceof URLSearchParams)m=o.body,g=Q0(m);else if(o.body==null)m=new URLSearchParams,g=new FormData;else try{m=new URLSearchParams(o.body),g=Q0(m)}catch{return c()}let v={formMethod:f,formAction:p,formEncType:o&&o.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(Vn(v.formMethod))return{path:l,submission:v};let b=qa(l);return n&&b.search&&Mm(b.search)&&m.append("index",""),b.search="?"+m,{path:Vi(b),submission:v}}function I0(a,n,l){l===void 0&&(l=!1);let o=a.findIndex(c=>c.route.id===n);return o>=0?a.slice(0,l?o+1:o):a}function V0(a,n,l,o,c,d,f,p,m,g,v,b,x,j,D,S){let R=S?jn(S[1])?S[1].error:S[1].data:void 0,E=a.createURL(n.location),A=a.createURL(c),B=l;d&&n.errors?B=I0(l,Object.keys(n.errors)[0],!0):S&&jn(S[1])&&(B=I0(l,S[0]));let H=S?S[1].statusCode:void 0,V=f&&H&&H>=400,K=B.filter((O,Q)=>{let{route:te}=O;if(te.lazy)return!0;if(te.loader==null)return!1;if(d)return sm(te,n.loaderData,n.errors);if(q4(n.loaderData,n.matches[Q],O)||m.some(Ee=>Ee===O.route.id))return!0;let ae=n.matches[Q],se=O;return G0(O,ct({currentUrl:E,currentParams:ae.params,nextUrl:A,nextParams:se.params},o,{actionResult:R,actionStatus:H,defaultShouldRevalidate:V?!1:p||E.pathname+E.search===A.pathname+A.search||E.search!==A.search||kx(ae,se)}))}),T=[];return b.forEach((O,Q)=>{if(d||!l.some(G=>G.route.id===O.routeId)||v.has(Q))return;let te=Pi(j,O.path,D);if(!te){T.push({key:Q,routeId:O.routeId,path:O.path,matches:null,match:null,controller:null});return}let ae=n.fetchers.get(Q),se=ts(te,O.path),Ee=!1;x.has(Q)?Ee=!1:g.has(Q)?(g.delete(Q),Ee=!0):ae&&ae.state!=="idle"&&ae.data===void 0?Ee=p:Ee=G0(se,ct({currentUrl:E,currentParams:n.matches[n.matches.length-1].params,nextUrl:A,nextParams:l[l.length-1].params},o,{actionResult:R,actionStatus:H,defaultShouldRevalidate:V?!1:p})),Ee&&T.push({key:Q,routeId:O.routeId,path:O.path,matches:te,match:se,controller:new AbortController})}),[K,T]}function sm(a,n,l){if(a.lazy)return!0;if(!a.loader)return!1;let o=n!=null&&n[a.id]!==void 0,c=l!=null&&l[a.id]!==void 0;return!o&&c?!1:typeof a.loader=="function"&&a.loader.hydrate===!0?!0:!o&&!c}function q4(a,n,l){let o=!n||l.route.id!==n.route.id,c=a[l.route.id]===void 0;return o||c}function kx(a,n){let l=a.route.path;return a.pathname!==n.pathname||l!=null&&l.endsWith("*")&&a.params["*"]!==n.params["*"]}function G0(a,n){if(a.route.shouldRevalidate){let l=a.route.shouldRevalidate(n);if(typeof l=="boolean")return l}return n.defaultShouldRevalidate}function Y0(a,n,l,o,c){var d;let f;if(a){let g=o[a];De(g,"No route found to patch children into: routeId = "+a),g.children||(g.children=[]),f=g.children}else f=l;let p=n.filter(g=>!f.some(v=>Ix(g,v))),m=vc(p,c,[a||"_","patch",String(((d=f)==null?void 0:d.length)||"0")],o);f.push(...m)}function Ix(a,n){return"id"in a&&"id"in n&&a.id===n.id?!0:a.index===n.index&&a.path===n.path&&a.caseSensitive===n.caseSensitive?(!a.children||a.children.length===0)&&(!n.children||n.children.length===0)?!0:a.children.every((l,o)=>{var c;return(c=n.children)==null?void 0:c.some(d=>Ix(l,d))}):!1}async function H4(a,n,l){if(!a.lazy)return;let o=await a.lazy();if(!a.lazy)return;let c=l[a.id];De(c,"No route found in manifest");let d={};for(let f in o){let m=c[f]!==void 0&&f!=="hasErrorBoundary";Pl(!m,'Route "'+c.id+'" has a static property "'+f+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+f+'" will be ignored.')),!m&&!f4.has(f)&&(d[f]=o[f])}Object.assign(c,d),Object.assign(c,ct({},n(c),{lazy:void 0}))}async function P4(a){let{matches:n}=a,l=n.filter(c=>c.shouldLoad);return(await Promise.all(l.map(c=>c.resolve()))).reduce((c,d,f)=>Object.assign(c,{[l[f].route.id]:d}),{})}async function k4(a,n,l,o,c,d,f,p,m,g){let v=d.map(j=>j.route.lazy?H4(j.route,m,p):void 0),b=d.map((j,D)=>{let S=v[D],R=c.some(A=>A.route.id===j.route.id);return ct({},j,{shouldLoad:R,resolve:async A=>(A&&o.method==="GET"&&(j.route.lazy||j.route.loader)&&(R=!0),R?I4(n,o,j,S,A,g):Promise.resolve({type:Ke.data,result:void 0}))})}),x=await a({matches:b,request:o,params:d[0].params,fetcherKey:f,context:g});try{await Promise.all(v)}catch{}return x}async function I4(a,n,l,o,c,d){let f,p,m=g=>{let v,b=new Promise((D,S)=>v=S);p=()=>v(),n.signal.addEventListener("abort",p);let x=D=>typeof g!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+a+'" [routeId: '+l.route.id+"]"))):g({request:n,params:l.params,context:d},...D!==void 0?[D]:[]),j=(async()=>{try{return{type:"data",result:await(c?c(S=>x(S)):x())}}catch(D){return{type:"error",result:D}}})();return Promise.race([j,b])};try{let g=l.route[a];if(o)if(g){let v,[b]=await Promise.all([m(g).catch(x=>{v=x}),o]);if(v!==void 0)throw v;f=b}else if(await o,g=l.route[a],g)f=await m(g);else if(a==="action"){let v=new URL(n.url),b=v.pathname+v.search;throw sn(405,{method:n.method,pathname:b,routeId:l.route.id})}else return{type:Ke.data,result:void 0};else if(g)f=await m(g);else{let v=new URL(n.url),b=v.pathname+v.search;throw sn(404,{pathname:b})}De(f.result!==void 0,"You defined "+(a==="action"?"an action":"a loader")+" for route "+('"'+l.route.id+"\" but didn't return anything from your `"+a+"` ")+"function. Please return a value or `null`.")}catch(g){return{type:Ke.error,result:g}}finally{p&&n.signal.removeEventListener("abort",p)}return f}async function V4(a){let{result:n,type:l}=a;if(Gx(n)){let b;try{let x=n.headers.get("Content-Type");x&&/\bapplication\/json\b/.test(x)?n.body==null?b=null:b=await n.json():b=await n.text()}catch(x){return{type:Ke.error,error:x}}return l===Ke.error?{type:Ke.error,error:new bc(n.status,n.statusText,b),statusCode:n.status,headers:n.headers}:{type:Ke.data,data:b,statusCode:n.status,headers:n.headers}}if(l===Ke.error){if(eb(n)){var o,c;if(n.data instanceof Error){var d,f;return{type:Ke.error,error:n.data,statusCode:(d=n.init)==null?void 0:d.status,headers:(f=n.init)!=null&&f.headers?new Headers(n.init.headers):void 0}}return{type:Ke.error,error:new bc(((o=n.init)==null?void 0:o.status)||500,void 0,n.data),statusCode:us(n)?n.status:void 0,headers:(c=n.init)!=null&&c.headers?new Headers(n.init.headers):void 0}}return{type:Ke.error,error:n,statusCode:us(n)?n.status:void 0}}if(K4(n)){var p,m;return{type:Ke.deferred,deferredData:n,statusCode:(p=n.init)==null?void 0:p.status,headers:((m=n.init)==null?void 0:m.headers)&&new Headers(n.init.headers)}}if(eb(n)){var g,v;return{type:Ke.data,data:n.data,statusCode:(g=n.init)==null?void 0:g.status,headers:(v=n.init)!=null&&v.headers?new Headers(n.init.headers):void 0}}return{type:Ke.data,data:n}}function G4(a,n,l,o,c,d){let f=a.headers.get("Location");if(De(f,"Redirects returned/thrown from loaders/actions must have a Location header"),!Rm.test(f)){let p=o.slice(0,o.findIndex(m=>m.route.id===l)+1);f=rm(new URL(n.url),p,c,!0,f,d),a.headers.set("Location",f)}return a}function X0(a,n,l){if(Rm.test(a)){let o=a,c=o.startsWith("//")?new URL(n.protocol+o):new URL(o),d=Xn(c.pathname,l)!=null;if(c.origin===n.origin&&d)return c.pathname+c.search+c.hash}return a}function $l(a,n,l,o){let c=a.createURL(Vx(n)).toString(),d={signal:l};if(o&&Vn(o.formMethod)){let{formMethod:f,formEncType:p}=o;d.method=f.toUpperCase(),p==="application/json"?(d.headers=new Headers({"Content-Type":p}),d.body=JSON.stringify(o.json)):p==="text/plain"?d.body=o.text:p==="application/x-www-form-urlencoded"&&o.formData?d.body=om(o.formData):d.body=o.formData}return new Request(c,d)}function om(a){let n=new URLSearchParams;for(let[l,o]of a.entries())n.append(l,typeof o=="string"?o:o.name);return n}function Q0(a){let n=new FormData;for(let[l,o]of a.entries())n.append(l,o);return n}function Y4(a,n,l,o,c){let d={},f=null,p,m=!1,g={},v=l&&jn(l[1])?l[1].error:void 0;return a.forEach(b=>{if(!(b.route.id in n))return;let x=b.route.id,j=n[x];if(De(!Ii(j),"Cannot handle redirect results in processLoaderData"),jn(j)){let D=j.error;v!==void 0&&(D=v,v=void 0),f=f||{};{let S=ki(a,x);f[S.route.id]==null&&(f[S.route.id]=D)}d[x]=void 0,m||(m=!0,p=us(j.error)?j.error.status:500),j.headers&&(g[x]=j.headers)}else pi(j)?(o.set(x,j.deferredData),d[x]=j.deferredData.data,j.statusCode!=null&&j.statusCode!==200&&!m&&(p=j.statusCode),j.headers&&(g[x]=j.headers)):(d[x]=j.data,j.statusCode&&j.statusCode!==200&&!m&&(p=j.statusCode),j.headers&&(g[x]=j.headers))}),v!==void 0&&l&&(f={[l[0]]:v},d[l[0]]=void 0),{loaderData:d,errors:f,statusCode:p||200,loaderHeaders:g}}function K0(a,n,l,o,c,d,f){let{loaderData:p,errors:m}=Y4(n,l,o,f);return c.forEach(g=>{let{key:v,match:b,controller:x}=g,j=d[v];if(De(j,"Did not find corresponding fetcher result"),!(x&&x.signal.aborted))if(jn(j)){let D=ki(a.matches,b?.route.id);m&&m[D.route.id]||(m=ct({},m,{[D.route.id]:j.error})),a.fetchers.delete(v)}else if(Ii(j))De(!1,"Unhandled fetcher revalidation redirect");else if(pi(j))De(!1,"Unhandled fetcher deferred data");else{let D=fi(j.data);a.fetchers.set(v,D)}}),{loaderData:p,errors:m}}function Z0(a,n,l,o){let c=ct({},n);for(let d of l){let f=d.route.id;if(n.hasOwnProperty(f)?n[f]!==void 0&&(c[f]=n[f]):a[f]!==void 0&&d.route.loader&&(c[f]=a[f]),o&&o.hasOwnProperty(f))break}return c}function W0(a){return a?jn(a[1])?{actionData:{}}:{actionData:{[a[0]]:a[1].data}}:{}}function ki(a,n){return(n?a.slice(0,a.findIndex(o=>o.route.id===n)+1):[...a]).reverse().find(o=>o.route.hasErrorBoundary===!0)||a[0]}function J0(a){let n=a.length===1?a[0]:a.find(l=>l.index||!l.path||l.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function sn(a,n){let{pathname:l,routeId:o,method:c,type:d,message:f}=n===void 0?{}:n,p="Unknown Server Error",m="Unknown @remix-run/router error";return a===400?(p="Bad Request",c&&l&&o?m="You made a "+c+' request to "'+l+'" but '+('did not provide a `loader` for route "'+o+'", ')+"so there is no way to handle the request.":d==="defer-action"?m="defer() is not supported in actions":d==="invalid-body"&&(m="Unable to encode submission body")):a===403?(p="Forbidden",m='Route "'+o+'" does not match URL "'+l+'"'):a===404?(p="Not Found",m='No route matches URL "'+l+'"'):a===405&&(p="Method Not Allowed",c&&l&&o?m="You made a "+c.toUpperCase()+' request to "'+l+'" but '+('did not provide an `action` for route "'+o+'", ')+"so there is no way to handle the request.":c&&(m='Invalid request method "'+c.toUpperCase()+'"')),new bc(a||500,p,new Error(m),!0)}function qo(a){let n=Object.entries(a);for(let l=n.length-1;l>=0;l--){let[o,c]=n[l];if(Ii(c))return{key:o,result:c}}}function Vx(a){let n=typeof a=="string"?qa(a):a;return Vi(ct({},n,{hash:""}))}function X4(a,n){return a.pathname!==n.pathname||a.search!==n.search?!1:a.hash===""?n.hash!=="":a.hash===n.hash?!0:n.hash!==""}function Q4(a){return Gx(a.result)&&O4.has(a.result.status)}function pi(a){return a.type===Ke.deferred}function jn(a){return a.type===Ke.error}function Ii(a){return(a&&a.type)===Ke.redirect}function eb(a){return typeof a=="object"&&a!=null&&"type"in a&&"data"in a&&"init"in a&&a.type==="DataWithResponseInit"}function K4(a){let n=a;return n&&typeof n=="object"&&typeof n.data=="object"&&typeof n.subscribe=="function"&&typeof n.cancel=="function"&&typeof n.resolveData=="function"}function Gx(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.headers=="object"&&typeof a.body<"u"}function Z4(a){return L4.has(a.toLowerCase())}function Vn(a){return A4.has(a.toLowerCase())}async function W4(a,n,l,o,c){let d=Object.entries(n);for(let f=0;f<d.length;f++){let[p,m]=d[f],g=a.find(x=>x?.route.id===p);if(!g)continue;let v=o.find(x=>x.route.id===g.route.id),b=v!=null&&!kx(v,g)&&(c&&c[g.route.id])!==void 0;pi(m)&&b&&await Nm(m,l,!1).then(x=>{x&&(n[p]=x)})}}async function J4(a,n,l){for(let o=0;o<l.length;o++){let{key:c,routeId:d,controller:f}=l[o],p=n[c];a.find(g=>g?.route.id===d)&&pi(p)&&(De(f,"Expected an AbortController for revalidating fetcher deferred result"),await Nm(p,f.signal,!0).then(g=>{g&&(n[c]=g)}))}}async function Nm(a,n,l){if(l===void 0&&(l=!1),!await a.deferredData.resolveData(n)){if(l)try{return{type:Ke.data,data:a.deferredData.unwrappedData}}catch(c){return{type:Ke.error,error:c}}return{type:Ke.data,data:a.deferredData.data}}}function Mm(a){return new URLSearchParams(a).getAll("index").some(n=>n==="")}function ts(a,n){let l=typeof n=="string"?qa(n).search:n.search;if(a[a.length-1].route.index&&Mm(l||""))return a[a.length-1];let o=qx(a);return o[o.length-1]}function tb(a){let{formMethod:n,formAction:l,formEncType:o,text:c,formData:d,json:f}=a;if(!(!n||!l||!o)){if(c!=null)return{formMethod:n,formAction:l,formEncType:o,formData:void 0,json:void 0,text:c};if(d!=null)return{formMethod:n,formAction:l,formEncType:o,formData:d,json:void 0,text:void 0};if(f!==void 0)return{formMethod:n,formAction:l,formEncType:o,formData:void 0,json:f,text:void 0}}}function ef(a,n){return n?{state:"loading",location:a,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:a,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function eC(a,n){return{state:"submitting",location:a,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}function Xr(a,n){return a?{state:"loading",formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function tC(a,n){return{state:"submitting",formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text,data:n?n.data:void 0}}function fi(a){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:a}}function nC(a,n){try{let l=a.sessionStorage.getItem(Px);if(l){let o=JSON.parse(l);for(let[c,d]of Object.entries(o||{}))d&&Array.isArray(d)&&n.set(c,new Set(d||[]))}}catch{}}function aC(a,n){if(n.size>0){let l={};for(let[o,c]of n)l[o]=[...c];try{a.sessionStorage.setItem(Px,JSON.stringify(l))}catch(o){Pl(!1,"Failed to save applied view transitions in sessionStorage ("+o+").")}}}/**
|
|
36
|
+
* React Router v6.30.0
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Remix Software Inc.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
42
|
+
*
|
|
43
|
+
* @license MIT
|
|
44
|
+
*/const de=await C("react");function Gi(){return Gi=Object.assign?Object.assign.bind():function(a){for(var n=1;n<arguments.length;n++){var l=arguments[n];for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(a[o]=l[o])}return a},Gi.apply(this,arguments)}const xs=de.createContext(null),Am=de.createContext(null),nb=de.createContext(null),Ha=de.createContext(null),Lc=de.createContext(null),ma=de.createContext({outlet:null,matches:[],isDataRoute:!1}),Yx=de.createContext(null);function iC(a,n){let{relative:l}=n===void 0?{}:n;Xi()||De(!1);let{basename:o,navigator:c}=de.useContext(Ha),{hash:d,pathname:f,search:p}=Oc(a,{relative:l}),m=f;return o!=="/"&&(m=f==="/"?o:Fa([o,f])),c.createHref({pathname:m,search:p,hash:d})}function Xi(){return de.useContext(Lc)!=null}function Qi(){return Xi()||De(!1),de.useContext(Lc).location}function ab(a){Xi()||De(!1);let{pathname:n}=Qi();return de.useMemo(()=>cs(a,Fx(n)),[n,a])}function Xx(a){de.useContext(Ha).static||de.useLayoutEffect(a)}function on(){let{isDataRoute:a}=de.useContext(ma);return a?yC():lC()}function lC(){Xi()||De(!1);let a=de.useContext(xs),{basename:n,future:l,navigator:o}=de.useContext(Ha),{matches:c}=de.useContext(ma),{pathname:d}=Qi(),f=JSON.stringify(Ac(c,l.v7_relativeSplatPath)),p=de.useRef(!1);return Xx(()=>{p.current=!0}),de.useCallback(function(g,v){if(v===void 0&&(v={}),!p.current)return;if(typeof g=="number"){o.go(g);return}let b=$c(g,JSON.parse(f),d,v.relative==="path");a==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:Fa([n,b.pathname])),(v.replace?o.replace:o.push)(b,v.state,v)},[n,o,f,d,a])}const rC=de.createContext(null);function sC(a){let n=de.useContext(ma).outlet;return n&&de.createElement(rC.Provider,{value:a},n)}function Ki(){let{matches:a}=de.useContext(ma),n=a[a.length-1];return n?n.params:{}}function Oc(a,n){let{relative:l}=n===void 0?{}:n,{future:o}=de.useContext(Ha),{matches:c}=de.useContext(ma),{pathname:d}=Qi(),f=JSON.stringify(Ac(c,o.v7_relativeSplatPath));return de.useMemo(()=>$c(a,JSON.parse(f),d,l==="path"),[a,f,d,l])}function oC(a,n){return Qx(a,n)}function Qx(a,n,l,o){Xi()||De(!1);let{navigator:c,static:d}=de.useContext(Ha),{matches:f}=de.useContext(ma),p=f[f.length-1],m=p?p.params:{};p&&p.pathname;let g=p?p.pathnameBase:"/";p&&p.route;let v=Qi(),b;if(n){var x;let E=typeof n=="string"?qa(n):n;g==="/"||(x=E.pathname)!=null&&x.startsWith(g)||De(!1),b=E}else b=v;let j=b.pathname||"/",D=j;if(g!=="/"){let E=g.replace(/^\//,"").split("/");D="/"+j.replace(/^\//,"").split("/").slice(E.length).join("/")}let S=!d&&l&&l.matches&&l.matches.length>0?l.matches:Pi(a,{pathname:D}),R=hC(S&&S.map(E=>Object.assign({},E,{params:Object.assign({},m,E.params),pathname:Fa([g,c.encodeLocation?c.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?g:Fa([g,c.encodeLocation?c.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),f,l,o);return n&&R?de.createElement(Lc.Provider,{value:{location:Gi({pathname:"/",search:"",hash:"",state:null,key:"default"},b),navigationType:vt.Pop}},R):R}function cC(){let a=gC(),n=us(a)?a.status+" "+a.statusText:a instanceof Error?a.message:JSON.stringify(a),l=a instanceof Error?a.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return de.createElement(de.Fragment,null,de.createElement("h2",null,"Unexpected Application Error!"),de.createElement("h3",{style:{fontStyle:"italic"}},n),l?de.createElement("pre",{style:c},l):null,null)}const uC=de.createElement(cC,null);class dC extends de.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,l){return l.location!==n.location||l.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:l.error,location:l.location,revalidation:n.revalidation||l.revalidation}}componentDidCatch(n,l){console.error("React Router caught the following error during render",n,l)}render(){return this.state.error!==void 0?de.createElement(ma.Provider,{value:this.props.routeContext},de.createElement(Yx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function fC(a){let{routeContext:n,match:l,children:o}=a,c=de.useContext(xs);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),de.createElement(ma.Provider,{value:n},o)}function hC(a,n,l,o){var c;if(n===void 0&&(n=[]),l===void 0&&(l=null),o===void 0&&(o=null),a==null){var d;if(!l)return null;if(l.errors)a=l.matches;else if((d=o)!=null&&d.v7_partialHydration&&n.length===0&&!l.initialized&&l.matches.length>0)a=l.matches;else return null}let f=a,p=(c=l)==null?void 0:c.errors;if(p!=null){let v=f.findIndex(b=>b.route.id&&p?.[b.route.id]!==void 0);v>=0||De(!1),f=f.slice(0,Math.min(f.length,v+1))}let m=!1,g=-1;if(l&&o&&o.v7_partialHydration)for(let v=0;v<f.length;v++){let b=f[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(g=v),b.route.id){let{loaderData:x,errors:j}=l,D=b.route.loader&&x[b.route.id]===void 0&&(!j||j[b.route.id]===void 0);if(b.route.lazy||D){m=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}return f.reduceRight((v,b,x)=>{let j,D=!1,S=null,R=null;l&&(j=p&&b.route.id?p[b.route.id]:void 0,S=b.route.errorElement||uC,m&&(g<0&&x===0?(xC("route-fallback"),D=!0,R=null):g===x&&(D=!0,R=b.route.hydrateFallbackElement||null)));let E=n.concat(f.slice(0,x+1)),A=()=>{let B;return j?B=S:D?B=R:b.route.Component?B=de.createElement(b.route.Component,null):b.route.element?B=b.route.element:B=v,de.createElement(fC,{match:b,routeContext:{outlet:v,matches:E,isDataRoute:l!=null},children:B})};return l&&(b.route.ErrorBoundary||b.route.errorElement||x===0)?de.createElement(dC,{location:l.location,revalidation:l.revalidation,component:S,error:j,children:A(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):A()},null)}var $m=function(a){return a.UseBlocker="useBlocker",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a}($m||{}),Kx=function(a){return a.UseBlocker="useBlocker",a.UseLoaderData="useLoaderData",a.UseActionData="useActionData",a.UseRouteError="useRouteError",a.UseNavigation="useNavigation",a.UseRouteLoaderData="useRouteLoaderData",a.UseMatches="useMatches",a.UseRevalidator="useRevalidator",a.UseNavigateStable="useNavigate",a.UseRouteId="useRouteId",a}(Kx||{});function Zx(a){let n=de.useContext(xs);return n||De(!1),n}function Lm(a){let n=de.useContext(Am);return n||De(!1),n}function mC(a){let n=de.useContext(ma);return n||De(!1),n}function Wx(a){let n=mC(),l=n.matches[n.matches.length-1];return l.route.id||De(!1),l.route.id}function pC(){let{matches:a,loaderData:n}=Lm();return de.useMemo(()=>a.map(l=>zx(l,n)),[a,n])}function gC(){var a;let n=de.useContext(Yx),l=Lm(Kx.UseRouteError),o=Wx();return n!==void 0?n:(a=l.errors)==null?void 0:a[o]}let vC=0;function bC(a){let{router:n,basename:l}=Zx($m.UseBlocker),o=Lm(),[c,d]=de.useState(""),f=de.useCallback(p=>{if(typeof a!="function")return!!a;if(l==="/")return a(p);let{currentLocation:m,nextLocation:g,historyAction:v}=p;return a({currentLocation:Gi({},m,{pathname:Xn(m.pathname,l)||m.pathname}),nextLocation:Gi({},g,{pathname:Xn(g.pathname,l)||g.pathname}),historyAction:v})},[l,a]);return de.useEffect(()=>{let p=String(++vC);return d(p),()=>n.deleteBlocker(p)},[n]),de.useEffect(()=>{c!==""&&n.getBlocker(c,f)},[n,c,f]),c&&o.blockers.has(c)?o.blockers.get(c):Bl}function yC(){let{router:a}=Zx($m.UseNavigateStable),n=Wx(),l=de.useRef(!1);return Xx(()=>{l.current=!0}),de.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?a.navigate(c):a.navigate(c,Gi({fromRouteId:n},d)))},[a,n])}const ib={};function xC(a,n,l){ib[a]||(ib[a]=!0)}function jC(a,n){a?.v7_startTransition,a?.v7_relativeSplatPath===void 0&&(!n||n.v7_relativeSplatPath),n&&(n.v7_fetcherPersist,n.v7_normalizeFormMethod,n.v7_partialHydration,n.v7_skipActionErrorRevalidation)}const SC="startTransition";de[SC];function Om(a){let{to:n,replace:l,state:o,relative:c}=a;Xi()||De(!1);let{future:d,static:f}=de.useContext(Ha),{matches:p}=de.useContext(ma),{pathname:m}=Qi(),g=on(),v=$c(n,Ac(p,d.v7_relativeSplatPath),m,c==="path"),b=JSON.stringify(v);return de.useEffect(()=>g(JSON.parse(b),{replace:l,state:o,relative:c}),[g,b,c,l,o]),null}function bi(a){return sC(a.context)}function ds(a){De(!1)}function wC(a){let{basename:n="/",children:l=null,location:o,navigationType:c=vt.Pop,navigator:d,static:f=!1,future:p}=a;Xi()&&De(!1);let m=n.replace(/^\/*/,"/"),g=de.useMemo(()=>({basename:m,navigator:d,static:f,future:Gi({v7_relativeSplatPath:!1},p)}),[m,p,d,f]);typeof o=="string"&&(o=qa(o));let{pathname:v="/",search:b="",hash:x="",state:j=null,key:D="default"}=o,S=de.useMemo(()=>{let R=Xn(v,m);return R==null?null:{location:{pathname:R,search:b,hash:x,state:j,key:D},navigationType:c}},[m,v,b,x,j,D,c]);return S==null?null:de.createElement(Ha.Provider,{value:g},de.createElement(Lc.Provider,{children:l,value:S}))}function Jx(a){let{children:n,location:l}=a;return oC(cm(n),l)}var Bn=function(a){return a[a.pending=0]="pending",a[a.success=1]="success",a[a.error=2]="error",a}(Bn||{});const CC=new Promise(()=>{});class YB extends de.Component{constructor(n){super(n),this.state={error:null}}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,l){console.error("<Await> caught the following error during render",n,l)}render(){let{children:n,errorElement:l,resolve:o}=this.props,c=null,d=Bn.pending;if(!(o instanceof Promise))d=Bn.success,c=Promise.resolve(),Object.defineProperty(c,"_tracked",{get:()=>!0}),Object.defineProperty(c,"_data",{get:()=>o});else if(this.state.error){d=Bn.error;let f=this.state.error;c=Promise.reject().catch(()=>{}),Object.defineProperty(c,"_tracked",{get:()=>!0}),Object.defineProperty(c,"_error",{get:()=>f})}else o._tracked?(c=o,d="_error"in c?Bn.error:"_data"in c?Bn.success:Bn.pending):(d=Bn.pending,Object.defineProperty(o,"_tracked",{get:()=>!0}),c=o.then(f=>Object.defineProperty(o,"_data",{get:()=>f}),f=>Object.defineProperty(o,"_error",{get:()=>f})));if(d===Bn.error&&c._error instanceof M4)throw CC;if(d===Bn.error&&!l)throw c._error;if(d===Bn.error)return de.createElement(nb.Provider,{value:c,children:l});if(d===Bn.success)return de.createElement(nb.Provider,{value:c,children:n});throw c}}function cm(a,n){n===void 0&&(n=[]);let l=[];return de.Children.forEach(a,(o,c)=>{if(!de.isValidElement(o))return;let d=[...n,c];if(o.type===de.Fragment){l.push.apply(l,cm(o.props.children,d));return}o.type!==ds&&De(!1),!o.props.index||!o.props.children||De(!1);let f={id:o.props.id||d.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(f.children=cm(o.props.children,d)),l.push(f)}),l}function EC(a){let n={hasErrorBoundary:a.ErrorBoundary!=null||a.errorElement!=null};return a.Component&&Object.assign(n,{element:de.createElement(a.Component),Component:void 0}),a.HydrateFallback&&Object.assign(n,{hydrateFallbackElement:de.createElement(a.HydrateFallback),HydrateFallback:void 0}),a.ErrorBoundary&&Object.assign(n,{errorElement:de.createElement(a.ErrorBoundary),ErrorBoundary:void 0}),n}/**
|
|
45
|
+
* React Router DOM v6.30.0
|
|
46
|
+
*
|
|
47
|
+
* Copyright (c) Remix Software Inc.
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the MIT license found in the
|
|
50
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
51
|
+
*
|
|
52
|
+
* @license MIT
|
|
53
|
+
*/const Re=await C("react"),DC=await C("react-dom");function kl(){return kl=Object.assign?Object.assign.bind():function(a){for(var n=1;n<arguments.length;n++){var l=arguments[n];for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(a[o]=l[o])}return a},kl.apply(this,arguments)}function ej(a,n){if(a==null)return{};var l={},o=Object.keys(a),c,d;for(d=0;d<o.length;d++)c=o[d],!(n.indexOf(c)>=0)&&(l[c]=a[c]);return l}function TC(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function RC(a,n){return a.button===0&&(!n||n==="_self")&&!TC(a)}const NC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],MC=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],AC="6";try{window.__reactRouterVersion=AC}catch{}function $C(a,n){return _4({basename:void 0,future:kl({},void 0,{v7_prependBasename:!0}),history:c4({window:void 0}),hydrationData:LC(),routes:a,mapRouteProperties:EC,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function LC(){var a;let n=(a=window)==null?void 0:a.__staticRouterHydrationData;return n&&n.errors&&(n=kl({},n,{errors:OC(n.errors)})),n}function OC(a){if(!a)return null;let n=Object.entries(a),l={};for(let[o,c]of n)if(c&&c.__type==="RouteErrorResponse")l[o]=new bc(c.status,c.statusText,c.data,c.internal===!0);else if(c&&c.__type==="Error"){if(c.__subType){let d=window[c.__subType];if(typeof d=="function")try{let f=new d(c.message);f.stack="",l[o]=f}catch{}}if(l[o]==null){let d=new Error(c.message);d.stack="",l[o]=d}}else l[o]=c;return l}const tj=Re.createContext({isTransitioning:!1}),UC=Re.createContext(new Map),zC="startTransition",lb=Re[zC],BC="flushSync",rb=DC[BC],_C="useId";Re[_C];function FC(a){lb?lb(a):a()}function Qr(a){rb?rb(a):a()}class qC{constructor(){this.status="pending",this.promise=new Promise((n,l)=>{this.resolve=o=>{this.status==="pending"&&(this.status="resolved",n(o))},this.reject=o=>{this.status==="pending"&&(this.status="rejected",l(o))}})}}function HC(a){let{fallbackElement:n,router:l,future:o}=a,[c,d]=Re.useState(l.state),[f,p]=Re.useState(),[m,g]=Re.useState({isTransitioning:!1}),[v,b]=Re.useState(),[x,j]=Re.useState(),[D,S]=Re.useState(),R=Re.useRef(new Map),{v7_startTransition:E}=o||{},A=Re.useCallback(O=>{E?FC(O):O()},[E]),B=Re.useCallback((O,Q)=>{let{deletedFetchers:te,flushSync:ae,viewTransitionOpts:se}=Q;O.fetchers.forEach((G,W)=>{G.data!==void 0&&R.current.set(W,G.data)}),te.forEach(G=>R.current.delete(G));let Ee=l.window==null||l.window.document==null||typeof l.window.document.startViewTransition!="function";if(!se||Ee){ae?Qr(()=>d(O)):A(()=>d(O));return}if(ae){Qr(()=>{x&&(v&&v.resolve(),x.skipTransition()),g({isTransitioning:!0,flushSync:!0,currentLocation:se.currentLocation,nextLocation:se.nextLocation})});let G=l.window.document.startViewTransition(()=>{Qr(()=>d(O))});G.finished.finally(()=>{Qr(()=>{b(void 0),j(void 0),p(void 0),g({isTransitioning:!1})})}),Qr(()=>j(G));return}x?(v&&v.resolve(),x.skipTransition(),S({state:O,currentLocation:se.currentLocation,nextLocation:se.nextLocation})):(p(O),g({isTransitioning:!0,flushSync:!1,currentLocation:se.currentLocation,nextLocation:se.nextLocation}))},[l.window,x,v,R,A]);Re.useLayoutEffect(()=>l.subscribe(B),[l,B]),Re.useEffect(()=>{m.isTransitioning&&!m.flushSync&&b(new qC)},[m]),Re.useEffect(()=>{if(v&&f&&l.window){let O=f,Q=v.promise,te=l.window.document.startViewTransition(async()=>{A(()=>d(O)),await Q});te.finished.finally(()=>{b(void 0),j(void 0),p(void 0),g({isTransitioning:!1})}),j(te)}},[A,f,v,l.window]),Re.useEffect(()=>{v&&f&&c.location.key===f.location.key&&v.resolve()},[v,x,c.location,f]),Re.useEffect(()=>{!m.isTransitioning&&D&&(p(D.state),g({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}),S(void 0))},[m.isTransitioning,D]),Re.useEffect(()=>{},[]);let H=Re.useMemo(()=>({createHref:l.createHref,encodeLocation:l.encodeLocation,go:O=>l.navigate(O),push:(O,Q,te)=>l.navigate(O,{state:Q,preventScrollReset:te?.preventScrollReset}),replace:(O,Q,te)=>l.navigate(O,{replace:!0,state:Q,preventScrollReset:te?.preventScrollReset})}),[l]),V=l.basename||"/",K=Re.useMemo(()=>({router:l,navigator:H,static:!1,basename:V}),[l,H,V]),T=Re.useMemo(()=>({v7_relativeSplatPath:l.future.v7_relativeSplatPath}),[l.future.v7_relativeSplatPath]);return Re.useEffect(()=>jC(o,l.future),[o,l.future]),Re.createElement(Re.Fragment,null,Re.createElement(xs.Provider,{value:K},Re.createElement(Am.Provider,{value:c},Re.createElement(UC.Provider,{value:R.current},Re.createElement(tj.Provider,{value:m},Re.createElement(wC,{basename:V,location:c.location,navigationType:c.historyAction,navigator:H,future:T},c.initialized||l.future.v7_partialHydration?Re.createElement(PC,{routes:l.routes,future:l.future,state:c}):n))))),null)}const PC=Re.memo(kC);function kC(a){let{routes:n,future:l,state:o}=a;return Qx(n,void 0,o,l)}const IC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",VC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sn=Re.forwardRef(function(n,l){let{onClick:o,relative:c,reloadDocument:d,replace:f,state:p,target:m,to:g,preventScrollReset:v,viewTransition:b}=n,x=ej(n,NC),{basename:j}=Re.useContext(Ha),D,S=!1;if(typeof g=="string"&&VC.test(g)&&(D=g,IC))try{let B=new URL(window.location.href),H=g.startsWith("//")?new URL(B.protocol+g):new URL(g),V=Xn(H.pathname,j);H.origin===B.origin&&V!=null?g=V+H.search+H.hash:S=!0}catch{}let R=iC(g,{relative:c}),E=YC(g,{replace:f,state:p,target:m,preventScrollReset:v,relative:c,viewTransition:b});function A(B){o&&o(B),B.defaultPrevented||E(B)}return Re.createElement("a",kl({},x,{href:D||R,onClick:S||d?o:A,ref:l,target:m}))}),Ht=Re.forwardRef(function(n,l){let{"aria-current":o="page",caseSensitive:c=!1,className:d="",end:f=!1,style:p,to:m,viewTransition:g,children:v}=n,b=ej(n,MC),x=Oc(m,{relative:b.relative}),j=Qi(),D=Re.useContext(Am),{navigator:S,basename:R}=Re.useContext(Ha),E=D!=null&&XC(x)&&g===!0,A=S.encodeLocation?S.encodeLocation(x).pathname:x.pathname,B=j.pathname,H=D&&D.navigation&&D.navigation.location?D.navigation.location.pathname:null;c||(B=B.toLowerCase(),H=H?H.toLowerCase():null,A=A.toLowerCase()),H&&R&&(H=Xn(H,R)||H);const V=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let K=B===A||!f&&B.startsWith(A)&&B.charAt(V)==="/",T=H!=null&&(H===A||!f&&H.startsWith(A)&&H.charAt(A.length)==="/"),O={isActive:K,isPending:T,isTransitioning:E},Q=K?o:void 0,te;typeof d=="function"?te=d(O):te=[d,K?"active":null,T?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let ae=typeof p=="function"?p(O):p;return Re.createElement(Sn,kl({},b,{"aria-current":Q,className:te,ref:l,style:ae,to:m,viewTransition:g}),typeof v=="function"?v(O):v)});var um;(function(a){a.UseScrollRestoration="useScrollRestoration",a.UseSubmit="useSubmit",a.UseSubmitFetcher="useSubmitFetcher",a.UseFetcher="useFetcher",a.useViewTransitionState="useViewTransitionState"})(um||(um={}));var sb;(function(a){a.UseFetcher="useFetcher",a.UseFetchers="useFetchers",a.UseScrollRestoration="useScrollRestoration"})(sb||(sb={}));function GC(a){let n=Re.useContext(xs);return n||De(!1),n}function YC(a,n){let{target:l,replace:o,state:c,preventScrollReset:d,relative:f,viewTransition:p}=n===void 0?{}:n,m=on(),g=Qi(),v=Oc(a,{relative:f});return Re.useCallback(b=>{if(RC(b,l)){b.preventDefault();let x=o!==void 0?o:Vi(g)===Vi(v);m(a,{replace:x,state:c,preventScrollReset:d,relative:f,viewTransition:p})}},[g,m,v,o,c,l,a,d,f,p])}function XC(a,n){n===void 0&&(n={});let l=Re.useContext(tj);l==null&&De(!1);let{basename:o}=GC(um.useViewTransitionState),c=Oc(a,{relative:n.relative});if(!l.isTransitioning)return!1;let d=Xn(l.currentLocation.pathname,o)||l.currentLocation.pathname,f=Xn(l.nextLocation.pathname,o)||l.nextLocation.pathname;return cs(c.pathname,f)!=null||cs(c.pathname,d)!=null}function Uc(a,n,l){return(o,c)=>({label:(o.key&&c.safeNameFromId(a.idFromKey(o.key)))??n,url:l?.replace(":key",o.key??"")})}const{createContext:QC,Component:KC,createElement:ob,useContext:XB,useState:QB,useMemo:KB,forwardRef:ZB}=await C("react"),nj=QC(null),tf={didCatch:!1,error:null};let ZC=class extends KC{constructor(n){super(n),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=tf}static getDerivedStateFromError(n){return{didCatch:!0,error:n}}resetErrorBoundary(){const{error:n}=this.state;if(n!==null){for(var l,o,c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];(l=(o=this.props).onReset)===null||l===void 0||l.call(o,{args:d,reason:"imperative-api"}),this.setState(tf)}}componentDidCatch(n,l){var o,c;(o=(c=this.props).onError)===null||o===void 0||o.call(c,n,l)}componentDidUpdate(n,l){const{didCatch:o}=this.state,{resetKeys:c}=this.props;if(o&&l.error!==null&&WC(n.resetKeys,c)){var d,f;(d=(f=this.props).onReset)===null||d===void 0||d.call(f,{next:c,prev:n.resetKeys,reason:"keys"}),this.setState(tf)}}render(){const{children:n,fallbackRender:l,FallbackComponent:o,fallback:c}=this.props,{didCatch:d,error:f}=this.state;let p=n;if(d){const m={error:f,resetErrorBoundary:this.resetErrorBoundary};if(typeof l=="function")p=l(m);else if(o)p=ob(o,m);else if(c!==void 0)p=c;else throw f}return ob(nj.Provider,{value:{didCatch:d,error:f,resetErrorBoundary:this.resetErrorBoundary}},p)}};function WC(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return a.length!==n.length||a.some((l,o)=>!Object.is(l,n[o]))}function pa(a){const n={subscribe(l){let o=null,c=!1,d=!1,f=!1;function p(){if(o===null){f=!0;return}d||(d=!0,typeof o=="function"?o():o&&o.unsubscribe())}return o=a({next(m){c||l.next?.(m)},error(m){c||(c=!0,l.error?.(m),p())},complete(){c||(c=!0,l.complete?.(),p())}}),f&&p(),{unsubscribe:p}},pipe(...l){return l.reduce(JC,n)}};return n}function JC(a,n){return n(a)}function eE(a){const n=new AbortController;return new Promise((o,c)=>{let d=!1;function f(){d||(d=!0,p.unsubscribe())}n.signal.addEventListener("abort",()=>{c(n.signal.reason)});const p=a.subscribe({next(m){d=!0,o(m),f()},error(m){c(m)},complete(){n.abort(),f()}})})}function tE(a){return n=>{let l=0,o=null;const c=[];function d(){o||(o=n.subscribe({next(p){for(const m of c)m.next?.(p)},error(p){for(const m of c)m.error?.(p)},complete(){for(const p of c)p.complete?.()}}))}function f(){if(l===0&&o){const p=o;o=null,p.unsubscribe()}}return pa(p=>(l++,c.push(p),d(),{unsubscribe(){l--,f();const m=c.findIndex(g=>g===p);m>-1&&c.splice(m,1)}}))}}function nE(a){return n=>pa(l=>n.subscribe({next(o){a.next?.(o),l.next(o)},error(o){a.error?.(o),l.error(o)},complete(){a.complete?.(),l.complete()}}))}function aj(a){let n=a;const l=[],o=f=>{n!==void 0&&f.next(n),l.push(f)},c=f=>{l.splice(l.indexOf(f),1)},d=pa(f=>(o(f),()=>{c(f)}));return d.next=f=>{if(n!==f){n=f;for(const p of l)p.next(f)}},d.get=()=>n,d}function ij(a){return pa(n=>{function l(c=0,d=a.op){const f=a.links[c];if(!f)throw new Error("No more links to execute - did you forget to add an ending link?");return f({op:d,next(m){return l(c+1,m)}})}return l().subscribe(n)})}const lj=()=>{},cb=a=>{Object.freeze&&Object.freeze(a)};function rj(a,n,l){var o,c;const d=n.join(".");return(o=l)[c=d]??(o[c]=new Proxy(lj,{get(f,p){if(!(typeof p!="string"||p==="then"))return rj(a,[...n,p],l)},apply(f,p,m){const g=n[n.length-1];let v={args:m,path:n};return g==="call"?v={args:m.length>=2?[m[1]]:[],path:n.slice(0,-1)}:g==="apply"&&(v={args:m.length>=2?m[1]:[],path:n.slice(0,-1)}),cb(v.args),cb(v.path),a(v)}})),l[d]}const aE=a=>rj(a,[],Object.create(null)),iE=a=>new Proxy(lj,{get(n,l){if(l!=="then")return a(l)}});function fs(a){return!!a&&!Array.isArray(a)&&typeof a=="object"}const ub=a=>a();function db(a=0){return new Promise(n=>setTimeout(n,a))}function lE(a,n){if("error"in a){const o=n.deserialize(a.error);return{ok:!1,error:{...a,error:o}}}return{ok:!0,result:{...a.result,...(!a.result.type||a.result.type==="data")&&{type:"data",data:n.deserialize(a.result.data)}}}}class nf extends Error{constructor(){super("Unable to transform response from server")}}function sj(a,n){let l;try{l=lE(a,n)}catch{throw new nf}if(!l.ok&&(!fs(l.error.error)||typeof l.error.error.code!="number"))throw new nf;if(l.ok&&!fs(l.result))throw new nf;return l}var fb,hb;(fb=Symbol).dispose??(fb.dispose=Symbol());(hb=Symbol).asyncDispose??(hb.asyncDispose=Symbol());typeof window>"u"||"Deno"in window||globalThis.process?.env?.NODE_ENV==="test"||globalThis.process?.env?.JEST_WORKER_ID||globalThis.process?.env?.VITEST_WORKER_ID;function Ho(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}function rE(a){return a instanceof Wt||a instanceof Error&&a.name==="TRPCClientError"}function sE(a){return fs(a)&&fs(a.error)&&typeof a.error.code=="number"&&typeof a.error.message=="string"}function oE(a,n){return typeof a=="string"?a:fs(a)&&typeof a.message=="string"?a.message:n}class Wt extends Error{static from(n,l={}){const o=n;return rE(o)?(l.meta&&(o.meta={...o.meta,...l.meta}),o):sE(o)?new Wt(o.error.message,{...l,result:o}):new Wt(oE(o,"Unknown error"),{...l,cause:o})}constructor(n,l){const o=l?.cause;super(n,{cause:o}),Ho(this,"cause",void 0),Ho(this,"shape",void 0),Ho(this,"data",void 0),Ho(this,"meta",void 0),this.meta=l?.meta,this.cause=o,this.shape=l?.result?.error,this.data=l?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Wt.prototype)}}function af(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}class cE{$request(n){return ij({links:this.links,op:{...n,context:n.context??{},id:++this.requestId}}).pipe(tE())}async requestAsPromise(n){try{const l=this.$request(n);return(await eE(l)).result.data}catch(l){throw Wt.from(l)}}query(n,l,o){return this.requestAsPromise({type:"query",path:n,input:l,context:o?.context,signal:o?.signal})}mutation(n,l,o){return this.requestAsPromise({type:"mutation",path:n,input:l,context:o?.context,signal:o?.signal})}subscription(n,l,o){return this.$request({type:"subscription",path:n,input:l,context:o.context,signal:o.signal}).subscribe({next(d){switch(d.result.type){case"state":{o.onConnectionStateChange?.(d.result);break}case"started":{o.onStarted?.({context:d.context});break}case"stopped":{o.onStopped?.();break}case"data":case void 0:{o.onData?.(d.result.data);break}}},error(d){o.onError?.(d)},complete(){o.onComplete?.()}})}constructor(n){af(this,"links",void 0),af(this,"runtime",void 0),af(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=n.links.map(l=>l(this.runtime))}}const uE=Symbol.for("trpc_untypedClient"),dE={query:"query",mutate:"mutation",subscribe:"subscription"},fE=a=>dE[a];function hE(a){const n=aE(({path:l,args:o})=>{const c=[...l],d=fE(c.pop()),f=c.join(".");return a[d](f,...o)});return iE(l=>l===uE?a:n[l])}function mE(a){const n=new cE(a);return hE(n)}const mb=a=>typeof a=="function";function pE(a){if(a)return a;if(typeof window<"u"&&mb(window.fetch))return window.fetch;if(typeof globalThis<"u"&&mb(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const pb=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function gb(a){let n=null,l=null;const o=()=>{clearTimeout(l),l=null,n=null};function c(p){const m=[[]];let g=0;for(;;){const v=p[g];if(!v)break;const b=m[m.length-1];if(v.aborted){v.reject?.(new Error("Aborted")),g++;continue}if(a.validate(b.concat(v).map(j=>j.key))){b.push(v),g++;continue}if(b.length===0){v.reject?.(new Error("Input is too big for a single dispatch")),g++;continue}m.push([])}return m}function d(){const p=c(n);o();for(const m of p){if(!m.length)continue;const g={items:m};for(const b of m)b.batch=g;a.fetch(g.items.map(b=>b.key)).then(async b=>{await Promise.all(b.map(async(x,j)=>{const D=g.items[j];try{const S=await Promise.resolve(x);D.resolve?.(S)}catch(S){D.reject?.(S)}D.batch=null,D.reject=null,D.resolve=null}));for(const x of g.items)x.reject?.(new Error("Missing result")),x.batch=null}).catch(b=>{for(const x of g.items)x.reject?.(b),x.batch=null})}}function f(p){const m={aborted:!1,key:p,batch:null,resolve:pb,reject:pb},g=new Promise((v,b)=>{m.reject=b,m.resolve=v,n||(n=[]),n.push(m)});return l||(l=setTimeout(d)),g}return{load:f}}function gE(...a){const n=new AbortController,l=a.length;let o=0;const c=()=>{++o===l&&n.abort()};for(const d of a)d?.aborted?c():d?.addEventListener("abort",c,{once:!0});return n.signal}function oj(a){const n=a;return n?"input"in n?n:{input:n,output:n}:{input:{serialize:l=>l,deserialize:l=>l},output:{serialize:l=>l,deserialize:l=>l}}}function vE(a){return{url:a.url.toString(),fetch:a.fetch,transformer:oj(a.transformer),methodOverride:a.methodOverride}}function bE(a){const n={};for(let l=0;l<a.length;l++){const o=a[l];n[l]=o}return n}const yE={query:"GET",mutation:"POST",subscription:"PATCH"};function cj(a){return"input"in a?a.transformer.input.serialize(a.input):bE(a.inputs.map(n=>a.transformer.input.serialize(n)))}const uj=a=>{const n=a.url.split("?");let o=n[0].replace(/\/$/,"")+"/"+a.path;const c=[];if(n[1]&&c.push(n[1]),"inputs"in a&&c.push("batch=1"),a.type==="query"||a.type==="subscription"){const d=cj(a);d!==void 0&&a.methodOverride!=="POST"&&c.push(`input=${encodeURIComponent(JSON.stringify(d))}`)}return c.length&&(o+="?"+c.join("&")),o},xE=a=>{if(a.type==="query"&&a.methodOverride!=="POST")return;const n=cj(a);return n!==void 0?JSON.stringify(n):void 0},jE=a=>EE({...a,contentTypeHeader:"application/json",getUrl:uj,getBody:xE});class SE extends Error{constructor(){const n="AbortError";super(n),this.name=n,this.message=n}}const wE=a=>{if(a?.aborted)throw a.throwIfAborted?.(),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new SE};async function CE(a){wE(a.signal);const n=a.getUrl(a),l=a.getBody(a),{type:o}=a,c=await(async()=>{const f=await a.headers();return Symbol.iterator in f?Object.fromEntries(f):f})(),d={...a.contentTypeHeader?{"content-type":a.contentTypeHeader}:{},...a.trpcAcceptHeader?{"trpc-accept":a.trpcAcceptHeader}:void 0,...c};return pE(a.fetch)(n,{method:a.methodOverride??yE[o],signal:a.signal,body:l,headers:d})}async function EE(a){const n={},l=await CE(a);n.response=l;const o=await l.json();return n.responseJSON=o,{json:o,meta:n}}function DE(a){const n=vE(a),l=a.maxURLLength??1/0,o=a.maxItems??1/0;return()=>{const c=m=>({validate(g){if(l===1/0&&o===1/0)return!0;if(g.length>o)return!1;const v=g.map(j=>j.path).join(","),b=g.map(j=>j.input);return uj({...n,type:m,path:v,inputs:b,signal:null}).length<=l},async fetch(g){const v=g.map(R=>R.path).join(","),b=g.map(R=>R.input),x=gE(...g.map(R=>R.signal)),j=await jE({...n,path:v,inputs:b,type:m,headers(){return a.headers?typeof a.headers=="function"?a.headers({opList:g}):a.headers:{}},signal:x});return(Array.isArray(j.json)?j.json:g.map(()=>j.json)).map(R=>({meta:j.meta,json:R}))}}),d=gb(c("query")),f=gb(c("mutation")),p={query:d,mutation:f};return({op:m})=>pa(g=>{/* istanbul ignore if -- @preserve */if(m.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const b=p[m.type].load(m);let x;return b.then(j=>{x=j;const D=sj(j.json,n.transformer.output);if(!D.ok){g.error(Wt.from(D.error,{meta:j.meta}));return}g.next({context:j.meta,result:D.result}),g.complete()}).catch(j=>{g.error(Wt.from(j,{meta:x?.meta}))}),()=>{}})}}function TE(a){return typeof FormData>"u"?!1:a instanceof FormData}const lf={css:{query:["72e3ff","3fb0d8"],mutation:["c5a3fc","904dfc"],subscription:["ff49e1","d83fbe"]},ansi:{regular:{query:["\x1B[30;46m","\x1B[97;46m"],mutation:["\x1B[30;45m","\x1B[97;45m"],subscription:["\x1B[30;42m","\x1B[97;42m"]},bold:{query:["\x1B[1;30;46m","\x1B[1;97;46m"],mutation:["\x1B[1;30;45m","\x1B[1;97;45m"],subscription:["\x1B[1;30;42m","\x1B[1;97;42m"]}}};function RE(a){const{direction:n,type:l,withContext:o,path:c,id:d,input:f}=a,p=[],m=[];if(a.colorMode==="none")p.push(n==="up"?">>":"<<",l,`#${d}`,c);else if(a.colorMode==="ansi"){const[g,v]=lf.ansi.regular[l],[b,x]=lf.ansi.bold[l];p.push(n==="up"?g:v,n==="up"?">>":"<<",l,n==="up"?b:x,`#${d}`,c,"\x1B[0m")}else{const[g,v]=lf.css[l],b=`
|
|
54
|
+
background-color: #${n==="up"?g:v};
|
|
55
|
+
color: ${n==="up"?"black":"white"};
|
|
56
|
+
padding: 2px;
|
|
57
|
+
`;p.push("%c",n==="up"?">>":"<<",l,`#${d}`,`%c${c}%c`,"%O"),m.push(b,`${b}; font-weight: bold;`,`${b}; font-weight: normal;`)}return n==="up"?m.push(o?{input:f,context:a.context}:{input:f}):m.push({input:f,result:a.result,elapsedMs:a.elapsedMs,...o&&{context:a.context}}),{parts:p,args:m}}const NE=({c:a=console,colorMode:n="css",withContext:l})=>o=>{const c=o.input,d=TE(c)?Object.fromEntries(c):c,{parts:f,args:p}=RE({...o,colorMode:n,input:d,withContext:l}),m=o.direction==="down"&&o.result&&(o.result instanceof Error||"error"in o.result.result&&o.result.result.error)?"error":"log";a[m].apply(null,[f.join(" ")].concat(p))};function ME(a={}){const{enabled:n=()=>!0}=a,l=a.colorMode??(typeof window>"u"?"ansi":"css"),o=a.withContext??l==="css",{logger:c=NE({c:a.console,colorMode:l,withContext:o})}=a;return()=>({op:d,next:f})=>pa(p=>{n({...d,direction:"up"})&&c({...d,direction:"up"});const m=Date.now();function g(v){const b=Date.now()-m;n({...d,direction:"down",result:v})&&c({...d,direction:"down",elapsedMs:b,result:v})}return f(d).pipe(nE({next(v){g(v)},error(v){g(v)}})).subscribe(p)})}function vb(a){return Array.isArray(a)?a:[a]}function AE(a){return n=>{const l=vb(a.true).map(c=>c(n)),o=vb(a.false).map(c=>c(n));return c=>pa(d=>{const f=a.condition(c.op)?l:o;return ij({op:c.op,links:f}).subscribe(d)})}}const $E={enabled:!1,closeMs:0},LE={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},OE=a=>a===0?0:Math.min(1e3*2**a,3e4),dj=(a,...n)=>typeof a=="function"?a(...n):a;function rf(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}class hi extends Error{constructor(n){super(n.message,{cause:n.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,hi.prototype)}}class UE{reset(){this.timeout&&(clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs))}start(){clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs)}stop(){clearTimeout(this.timeout),this.timeout=void 0}constructor(n,l){rf(this,"onTimeout",void 0),rf(this,"timeoutMs",void 0),rf(this,"timeout",void 0),this.onTimeout=n,this.timeoutMs=l}}function fj(){let a,n;return{promise:new Promise((o,c)=>{a=o,n=c}),resolve:a,reject:n}}async function zE(a){const n=await dj(a.url);if(!a.connectionParams)return n;const o=`${n.includes("?")?"&":"?"}connectionParams=1`;return n+o}async function BE(a){const n={method:"connectionParams",data:await dj(a)};return JSON.stringify(n)}function bb(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}class _E{register(n,l){const{promise:o,resolve:c}=fj();return this.outgoingRequests.push({id:String(n.id),message:n,end:o,callbacks:{next:l.next,complete:()=>{l.complete(),c()},error:d=>{l.error(d),c()}}}),()=>{this.delete(n.id),l.complete(),c()}}delete(n){n!==null&&(this.outgoingRequests=this.outgoingRequests.filter(({id:l})=>l!==String(n)),delete this.pendingRequests[String(n)])}flush(){const n=this.outgoingRequests;this.outgoingRequests=[];for(const l of n)this.pendingRequests[l.id]=l;return n}getPendingRequests(){return Object.values(this.pendingRequests)}getPendingRequest(n){return n===null?null:this.pendingRequests[String(n)]}getOutgoingRequests(){return this.outgoingRequests}getRequests(){return[...this.getOutgoingRequests().map(n=>({state:"outgoing",message:n.message,end:n.end,callbacks:n.callbacks})),...this.getPendingRequests().map(n=>({state:"pending",message:n.message,end:n.end,callbacks:n.callbacks}))]}hasPendingRequests(){return this.getPendingRequests().length>0}hasOutgoingRequests(){return this.outgoingRequests.length>0}constructor(){bb(this,"outgoingRequests",new Array),bb(this,"pendingRequests",{})}}function Hi(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}function FE(a){const{promise:n,resolve:l,reject:o}=fj();return a.addEventListener("open",()=>{a.removeEventListener("error",o),l()}),a.addEventListener("error",o),n}function qE(a,{intervalMs:n,pongTimeoutMs:l}){let o,c;function d(){o=setTimeout(()=>{a.send("PING"),c=setTimeout(()=>{a.close()},l)},n)}function f(){clearTimeout(o),d()}function p(){clearTimeout(c),f()}a.addEventListener("open",d),a.addEventListener("message",({data:m})=>{clearTimeout(o),d(),m==="PONG"&&p()}),a.addEventListener("close",()=>{clearTimeout(o),clearTimeout(c)})}class hs{get ws(){return this.wsObservable.get()}set ws(n){this.wsObservable.next(n)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++hs.connectCount;const n=zE(this.urlOptions).then(l=>new this.WebSocketPonyfill(l));this.openPromise=n.then(async l=>{this.ws=l,l.addEventListener("message",function({data:o}){o==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&qE(l,this.keepAliveOpts),l.addEventListener("close",()=>{this.ws===l&&(this.ws=null)}),await FE(l),this.urlOptions.connectionParams&&l.send(await BE(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{this.ws?.close()}}constructor(n){if(Hi(this,"id",++hs.connectCount),Hi(this,"WebSocketPonyfill",void 0),Hi(this,"urlOptions",void 0),Hi(this,"keepAliveOpts",void 0),Hi(this,"wsObservable",aj(null)),Hi(this,"openPromise",null),this.WebSocketPonyfill=n.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=n.urlOptions,this.keepAliveOpts=n.keepAlive}}Hi(hs,"connectCount",0);function HE(a){return a.isOpen()?{id:a.id,state:"open",ws:a.ws}:a.isClosed()?{id:a.id,state:"closed",ws:a.ws}:a.ws?{id:a.id,state:"connecting",ws:a.ws}:null}function _a(a,n,l){return n in a?Object.defineProperty(a,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[n]=l,a}class PE{async open(){this.allowReconnect=!0,this.connectionState.get().state!=="connecting"&&this.connectionState.next({type:"state",state:"connecting",error:null});try{await this.activeConnection.open()}catch(n){return this.reconnect(new hi({message:"Initialization error",cause:n})),this.reconnecting}}async close(){this.allowReconnect=!1,this.inactivityTimeout.stop();const n=[];for(const l of this.requestManager.getRequests())l.message.method==="subscription"?l.callbacks.complete():l.state==="outgoing"?l.callbacks.error(Wt.from(new hi({message:"Closed before connection was established"}))):n.push(l.end);await Promise.all(n).catch(()=>null),await this.activeConnection.close().catch(()=>null),this.connectionState.next({type:"state",state:"idle",error:null})}request({op:{id:n,type:l,path:o,input:c,signal:d},transformer:f,lastEventId:p}){return pa(m=>{const g=this.batchSend({id:n,method:l,params:{input:f.input.serialize(c),path:o,lastEventId:p}},{...m,next(v){const b=sj(v,f.output);if(!b.ok){m.error(Wt.from(b.error));return}m.next({result:b.result})}});return()=>{g(),l==="subscription"&&this.activeConnection.isOpen()&&this.send({id:n,method:"subscription.stop"}),d?.removeEventListener("abort",g)}})}get connection(){return HE(this.activeConnection)}reconnect(n){if(this.connectionState.next({type:"state",state:"connecting",error:Wt.from(n)}),this.reconnecting)return;const l=async o=>{try{await db(this.reconnectRetryDelay(o)),this.allowReconnect&&(await this.activeConnection.close(),await this.activeConnection.open(),this.requestManager.hasPendingRequests()&&this.send(this.requestManager.getPendingRequests().map(({message:c})=>c))),this.reconnecting=null}catch{await l(o+1)}};this.reconnecting=l(0)}setupWebSocketListeners(n){const l=o=>{const c=this.requestManager.getPendingRequests();for(const{message:d,callbacks:f}of c)d.method!=="subscription"&&(f.error(Wt.from(o??new hi({message:"WebSocket closed",cause:o}))),this.requestManager.delete(d.id))};n.addEventListener("open",()=>{ub(async()=>{this.lazyMode&&this.inactivityTimeout.start(),this.callbacks.onOpen?.(),this.connectionState.next({type:"state",state:"pending",error:null})}).catch(o=>{n.close(3e3),l(o)})}),n.addEventListener("message",({data:o})=>{if(this.inactivityTimeout.reset(),typeof o!="string"||["PING","PONG"].includes(o))return;const c=JSON.parse(o);if("method"in c){this.handleIncomingRequest(c);return}this.handleResponseMessage(c)}),n.addEventListener("close",o=>{l(o),this.callbacks.onClose?.(o),this.lazyMode||this.reconnect(new hi({message:"WebSocket closed",cause:o}))}),n.addEventListener("error",o=>{l(o),this.callbacks.onError?.(o),this.reconnect(new hi({message:"WebSocket closed",cause:o}))})}handleResponseMessage(n){const l=this.requestManager.getPendingRequest(n.id);if(!l)return;l.callbacks.next(n);let o=!0;"result"in n&&l.message.method==="subscription"&&(n.result.type==="data"&&(l.message.params.lastEventId=n.result.id),n.result.type!=="stopped"&&(o=!1)),o&&(l.callbacks.complete(),this.requestManager.delete(n.id))}handleIncomingRequest(n){n.method==="reconnect"&&this.reconnect(new hi({message:"Server requested reconnect"}))}send(n){if(!this.activeConnection.isOpen())throw new Error("Active connection is not open");const l=n instanceof Array?n:[n];this.activeConnection.ws.send(JSON.stringify(l.length===1?l[0]:l))}batchSend(n,l){return this.inactivityTimeout.reset(),ub(async()=>{this.activeConnection.isOpen()||await this.open(),await db(0),this.requestManager.hasOutgoingRequests()&&this.send(this.requestManager.flush().map(({message:o})=>o))}).catch(o=>{this.requestManager.delete(n.id),l.error(Wt.from(o))}),this.requestManager.register(n,l)}constructor(n){_a(this,"connectionState",void 0),_a(this,"allowReconnect",!1),_a(this,"requestManager",new _E),_a(this,"activeConnection",void 0),_a(this,"reconnectRetryDelay",void 0),_a(this,"inactivityTimeout",void 0),_a(this,"callbacks",void 0),_a(this,"lazyMode",void 0),_a(this,"reconnecting",null),this.callbacks={onOpen:n.onOpen,onClose:n.onClose,onError:n.onError};const l={...$E,...n.lazy};this.inactivityTimeout=new UE(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},l.closeMs),this.activeConnection=new hs({WebSocketPonyfill:n.WebSocket,urlOptions:n,keepAlive:{...LE,...n.keepAlive}}),this.activeConnection.wsObservable.subscribe({next:o=>{o&&this.setupWebSocketListeners(o)}}),this.reconnectRetryDelay=n.retryDelayMs??OE,this.lazyMode=l.enabled,this.connectionState=aj({type:"state",state:l.enabled?"idle":"connecting",error:null}),this.lazyMode||this.open().catch(()=>null)}}function kE(a){return new PE(a)}function IE(a){const{client:n}=a,l=oj(a.transformer);return()=>({op:o})=>pa(c=>{const d=o.type==="subscription"?n.connectionState.subscribe({next(p){c.next({result:p,context:o.context})}}):null,f=n.request({op:o,transformer:l}).subscribe(c);return()=>{f.unsubscribe(),d?.unsubscribe()}})}class da extends Error{constructor(n,l){super(n),this.title=l,this.name="UserVisibleError"}}class yb extends da{constructor(n){super(`Cannot delete because of references: ${n.map(l=>l.ref.path.join(".")).join(", ")}`),this.issues=n}}class hj extends da{constructor(n="The item you are looking for could not be found"){super(n,"Not found")}}function VE(a){return a.issues.map(l=>{const{path:o,message:c}=l;return`${o.join(".")}: ${c}`}).join("; ")}var pc={exports:{}},GE=pc.exports,xb;function YE(){return xb||(xb=1,function(a){(function(n,l){a.exports?a.exports=l():n.log=l()})(GE,function(){var n=function(){},l="undefined",o=typeof window!==l&&typeof window.navigator!==l&&/Trident\/|MSIE /.test(window.navigator.userAgent),c=["trace","debug","info","warn","error"],d={},f=null;function p(S,R){var E=S[R];if(typeof E.bind=="function")return E.bind(S);try{return Function.prototype.bind.call(E,S)}catch{return function(){return Function.prototype.apply.apply(E,[S,arguments])}}}function m(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function g(S){return S==="debug"&&(S="log"),typeof console===l?!1:S==="trace"&&o?m:console[S]!==void 0?p(console,S):console.log!==void 0?p(console,"log"):n}function v(){for(var S=this.getLevel(),R=0;R<c.length;R++){var E=c[R];this[E]=R<S?n:this.methodFactory(E,S,this.name)}if(this.log=this.debug,typeof console===l&&S<this.levels.SILENT)return"No console available for logging"}function b(S){return function(){typeof console!==l&&(v.call(this),this[S].apply(this,arguments))}}function x(S,R,E){return g(S)||b.apply(this,arguments)}function j(S,R){var E=this,A,B,H,V="loglevel";typeof S=="string"?V+=":"+S:typeof S=="symbol"&&(V=void 0);function K(ae){var se=(c[ae]||"silent").toUpperCase();if(!(typeof window===l||!V)){try{window.localStorage[V]=se;return}catch{}try{window.document.cookie=encodeURIComponent(V)+"="+se+";"}catch{}}}function T(){var ae;if(!(typeof window===l||!V)){try{ae=window.localStorage[V]}catch{}if(typeof ae===l)try{var se=window.document.cookie,Ee=encodeURIComponent(V),G=se.indexOf(Ee+"=");G!==-1&&(ae=/^([^;]+)/.exec(se.slice(G+Ee.length+1))[1])}catch{}return E.levels[ae]===void 0&&(ae=void 0),ae}}function O(){if(!(typeof window===l||!V)){try{window.localStorage.removeItem(V)}catch{}try{window.document.cookie=encodeURIComponent(V)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function Q(ae){var se=ae;if(typeof se=="string"&&E.levels[se.toUpperCase()]!==void 0&&(se=E.levels[se.toUpperCase()]),typeof se=="number"&&se>=0&&se<=E.levels.SILENT)return se;throw new TypeError("log.setLevel() called with invalid level: "+ae)}E.name=S,E.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},E.methodFactory=R||x,E.getLevel=function(){return H??B??A},E.setLevel=function(ae,se){return H=Q(ae),se!==!1&&K(H),v.call(E)},E.setDefaultLevel=function(ae){B=Q(ae),T()||E.setLevel(ae,!1)},E.resetLevel=function(){H=null,O(),v.call(E)},E.enableAll=function(ae){E.setLevel(E.levels.TRACE,ae)},E.disableAll=function(ae){E.setLevel(E.levels.SILENT,ae)},E.rebuild=function(){if(f!==E&&(A=Q(f.getLevel())),v.call(E),f===E)for(var ae in d)d[ae].rebuild()},A=Q(f?f.getLevel():"WARN");var te=T();te!=null&&(H=Q(te)),v.call(E)}f=new j,f.getLogger=function(R){if(typeof R!="symbol"&&typeof R!="string"||R==="")throw new TypeError("You must supply a name when creating a logger.");var E=d[R];return E||(E=d[R]=new j(R,f.methodFactory)),E};var D=typeof window!==l?window.log:void 0;return f.noConflict=function(){return typeof window!==l&&window.log===f&&(window.log=D),f},f.getLoggers=function(){return d},f.default=f,f})}(pc)),pc.exports}var XE=YE();const QE=Em(XE),mj=QE;mj.enableAll();function _l(a){mj.error(a)}function KE(a){if(a instanceof Wt){const n=a;if(n.data?.isUserVisible&&n.message)return[n.message,n.data.descriptionText].filter(Boolean).join(`
|
|
58
|
+
`);if(n.message.includes("Failed to fetch"))return"Could not connect to the server. Please start the server and try again."}return a instanceof da?a.message:"Check console logs for more details."}function Gl(a,n="Sorry, something went wrong."){const l=KE(a);return`${n} ${l}`}function wn(a,n){return _l(a),Gl(a,n)}const{Button:ZE,ErrorDisplay:WE}=await C("@baseplate-dev/ui-components"),{useContext:JE}=await C("react");function e6({resetButtonLabel:a}){const{resetErrorBoundary:n,error:l}=JE(nj)??{resetErrorBoundary:()=>{},error:void 0},o=l instanceof da?l.title:void 0,c=!(l instanceof da),d=Gl(l,"");return s.jsx(WE,{header:o,error:d,actions:c&&s.jsx(ZE,{onClick:n,children:a})})}function Yl({children:a,resetButtonLabel:n,onReset:l}){return s.jsx(ZC,{fallback:s.jsx(e6,{resetButtonLabel:n??"Reload Page"}),onError:o=>{_l(o)},onReset:()=>{l?l():globalThis.location.reload()},children:a})}var sf,jb;function t6(){if(jb)return sf;jb=1;var a=function(){function d(f,p){for(var m=0;m<p.length;m++){var g=p[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(f,g.key,g)}}return function(f,p,m){return p&&d(f.prototype,p),m&&d(f,m),f}}();function n(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}var l=[[{color:"0, 0, 0",class:"ansi-black"},{color:"187, 0, 0",class:"ansi-red"},{color:"0, 187, 0",class:"ansi-green"},{color:"187, 187, 0",class:"ansi-yellow"},{color:"0, 0, 187",class:"ansi-blue"},{color:"187, 0, 187",class:"ansi-magenta"},{color:"0, 187, 187",class:"ansi-cyan"},{color:"255,255,255",class:"ansi-white"}],[{color:"85, 85, 85",class:"ansi-bright-black"},{color:"255, 85, 85",class:"ansi-bright-red"},{color:"0, 255, 0",class:"ansi-bright-green"},{color:"255, 255, 85",class:"ansi-bright-yellow"},{color:"85, 85, 255",class:"ansi-bright-blue"},{color:"255, 85, 255",class:"ansi-bright-magenta"},{color:"85, 255, 255",class:"ansi-bright-cyan"},{color:"255, 255, 255",class:"ansi-bright-white"}]],o=/(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&|%[A-Fa-f0-9]{2})+)/gm,c=function(){a(d,null,[{key:"escapeForHtml",value:function(p){return new d().escapeForHtml(p)}},{key:"linkify",value:function(p){return new d().linkify(p)}},{key:"ansiToHtml",value:function(p,m){return new d().ansiToHtml(p,m)}},{key:"ansiToJson",value:function(p,m){return new d().ansiToJson(p,m)}},{key:"ansiToText",value:function(p){return new d().ansiToText(p)}}]);function d(){n(this,d),this.fg=this.bg=this.fg_truecolor=this.bg_truecolor=null,this.bright=0,this.decorations=[]}return a(d,[{key:"setupPalette",value:function(){this.PALETTE_COLORS=[];for(var p=0;p<2;++p)for(var m=0;m<8;++m)this.PALETTE_COLORS.push(l[p][m].color);for(var g=[0,95,135,175,215,255],v=function(E,A,B){return g[E]+", "+g[A]+", "+g[B]},b=0;b<6;++b)for(var x=0;x<6;++x)for(var j=0;j<6;++j)this.PALETTE_COLORS.push(v(b,x,j));for(var D=8,S=0;S<24;++S,D+=10)this.PALETTE_COLORS.push(v(D,D,D))}},{key:"escapeForHtml",value:function(p){return p.replace(/[&<>\"]/gm,function(m){return m=="&"?"&":m=='"'?""":m=="<"?"<":m==">"?">":""})}},{key:"linkify",value:function(p){return p.replace(o,function(m){return'<a href="'+m+'">'+m+"</a>"})}},{key:"ansiToHtml",value:function(p,m){return this.process(p,m,!0)}},{key:"ansiToJson",value:function(p,m){return m=m||{},m.json=!0,m.clearLine=!1,this.process(p,m,!0)}},{key:"ansiToText",value:function(p){return this.process(p,{},!1)}},{key:"process",value:function(p,m,g){var v=this,b=this,x=p.split(/\033\[/),j=x.shift();m==null&&(m={}),m.clearLine=/\r/.test(p);var D=x.map(function(R){return v.processChunk(R,m,g)});if(m&&m.json){var S=b.processChunkJson("");return S.content=j,S.clearLine=m.clearLine,D.unshift(S),m.remove_empty&&(D=D.filter(function(R){return!R.isEmpty()})),D}else D.unshift(j);return D.join("")}},{key:"processChunkJson",value:function(p,m,g){m=typeof m>"u"?{}:m;var v=m.use_classes=typeof m.use_classes<"u"&&m.use_classes,b=m.key=v?"class":"color",x={content:p,fg:null,bg:null,fg_truecolor:null,bg_truecolor:null,isInverted:!1,clearLine:m.clearLine,decoration:null,decorations:[],was_processed:!1,isEmpty:function(){return!x.content}},j=p.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);if(!j)return x;x.content=j[4];var D=j[2].split(";");if(j[1]!==""||j[3]!=="m"||!g)return x;for(var S=this;D.length>0;){var R=D.shift(),E=parseInt(R);if(isNaN(E)||E===0)S.fg=S.bg=null,S.decorations=[];else if(E===1)S.decorations.push("bold");else if(E===2)S.decorations.push("dim");else if(E===3)S.decorations.push("italic");else if(E===4)S.decorations.push("underline");else if(E===5)S.decorations.push("blink");else if(E===7)S.decorations.push("reverse");else if(E===8)S.decorations.push("hidden");else if(E===9)S.decorations.push("strikethrough");else if(E===21)S.removeDecoration("bold");else if(E===22)S.removeDecoration("bold"),S.removeDecoration("dim");else if(E===23)S.removeDecoration("italic");else if(E===24)S.removeDecoration("underline");else if(E===25)S.removeDecoration("blink");else if(E===27)S.removeDecoration("reverse");else if(E===28)S.removeDecoration("hidden");else if(E===29)S.removeDecoration("strikethrough");else if(E===39)S.fg=null;else if(E===49)S.bg=null;else if(E>=30&&E<38)S.fg=l[0][E%10][b];else if(E>=90&&E<98)S.fg=l[1][E%10][b];else if(E>=40&&E<48)S.bg=l[0][E%10][b];else if(E>=100&&E<108)S.bg=l[1][E%10][b];else if(E===38||E===48){var A=E===38;if(D.length>=1){var B=D.shift();if(B==="5"&&D.length>=1){var H=parseInt(D.shift());if(H>=0&&H<=255)if(!v)this.PALETTE_COLORS||S.setupPalette(),A?S.fg=this.PALETTE_COLORS[H]:S.bg=this.PALETTE_COLORS[H];else{var V=H>=16?"ansi-palette-"+H:l[H>7?1:0][H%8].class;A?S.fg=V:S.bg=V}}else if(B==="2"&&D.length>=3){var K=parseInt(D.shift()),T=parseInt(D.shift()),O=parseInt(D.shift());if(K>=0&&K<=255&&T>=0&&T<=255&&O>=0&&O<=255){var Q=K+", "+T+", "+O;v?A?(S.fg="ansi-truecolor",S.fg_truecolor=Q):(S.bg="ansi-truecolor",S.bg_truecolor=Q):A?S.fg=Q:S.bg=Q}}}}}return S.fg===null&&S.bg===null&&S.decorations.length===0||(x.fg=S.fg,x.bg=S.bg,x.fg_truecolor=S.fg_truecolor,x.bg_truecolor=S.bg_truecolor,x.decorations=S.decorations,x.decoration=S.decorations.slice(-1).pop()||null,x.was_processed=!0),x}},{key:"processChunk",value:function(p,m,g){var v=this;m=m||{};var b=this.processChunkJson(p,m,g),x=m.use_classes;if(b.decorations=b.decorations.filter(function(A){if(A==="reverse"){b.fg||(b.fg=l[0][7][x?"class":"color"]),b.bg||(b.bg=l[0][0][x?"class":"color"]);var B=b.fg;b.fg=b.bg,b.bg=B;var H=b.fg_truecolor;return b.fg_truecolor=b.bg_truecolor,b.bg_truecolor=H,b.isInverted=!0,!1}return!0}),m.json)return b;if(b.isEmpty())return"";if(!b.was_processed)return b.content;var j=[],D=[],S=[],R={},E=function(B){var H=[],V=void 0;for(V in B)B.hasOwnProperty(V)&&H.push("data-"+V+'="'+v.escapeForHtml(B[V])+'"');return H.length>0?" "+H.join(" "):""};return b.isInverted&&(R["ansi-is-inverted"]="true"),b.fg&&(x?(j.push(b.fg+"-fg"),b.fg_truecolor!==null&&(R["ansi-truecolor-fg"]=b.fg_truecolor,b.fg_truecolor=null)):j.push("color:rgb("+b.fg+")")),b.bg&&(x?(j.push(b.bg+"-bg"),b.bg_truecolor!==null&&(R["ansi-truecolor-bg"]=b.bg_truecolor,b.bg_truecolor=null)):j.push("background-color:rgb("+b.bg+")")),b.decorations.forEach(function(A){if(x){D.push("ansi-"+A);return}A==="bold"?D.push("font-weight:bold"):A==="dim"?D.push("opacity:0.5"):A==="italic"?D.push("font-style:italic"):A==="hidden"?D.push("visibility:hidden"):A==="strikethrough"?S.push("line-through"):S.push(A)}),S.length&&D.push("text-decoration:"+S.join(" ")),x?'<span class="'+j.concat(D).join(" ")+'"'+E(R)+">"+b.content+"</span>":'<span style="'+j.concat(D).join(";")+'"'+E(R)+">"+b.content+"</span>"}},{key:"removeDecoration",value:function(p){var m=this.decorations.indexOf(p);m>=0&&this.decorations.splice(m,1)}}]),d}();return sf=c,sf}var n6=t6();const a6=Em(n6);function i6({text:a}){const n=a.split(`
|
|
59
|
+
`).map((l,o)=>{const c=a6.ansiToJson(l,{use_classes:!1});return s.jsx("div",{children:c.map((d,f)=>{const{decorations:p}=d,m={};d.fg&&(m.color=`rgb(${d.fg})`),d.bg&&(m.backgroundColor=`rgb(${d.bg})`),p.includes("bold")&&(m.fontWeight="bold"),p.includes("italic")&&(m.fontStyle="italic"),p.includes("dim")&&(m.opacity=.5),p.includes("hidden")&&(m.visibility="hidden");const g=[];return p.includes("underline")&&g.push("underline"),p.includes("strikethrough")&&g.push("line-through"),p.includes("blink")&&g.push("blink"),g.length>0&&(m.textDecoration=g.join(" ")),s.jsx("span",{style:m,children:d.content},f)})},o)});return s.jsx(s.Fragment,{children:n})}const{useBlockerDialogState:of}=await C("@baseplate-dev/project-builder-lib/web"),{Button:cf,Dialog:l6,DialogContent:r6,DialogDescription:s6,DialogFooter:o6,DialogHeader:c6,DialogTitle:u6}=await C("@baseplate-dev/ui-components"),{useCallback:Sb,useEffect:d6,useState:f6}=await C("react");function h6(){const a=of(x=>x.activeBlockers.length>0?x.activeBlockers[0]:null),n=of(x=>x.requestedBlockers),l=of(x=>x.clearRequestedBlockers),o=bC(({currentLocation:x,nextLocation:j})=>!!a&&x.pathname!==j.pathname),[c,d]=f6(!1),f=Sb(()=>{o.reset?.(),l()},[o,l]),p=Sb(async x=>{d(!0);try{if(x&&!await x()){f();return}o.state==="blocked"&&o.proceed();for(const j of n)j.onContinue();l()}finally{d(!1)}},[o,n,l,f]),m=o.state==="blocked"||n.length>0;d6(()=>{m&&!a&&!c&&p().catch(x=>{_l(x)})},[m,p,a,c]);const g=s.jsx(cf,{onClick:f,variant:"secondary",children:"Cancel"}),v=a?.buttonContinueWithoutSaveText&&s.jsx(cf,{onClick:()=>p(a.onContinueWithoutSave).catch(x=>{_l(x)}),disabled:c,variant:"secondary",children:a.buttonContinueWithoutSaveText??"Continue without saving"}),b=s.jsx(cf,{disabled:c,onClick:()=>{p(a?.onContinue).catch(x=>{_l(x)})},children:a?.buttonContinueText??"Continue"});return s.jsx(l6,{open:m,onOpenChange:x=>{x||f()},children:s.jsx(r6,{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(c6,{children:s.jsx(u6,{children:a?.title})}),s.jsx(s6,{children:a?.content}),s.jsx(o6,{children:v?s.jsxs("div",{className:"flex w-full justify-between",children:[v,s.jsxs("div",{className:"space-x-2",children:[g,b]})]}):s.jsxs(s.Fragment,{children:[g,b]})})]})})})}const{Button:Po}=await C("@baseplate-dev/ui-components"),{useState:m6}=await C("react");function pj({className:a,defaultOpen:n,children:l,collapsedContents:o,onRemove:c}){const[d,f]=m6(n);return s.jsx("div",{className:Te("",a),children:d?s.jsxs("div",{className:"border-gray-200 space-y-4 border",children:[s.jsxs("div",{className:"flex flex-row space-x-4",children:[s.jsx(Po,{variant:"link",size:"none",onClick:()=>{f(!1)},children:"Close"}),s.jsx(Po,{variant:"link",size:"none",onClick:c,children:"Remove"})]}),l]}):s.jsxs("div",{className:"flex flex-row items-center space-x-4",children:[s.jsx(Po,{variant:"link",size:"none",onClick:()=>{f(!0)},children:"Edit"}),o,s.jsx(Po,{variant:"link",size:"none",onClick:c,children:"Remove"})]})})}function gj(a){a?localStorage.setItem("projectId",a):localStorage.removeItem("projectId")}function p6(){const a=localStorage.getItem("projectId");if(a)return a;if(globalThis.location.search.includes("projectId=")){const l=new URLSearchParams(globalThis.location.search).get("projectId");if(l)return gj(l),l}return null}const Cn=Cm(a=>({projects:[],projectsLoaded:!1,setProjects:n=>{a(l=>({projects:n,projectsLoaded:!0,...n.some(o=>o.id===l.currentProjectId)?void 0:{currentProjectId:n.length===1?n[0].id:null}}))},currentProjectId:p6(),setCurrentProjectId:n=>{a(l=>({currentProjectId:l.projects.some(o=>o.id===n)?n:null}))},resetCurrentProjectId:()=>{a(n=>({currentProjectId:n.projects.length===1?n.projects[0].id:null}))}})),g6={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{z:uf}=await C("zod"),v6=uf.object({VITE_PREVIEW_MODE:uf.enum(["true","false"]).nullish().transform(a=>a==="true"),VITE_ENABLE_TEMPLATE_EXTRACTOR:uf.enum(["true","false"]).nullish().transform(a=>a==="true")}),vj=v6.parse(g6),Fn=vj.VITE_PREVIEW_MODE,bj=vj.VITE_ENABLE_TEMPLATE_EXTRACTOR;function b6(a){return typeof a=="string"?new TextEncoder().encode(a):a}async function yj(a){const n=b6(a),l=await crypto.subtle.digest("SHA-256",n);return[...new Uint8Array(l)].map(c=>c.toString(16).padStart(2,"0")).join("")}class y6{listenerMap=new Map;eventEmitterAbortController=new AbortController;on(n,l,o){const{signal:c}=o??{},d=this.listenerMap.get(n)??[];this.listenerMap.set(n,[...d,l]);const f=()=>{const p=(this.listenerMap.get(n)??[]).filter(m=>m!==l);p.length>0?this.listenerMap.set(n,p):this.listenerMap.delete(n)};return c?.addEventListener("abort",f,{once:!0}),f}async*onAsync(n,l){const o=[];let c,d=!1;const f=this.eventEmitterAbortController.signal;if(l.signal?.aborted||f.aborted)return;function p(){d=!0,c?.(void 0)}for(l.signal?.addEventListener("abort",p,{once:!0}),f.addEventListener("abort",p,{once:!0}),this.on(n,m=>{c?(c(m),c=void 0):o.push(m)},{signal:l.signal});!d;){const m=o.shift()??await new Promise(g=>{c=g});if(d)break;yield m}}emit(n,l){const o=this.listenerMap.get(n)??[];for(const c of o)c(l)}clearListeners(){this.listenerMap.clear(),this.eventEmitterAbortController.abort()}abortEventEmitter(){this.eventEmitterAbortController.abort()}}function x6(){return new y6}function j6(a,n){let l=a[0],o=-1/0;for(let c=0;c<a.length;c++){const d=a[c],f=n(d);f>o&&(o=f,l=d)}return l}const S6=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function w6(a){return Array.from(a.match(S6)??[])}function Fl(a){const n=w6(a);if(n.length===0)return"";const[l,...o]=n;return`${l.toLowerCase()}${o.map(c=>a4(c)).join("")}`}function wb(a){return a.substring(0,1).toUpperCase()+a.substring(1)}function C6(a){return a instanceof Wt}function Cb({maxAttempts:a=5}){return()=>({op:n,next:l})=>pa(o=>{let c=null,d=a,f=!1;function p(){c?.unsubscribe(),c=l(n).subscribe({error(m){m.message.includes("Failed to execute")&&d!==0?(d--,setTimeout(p,500)):o.error(m)},next(m){o.next(m)},complete(){f&&o.complete()}})}return p(),()=>{f=!0,c?.unsubscribe()}})}const Um=x6(),E6=kE({url:`${globalThis.location.origin.replace(/^http/,"ws")}/trpc`,onOpen(){Um.emit("open",void 0)}}),Lt=mE({links:[AE({condition:a=>a.type==="subscription",true:[ME({enabled:a=>a.direction==="down"&&a.result instanceof Error}),Cb({}),IE({client:E6})],false:[Cb({maxAttempts:10}),DE({url:"/trpc"})]})]}),{toast:D6}=await C("@baseplate-dev/ui-components"),{useEffect:df,useRef:ko,useState:T6}=await C("react"),xj=({className:a})=>{const[n,l]=T6(""),o=ko(!0),c=ko(null),d=ko(null),{currentProjectId:f}=Cn();df(()=>{f&&(Fn||Lt.sync.getCurrentSyncConsoleOutput.query({id:f}).then(g=>{l(v=>{const b=g.join(`
|
|
60
|
+
`);return v===b?v:v?`${b}
|
|
61
|
+
${v}`:b})}).catch(g=>{D6.error(Gl(g,"Error loading sync console output"))}))},[f]),df(()=>{if(!f)return;const g=Lt.sync.onConsoleEmitted.subscribe({id:f},{onData:b=>{l(x=>x?`${x}
|
|
62
|
+
${b.message}`:b.message)}}),v=Lt.sync.onSyncStarted.subscribe({id:f},{onData:()=>{l("")}});return()=>{g.unsubscribe(),v.unsubscribe()}},[f]),df(()=>{o.current&&d.current?.scrollIntoView({behavior:"smooth"})},[n]);const p=ko(0),m=g=>{const v=c.current;p.current>g.currentTarget.scrollTop?o.current=!1:v&&v.scrollHeight-v.scrollTop-v.clientHeight<1&&(o.current=!0),p.current=g.currentTarget.scrollTop};return s.jsxs("code",{className:Te("border-gray-200 bg-slate-900 text-neutral-400 block h-72 w-full overflow-y-scroll border p-4 text-sm break-words whitespace-pre-wrap shadow-inner",a),ref:c,onScroll:m,children:[s.jsx(i6,{text:n}),s.jsx("div",{ref:d})]})};xj.displayName="Console";const{Alert:R6,Button:N6,Dialog:M6,DialogContent:A6,DialogHeader:$6,DialogTitle:L6,FormItem:O6,FormLabel:U6,FormMessage:z6}=await C("@baseplate-dev/ui-components"),{useState:B6}=await C("react");function ms({className:a,onChange:n,renderTable:l,renderForm:o,value:c,itemName:d,defaultValue:f={}}){const[p,m]=B6(),g=c??[],v=b=>{p?.idx===void 0?n([...g,b]):n(g.map((x,j)=>j===p.idx?b:x)),m(void 0)};return s.jsxs("div",{className:Te("space-y-2",a),children:[s.jsx(N6,{size:"sm",onClick:()=>{m({data:f})},children:"Add Item"}),g.length>0?l({items:g,edit:b=>{m({idx:b,data:g[b]})},remove:b=>{n(g.filter((x,j)=>j!==b))}}):s.jsx(R6,{variant:"default",children:"No items currently"}),s.jsx(M6,{open:!!p,onOpenChange:b=>{b||m(void 0)},children:s.jsxs(A6,{"aria-describedby":void 0,children:[s.jsx($6,{children:s.jsxs(L6,{children:["Edit ",d??"Item"]})}),o({initialData:p?.data,onSubmit:v})]})})]})}ms.Labelled=function({label:n,className:l,error:o,...c}){return s.jsx("div",{className:Te("",l),children:s.jsxs(O6,{className:l,children:[n&&s.jsx(U6,{children:n}),s.jsx(ms,{...c}),s.jsx(z6,{children:o})]})})};ms.LabelledController=function({control:n,name:l,...o}){const{field:c,fieldState:{error:d}}=fa({name:l,control:n});return s.jsx(ms.Labelled,{...o,error:d?.message,onChange:f=>{c.onChange(f)},value:c.value})};const{Button:_6,ErrorDisplay:F6}=await C("@baseplate-dev/ui-components");function zc(){const a=on();return s.jsx(F6,{className:"flex-1",header:"Page not found",error:"Sorry, we were unable to find the page you were looking for.",actions:s.jsx(_6,{onClick:()=>{a("/")},children:"Back to Home"})})}const{useMemo:q6}=await C("react"),jj=Cm(a=>({dialogOptions:void 0,setDialogOptions:n=>{a({dialogOptions:n})}}));function Sj(){const a=jj(n=>n.setDialogOptions);return q6(()=>({showRefIssues:n=>{a(n)},clearRefIssues:()=>{a(void 0)}}),[a])}const{useEffect:H6,useRef:P6}=await C("react");function zm(a){const n=P6(void 0);return H6(()=>{n.current=a},[a]),n.current}const wj={};function k6(a,n){const l=wj[n.type.name];if(!l)return;const o=n.parentPath?.join("."),c=o?a.entities.find(d=>d.idPath.join(".")===o):void 0;return l.replace("{id}",n.id).replace("{key}",n.type.keyFromId(n.id)).replace("{parentId}",c?.id??"").replace("{parentKey}",c?.type.keyFromId(c.id)??"")}function js(a,n){wj[a.name]=n}const{useProjectDefinition:I6}=await C("@baseplate-dev/project-builder-lib/web"),{Button:V6,Dialog:G6,DialogContent:Y6,DialogDescription:X6,DialogFooter:Q6,DialogHeader:K6,DialogTitle:Z6,Table:W6,TableBody:J6,TableCell:ff,TableHead:hf,TableHeader:e5,TableRow:Eb}=await C("@baseplate-dev/ui-components");function t5(){const{dialogOptions:a,setDialogOptions:n}=jj(),{definitionContainer:l}=I6(),{entities:o}=l,c=zm(a),{issues:d}=a??c??{};return s.jsx(G6,{open:!!a,onOpenChange:()=>{n(void 0)},children:s.jsxs(Y6,{width:"lg",children:[s.jsx(K6,{children:s.jsx(Z6,{children:"Unable to delete"})}),s.jsx(X6,{children:"There were other references that needed to be fixed before you could delete this item."}),s.jsxs(W6,{children:[s.jsx(e5,{children:s.jsxs(Eb,{children:[s.jsx(hf,{children:"Entity"}),s.jsx(hf,{children:"Path"}),s.jsx(hf,{children:"Referenced Entity"})]})}),s.jsx(J6,{children:d?.map(f=>{const p=o.find(x=>x.id===f.entityId),m=f.ref.path.join(".");let g;for(const x of o){const j=x.path.join(".");m.startsWith(j)&&(!g||g.path.length<j.length)&&(g=x)}const v=g?m.slice(Math.max(0,g.path.join(".").length+1)):m,b=g?k6(l,g):void 0;return s.jsxs(Eb,{children:[s.jsx(ff,{children:g?s.jsxs("div",{className:"text-style-prose",children:[s.jsx("div",{children:b?s.jsx(Sn,{to:b,onClick:()=>{n(void 0)},children:s.jsx("strong",{children:g.name})}):s.jsx("strong",{children:g.name})}),s.jsx("div",{className:"text-muted-foreground",children:g.type.name})]}):s.jsx("strong",{children:"Root"})}),s.jsx(ff,{children:v}),s.jsx(ff,{children:p?s.jsxs("div",{children:[s.jsx("div",{children:p.name}),s.jsx("div",{className:"text-muted-foreground",children:p.type.name})]}):""})]},m)})})]}),s.jsx(Q6,{children:s.jsx(V6,{onClick:()=>{n(void 0)},children:"OK"})})]})})}const{useMemo:Bm,useLayoutEffect:n5,useEffect:Cj,useRef:Xl,useCallback:yc}=await C("react");function a5(){for(var a=arguments.length,n=new Array(a),l=0;l<a;l++)n[l]=arguments[l];return Bm(()=>o=>{n.forEach(c=>c(o))},n)}const Bc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ql(a){const n=Object.prototype.toString.call(a);return n==="[object Window]"||n==="[object global]"}function _m(a){return"nodeType"in a}function cn(a){var n,l;return a?Ql(a)?a:_m(a)&&(n=(l=a.ownerDocument)==null?void 0:l.defaultView)!=null?n:window:window}function Fm(a){const{Document:n}=cn(a);return a instanceof n}function Ss(a){return Ql(a)?!1:a instanceof cn(a).HTMLElement}function Ej(a){return a instanceof cn(a).SVGElement}function Kl(a){return a?Ql(a)?a.document:_m(a)?Fm(a)?a:Ss(a)||Ej(a)?a.ownerDocument:document:document:document}const ha=Bc?n5:Cj;function qm(a){const n=Xl(a);return ha(()=>{n.current=a}),yc(function(){for(var l=arguments.length,o=new Array(l),c=0;c<l;c++)o[c]=arguments[c];return n.current==null?void 0:n.current(...o)},[])}function i5(){const a=Xl(null),n=yc((o,c)=>{a.current=setInterval(o,c)},[]),l=yc(()=>{a.current!==null&&(clearInterval(a.current),a.current=null)},[]);return[n,l]}function ps(a,n){n===void 0&&(n=[a]);const l=Xl(a);return ha(()=>{l.current!==a&&(l.current=a)},n),l}function ws(a,n){const l=Xl();return Bm(()=>{const o=a(l.current);return l.current=o,o},[...n])}function xc(a){const n=qm(a),l=Xl(null),o=yc(c=>{c!==l.current&&n?.(c,l.current),l.current=c},[]);return[l,o]}function dm(a){const n=Xl();return Cj(()=>{n.current=a},[a]),n.current}let mf={};function Cs(a,n){return Bm(()=>{if(n)return n;const l=mf[a]==null?0:mf[a]+1;return mf[a]=l,a+"-"+l},[a,n])}function Dj(a){return function(n){for(var l=arguments.length,o=new Array(l>1?l-1:0),c=1;c<l;c++)o[c-1]=arguments[c];return o.reduce((d,f)=>{const p=Object.entries(f);for(const[m,g]of p){const v=d[m];v!=null&&(d[m]=v+a*g)}return d},{...n})}}const ql=Dj(1),jc=Dj(-1);function l5(a){return"clientX"in a&&"clientY"in a}function Hm(a){if(!a)return!1;const{KeyboardEvent:n}=cn(a.target);return n&&a instanceof n}function r5(a){if(!a)return!1;const{TouchEvent:n}=cn(a.target);return n&&a instanceof n}function fm(a){if(r5(a)){if(a.touches&&a.touches.length){const{clientX:n,clientY:l}=a.touches[0];return{x:n,y:l}}else if(a.changedTouches&&a.changedTouches.length){const{clientX:n,clientY:l}=a.changedTouches[0];return{x:n,y:l}}}return l5(a)?{x:a.clientX,y:a.clientY}:null}const gs=Object.freeze({Translate:{toString(a){if(!a)return;const{x:n,y:l}=a;return"translate3d("+(n?Math.round(n):0)+"px, "+(l?Math.round(l):0)+"px, 0)"}},Scale:{toString(a){if(!a)return;const{scaleX:n,scaleY:l}=a;return"scaleX("+n+") scaleY("+l+")"}},Transform:{toString(a){if(a)return[gs.Translate.toString(a),gs.Scale.toString(a)].join(" ")}},Transition:{toString(a){let{property:n,duration:l,easing:o}=a;return n+" "+l+"ms "+o}}}),Db="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function s5(a){return a.matches(Db)?a:a.querySelector(Db)}const Pm=await C("react"),{useState:o5,useCallback:c5}=Pm,u5={display:"none"};function d5(a){let{id:n,value:l}=a;return Pm.createElement("div",{id:n,style:u5},l)}function f5(a){let{id:n,announcement:l,ariaLiveType:o="assertive"}=a;const c={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Pm.createElement("div",{id:n,style:c,role:"status","aria-live":o,"aria-atomic":!0},l)}function h5(){const[a,n]=o5("");return{announce:c5(o=>{o!=null&&n(o)},[]),announcement:a}}const Gn=await C("react"),{createContext:Es,useContext:Il,useEffect:xt,useState:Yn,useCallback:Qn,useMemo:qt,useRef:Pt,memo:m5,useReducer:p5,cloneElement:JB,forwardRef:e_}=Gn,{createPortal:g5,unstable_batchedUpdates:Io}=await C("react-dom"),Tj=Es(null);function v5(a){const n=Il(Tj);xt(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(a)},[a,n])}function b5(){const[a]=Yn(()=>new Set),n=Qn(o=>(a.add(o),()=>a.delete(o)),[a]);return[Qn(o=>{let{type:c,event:d}=o;a.forEach(f=>{var p;return(p=f[c])==null?void 0:p.call(f,d)})},[a]),n]}const y5={draggable:`
|
|
63
|
+
To pick up a draggable item, press the space bar.
|
|
64
|
+
While dragging, use the arrow keys to move the item.
|
|
65
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
66
|
+
`},x5={onDragStart(a){let{active:n}=a;return"Picked up draggable item "+n.id+"."},onDragOver(a){let{active:n,over:l}=a;return l?"Draggable item "+n.id+" was moved over droppable area "+l.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(a){let{active:n,over:l}=a;return l?"Draggable item "+n.id+" was dropped over droppable area "+l.id:"Draggable item "+n.id+" was dropped."},onDragCancel(a){let{active:n}=a;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function j5(a){let{announcements:n=x5,container:l,hiddenTextDescribedById:o,screenReaderInstructions:c=y5}=a;const{announce:d,announcement:f}=h5(),p=Cs("DndLiveRegion"),[m,g]=Yn(!1);if(xt(()=>{g(!0)},[]),v5(qt(()=>({onDragStart(b){let{active:x}=b;d(n.onDragStart({active:x}))},onDragMove(b){let{active:x,over:j}=b;n.onDragMove&&d(n.onDragMove({active:x,over:j}))},onDragOver(b){let{active:x,over:j}=b;d(n.onDragOver({active:x,over:j}))},onDragEnd(b){let{active:x,over:j}=b;d(n.onDragEnd({active:x,over:j}))},onDragCancel(b){let{active:x,over:j}=b;d(n.onDragCancel({active:x,over:j}))}}),[d,n])),!m)return null;const v=Gn.createElement(Gn.Fragment,null,Gn.createElement(d5,{id:o,value:c.draggable}),Gn.createElement(f5,{id:p,announcement:f}));return l?g5(v,l):v}var Et;(function(a){a.DragStart="dragStart",a.DragMove="dragMove",a.DragEnd="dragEnd",a.DragCancel="dragCancel",a.DragOver="dragOver",a.RegisterDroppable="registerDroppable",a.SetDroppableDisabled="setDroppableDisabled",a.UnregisterDroppable="unregisterDroppable"})(Et||(Et={}));function Sc(){}const Kn=Object.freeze({x:0,y:0});function S5(a,n){return Math.sqrt(Math.pow(a.x-n.x,2)+Math.pow(a.y-n.y,2))}function w5(a,n){let{data:{value:l}}=a,{data:{value:o}}=n;return l-o}function C5(a,n){let{data:{value:l}}=a,{data:{value:o}}=n;return o-l}function E5(a,n){if(!a||a.length===0)return null;const[l]=a;return l[n]}function Tb(a,n,l){return n===void 0&&(n=a.left),l===void 0&&(l=a.top),{x:n+a.width*.5,y:l+a.height*.5}}const D5=a=>{let{collisionRect:n,droppableRects:l,droppableContainers:o}=a;const c=Tb(n,n.left,n.top),d=[];for(const f of o){const{id:p}=f,m=l.get(p);if(m){const g=S5(Tb(m),c);d.push({id:p,data:{droppableContainer:f,value:g}})}}return d.sort(w5)};function T5(a,n){const l=Math.max(n.top,a.top),o=Math.max(n.left,a.left),c=Math.min(n.left+n.width,a.left+a.width),d=Math.min(n.top+n.height,a.top+a.height),f=c-o,p=d-l;if(o<c&&l<d){const m=n.width*n.height,g=a.width*a.height,v=f*p,b=v/(m+g-v);return Number(b.toFixed(4))}return 0}const R5=a=>{let{collisionRect:n,droppableRects:l,droppableContainers:o}=a;const c=[];for(const d of o){const{id:f}=d,p=l.get(f);if(p){const m=T5(p,n);m>0&&c.push({id:f,data:{droppableContainer:d,value:m}})}}return c.sort(C5)};function N5(a,n,l){return{...a,scaleX:n&&l?n.width/l.width:1,scaleY:n&&l?n.height/l.height:1}}function Rj(a,n){return a&&n?{x:a.left-n.left,y:a.top-n.top}:Kn}function M5(a){return function(l){for(var o=arguments.length,c=new Array(o>1?o-1:0),d=1;d<o;d++)c[d-1]=arguments[d];return c.reduce((f,p)=>({...f,top:f.top+a*p.y,bottom:f.bottom+a*p.y,left:f.left+a*p.x,right:f.right+a*p.x}),{...l})}}const A5=M5(1);function $5(a){if(a.startsWith("matrix3d(")){const n=a.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(a.startsWith("matrix(")){const n=a.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function L5(a,n,l){const o=$5(n);if(!o)return a;const{scaleX:c,scaleY:d,x:f,y:p}=o,m=a.left-f-(1-c)*parseFloat(l),g=a.top-p-(1-d)*parseFloat(l.slice(l.indexOf(" ")+1)),v=c?a.width/c:a.width,b=d?a.height/d:a.height;return{width:v,height:b,top:g,right:m+v,bottom:g+b,left:m}}const O5={ignoreTransform:!1};function Zl(a,n){n===void 0&&(n=O5);let l=a.getBoundingClientRect();if(n.ignoreTransform){const{transform:g,transformOrigin:v}=cn(a).getComputedStyle(a);g&&(l=L5(l,g,v))}const{top:o,left:c,width:d,height:f,bottom:p,right:m}=l;return{top:o,left:c,width:d,height:f,bottom:p,right:m}}function Rb(a){return Zl(a,{ignoreTransform:!0})}function U5(a){const n=a.innerWidth,l=a.innerHeight;return{top:0,left:0,right:n,bottom:l,width:n,height:l}}function z5(a,n){return n===void 0&&(n=cn(a).getComputedStyle(a)),n.position==="fixed"}function B5(a,n){n===void 0&&(n=cn(a).getComputedStyle(a));const l=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(c=>{const d=n[c];return typeof d=="string"?l.test(d):!1})}function km(a,n){const l=[];function o(c){if(n!=null&&l.length>=n||!c)return l;if(Fm(c)&&c.scrollingElement!=null&&!l.includes(c.scrollingElement))return l.push(c.scrollingElement),l;if(!Ss(c)||Ej(c)||l.includes(c))return l;const d=cn(a).getComputedStyle(c);return c!==a&&B5(c,d)&&l.push(c),z5(c,d)?l:o(c.parentNode)}return a?o(a):l}function Nj(a){const[n]=km(a,1);return n??null}function pf(a){return!Bc||!a?null:Ql(a)?a:_m(a)?Fm(a)||a===Kl(a).scrollingElement?window:Ss(a)?a:null:null}function Mj(a){return Ql(a)?a.scrollX:a.scrollLeft}function Aj(a){return Ql(a)?a.scrollY:a.scrollTop}function hm(a){return{x:Mj(a),y:Aj(a)}}var $t;(function(a){a[a.Forward=1]="Forward",a[a.Backward=-1]="Backward"})($t||($t={}));function $j(a){return!Bc||!a?!1:a===document.scrollingElement}function Lj(a){const n={x:0,y:0},l=$j(a)?{height:window.innerHeight,width:window.innerWidth}:{height:a.clientHeight,width:a.clientWidth},o={x:a.scrollWidth-l.width,y:a.scrollHeight-l.height},c=a.scrollTop<=n.y,d=a.scrollLeft<=n.x,f=a.scrollTop>=o.y,p=a.scrollLeft>=o.x;return{isTop:c,isLeft:d,isBottom:f,isRight:p,maxScroll:o,minScroll:n}}const _5={x:.2,y:.2};function F5(a,n,l,o,c){let{top:d,left:f,right:p,bottom:m}=l;o===void 0&&(o=10),c===void 0&&(c=_5);const{isTop:g,isBottom:v,isLeft:b,isRight:x}=Lj(a),j={x:0,y:0},D={x:0,y:0},S={height:n.height*c.y,width:n.width*c.x};return!g&&d<=n.top+S.height?(j.y=$t.Backward,D.y=o*Math.abs((n.top+S.height-d)/S.height)):!v&&m>=n.bottom-S.height&&(j.y=$t.Forward,D.y=o*Math.abs((n.bottom-S.height-m)/S.height)),!x&&p>=n.right-S.width?(j.x=$t.Forward,D.x=o*Math.abs((n.right-S.width-p)/S.width)):!b&&f<=n.left+S.width&&(j.x=$t.Backward,D.x=o*Math.abs((n.left+S.width-f)/S.width)),{direction:j,speed:D}}function q5(a){if(a===document.scrollingElement){const{innerWidth:d,innerHeight:f}=window;return{top:0,left:0,right:d,bottom:f,width:d,height:f}}const{top:n,left:l,right:o,bottom:c}=a.getBoundingClientRect();return{top:n,left:l,right:o,bottom:c,width:a.clientWidth,height:a.clientHeight}}function Oj(a){return a.reduce((n,l)=>ql(n,hm(l)),Kn)}function H5(a){return a.reduce((n,l)=>n+Mj(l),0)}function P5(a){return a.reduce((n,l)=>n+Aj(l),0)}function k5(a,n){if(n===void 0&&(n=Zl),!a)return;const{top:l,left:o,bottom:c,right:d}=n(a);Nj(a)&&(c<=0||d<=0||l>=window.innerHeight||o>=window.innerWidth)&&a.scrollIntoView({block:"center",inline:"center"})}const I5=[["x",["left","right"],H5],["y",["top","bottom"],P5]];class Im{constructor(n,l){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=km(l),c=Oj(o);this.rect={...n},this.width=n.width,this.height=n.height;for(const[d,f,p]of I5)for(const m of f)Object.defineProperty(this,m,{get:()=>{const g=p(o),v=c[d]-g;return this.rect[m]+v},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class is{constructor(n){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(l=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...l)})},this.target=n}add(n,l,o){var c;(c=this.target)==null||c.addEventListener(n,l,o),this.listeners.push([n,l,o])}}function V5(a){const{EventTarget:n}=cn(a);return a instanceof n?a:Kl(a)}function gf(a,n){const l=Math.abs(a.x),o=Math.abs(a.y);return typeof n=="number"?Math.sqrt(l**2+o**2)>n:"x"in n&&"y"in n?l>n.x&&o>n.y:"x"in n?l>n.x:"y"in n?o>n.y:!1}var _n;(function(a){a.Click="click",a.DragStart="dragstart",a.Keydown="keydown",a.ContextMenu="contextmenu",a.Resize="resize",a.SelectionChange="selectionchange",a.VisibilityChange="visibilitychange"})(_n||(_n={}));function Nb(a){a.preventDefault()}function G5(a){a.stopPropagation()}var Pe;(function(a){a.Space="Space",a.Down="ArrowDown",a.Right="ArrowRight",a.Left="ArrowLeft",a.Up="ArrowUp",a.Esc="Escape",a.Enter="Enter",a.Tab="Tab"})(Pe||(Pe={}));const Uj={start:[Pe.Space,Pe.Enter],cancel:[Pe.Esc],end:[Pe.Space,Pe.Enter,Pe.Tab]},Y5=(a,n)=>{let{currentCoordinates:l}=n;switch(a.code){case Pe.Right:return{...l,x:l.x+25};case Pe.Left:return{...l,x:l.x-25};case Pe.Down:return{...l,y:l.y+25};case Pe.Up:return{...l,y:l.y-25}}};class zj{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:l}}=n;this.props=n,this.listeners=new is(Kl(l)),this.windowListeners=new is(cn(l)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(_n.Resize,this.handleCancel),this.windowListeners.add(_n.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(_n.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:l}=this.props,o=n.node.current;o&&k5(o),l(Kn)}handleKeyDown(n){if(Hm(n)){const{active:l,context:o,options:c}=this.props,{keyboardCodes:d=Uj,coordinateGetter:f=Y5,scrollBehavior:p="smooth"}=c,{code:m}=n;if(d.end.includes(m)){this.handleEnd(n);return}if(d.cancel.includes(m)){this.handleCancel(n);return}const{collisionRect:g}=o.current,v=g?{x:g.left,y:g.top}:Kn;this.referenceCoordinates||(this.referenceCoordinates=v);const b=f(n,{active:l,context:o.current,currentCoordinates:v});if(b){const x=jc(b,v),j={x:0,y:0},{scrollableAncestors:D}=o.current;for(const S of D){const R=n.code,{isTop:E,isRight:A,isLeft:B,isBottom:H,maxScroll:V,minScroll:K}=Lj(S),T=q5(S),O={x:Math.min(R===Pe.Right?T.right-T.width/2:T.right,Math.max(R===Pe.Right?T.left:T.left+T.width/2,b.x)),y:Math.min(R===Pe.Down?T.bottom-T.height/2:T.bottom,Math.max(R===Pe.Down?T.top:T.top+T.height/2,b.y))},Q=R===Pe.Right&&!A||R===Pe.Left&&!B,te=R===Pe.Down&&!H||R===Pe.Up&&!E;if(Q&&O.x!==b.x){const ae=S.scrollLeft+x.x,se=R===Pe.Right&&ae<=V.x||R===Pe.Left&&ae>=K.x;if(se&&!x.y){S.scrollTo({left:ae,behavior:p});return}se?j.x=S.scrollLeft-ae:j.x=R===Pe.Right?S.scrollLeft-V.x:S.scrollLeft-K.x,j.x&&S.scrollBy({left:-j.x,behavior:p});break}else if(te&&O.y!==b.y){const ae=S.scrollTop+x.y,se=R===Pe.Down&&ae<=V.y||R===Pe.Up&&ae>=K.y;if(se&&!x.x){S.scrollTo({top:ae,behavior:p});return}se?j.y=S.scrollTop-ae:j.y=R===Pe.Down?S.scrollTop-V.y:S.scrollTop-K.y,j.y&&S.scrollBy({top:-j.y,behavior:p});break}}this.handleMove(n,ql(jc(b,this.referenceCoordinates),j))}}}handleMove(n,l){const{onMove:o}=this.props;n.preventDefault(),o(l)}handleEnd(n){const{onEnd:l}=this.props;n.preventDefault(),this.detach(),l()}handleCancel(n){const{onCancel:l}=this.props;n.preventDefault(),this.detach(),l()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}zj.activators=[{eventName:"onKeyDown",handler:(a,n,l)=>{let{keyboardCodes:o=Uj,onActivation:c}=n,{active:d}=l;const{code:f}=a.nativeEvent;if(o.start.includes(f)){const p=d.activatorNode.current;return p&&a.target!==p?!1:(a.preventDefault(),c?.({event:a.nativeEvent}),!0)}return!1}}];function Mb(a){return!!(a&&"distance"in a)}function Ab(a){return!!(a&&"delay"in a)}class Vm{constructor(n,l,o){var c;o===void 0&&(o=V5(n.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=n,this.events=l;const{event:d}=n,{target:f}=d;this.props=n,this.events=l,this.document=Kl(f),this.documentListeners=new is(this.document),this.listeners=new is(o),this.windowListeners=new is(cn(f)),this.initialCoordinates=(c=fm(d))!=null?c:Kn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:n,props:{options:{activationConstraint:l,bypassActivationConstraint:o}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(_n.Resize,this.handleCancel),this.windowListeners.add(_n.DragStart,Nb),this.windowListeners.add(_n.VisibilityChange,this.handleCancel),this.windowListeners.add(_n.ContextMenu,Nb),this.documentListeners.add(_n.Keydown,this.handleKeydown),l){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ab(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(Mb(l)){this.handlePending(l);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(n,l){const{active:o,onPending:c}=this.props;c(o,n,this.initialCoordinates,l)}handleStart(){const{initialCoordinates:n}=this,{onStart:l}=this.props;n&&(this.activated=!0,this.documentListeners.add(_n.Click,G5,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(_n.SelectionChange,this.removeTextSelection),l(n))}handleMove(n){var l;const{activated:o,initialCoordinates:c,props:d}=this,{onMove:f,options:{activationConstraint:p}}=d;if(!c)return;const m=(l=fm(n))!=null?l:Kn,g=jc(c,m);if(!o&&p){if(Mb(p)){if(p.tolerance!=null&&gf(g,p.tolerance))return this.handleCancel();if(gf(g,p.distance))return this.handleStart()}if(Ab(p)&&gf(g,p.tolerance))return this.handleCancel();this.handlePending(p,g);return}n.cancelable&&n.preventDefault(),f(m)}handleEnd(){const{onAbort:n,onEnd:l}=this.props;this.detach(),this.activated||n(this.props.active),l()}handleCancel(){const{onAbort:n,onCancel:l}=this.props;this.detach(),this.activated||n(this.props.active),l()}handleKeydown(n){n.code===Pe.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const X5={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Bj extends Vm{constructor(n){const{event:l}=n,o=Kl(l.target);super(n,X5,o)}}Bj.activators=[{eventName:"onPointerDown",handler:(a,n)=>{let{nativeEvent:l}=a,{onActivation:o}=n;return!l.isPrimary||l.button!==0?!1:(o?.({event:l}),!0)}}];const Q5={move:{name:"mousemove"},end:{name:"mouseup"}};var mm;(function(a){a[a.RightClick=2]="RightClick"})(mm||(mm={}));class K5 extends Vm{constructor(n){super(n,Q5,Kl(n.event.target))}}K5.activators=[{eventName:"onMouseDown",handler:(a,n)=>{let{nativeEvent:l}=a,{onActivation:o}=n;return l.button===mm.RightClick?!1:(o?.({event:l}),!0)}}];const vf={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Z5 extends Vm{constructor(n){super(n,vf)}static setup(){return window.addEventListener(vf.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(vf.move.name,n)};function n(){}}}Z5.activators=[{eventName:"onTouchStart",handler:(a,n)=>{let{nativeEvent:l}=a,{onActivation:o}=n;const{touches:c}=l;return c.length>1?!1:(o?.({event:l}),!0)}}];var ls;(function(a){a[a.Pointer=0]="Pointer",a[a.DraggableRect=1]="DraggableRect"})(ls||(ls={}));var wc;(function(a){a[a.TreeOrder=0]="TreeOrder",a[a.ReversedTreeOrder=1]="ReversedTreeOrder"})(wc||(wc={}));function W5(a){let{acceleration:n,activator:l=ls.Pointer,canScroll:o,draggingRect:c,enabled:d,interval:f=5,order:p=wc.TreeOrder,pointerCoordinates:m,scrollableAncestors:g,scrollableAncestorRects:v,delta:b,threshold:x}=a;const j=e3({delta:b,disabled:!d}),[D,S]=i5(),R=Pt({x:0,y:0}),E=Pt({x:0,y:0}),A=qt(()=>{switch(l){case ls.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case ls.DraggableRect:return c}},[l,c,m]),B=Pt(null),H=Qn(()=>{const K=B.current;if(!K)return;const T=R.current.x*E.current.x,O=R.current.y*E.current.y;K.scrollBy(T,O)},[]),V=qt(()=>p===wc.TreeOrder?[...g].reverse():g,[p,g]);xt(()=>{if(!d||!g.length||!A){S();return}for(const K of V){if(o?.(K)===!1)continue;const T=g.indexOf(K),O=v[T];if(!O)continue;const{direction:Q,speed:te}=F5(K,O,A,n,x);for(const ae of["x","y"])j[ae][Q[ae]]||(te[ae]=0,Q[ae]=0);if(te.x>0||te.y>0){S(),B.current=K,D(H,f),R.current=te,E.current=Q;return}}R.current={x:0,y:0},E.current={x:0,y:0},S()},[n,H,o,S,d,f,JSON.stringify(A),JSON.stringify(j),D,g,V,v,JSON.stringify(x)])}const J5={x:{[$t.Backward]:!1,[$t.Forward]:!1},y:{[$t.Backward]:!1,[$t.Forward]:!1}};function e3(a){let{delta:n,disabled:l}=a;const o=dm(n);return ws(c=>{if(l||!o||!c)return J5;const d={x:Math.sign(n.x-o.x),y:Math.sign(n.y-o.y)};return{x:{[$t.Backward]:c.x[$t.Backward]||d.x===-1,[$t.Forward]:c.x[$t.Forward]||d.x===1},y:{[$t.Backward]:c.y[$t.Backward]||d.y===-1,[$t.Forward]:c.y[$t.Forward]||d.y===1}}},[l,n,o])}function t3(a,n){const l=n!=null?a.get(n):void 0,o=l?l.node.current:null;return ws(c=>{var d;return n==null?null:(d=o??c)!=null?d:null},[o,n])}function n3(a,n){return qt(()=>a.reduce((l,o)=>{const{sensor:c}=o,d=c.activators.map(f=>({eventName:f.eventName,handler:n(f.handler,o)}));return[...l,...d]},[]),[a,n])}var vs;(function(a){a[a.Always=0]="Always",a[a.BeforeDragging=1]="BeforeDragging",a[a.WhileDragging=2]="WhileDragging"})(vs||(vs={}));var pm;(function(a){a.Optimized="optimized"})(pm||(pm={}));const $b=new Map;function a3(a,n){let{dragging:l,dependencies:o,config:c}=n;const[d,f]=Yn(null),{frequency:p,measure:m,strategy:g}=c,v=Pt(a),b=R(),x=ps(b),j=Qn(function(E){E===void 0&&(E=[]),!x.current&&f(A=>A===null?E:A.concat(E.filter(B=>!A.includes(B))))},[x]),D=Pt(null),S=ws(E=>{if(b&&!l)return $b;if(!E||E===$b||v.current!==a||d!=null){const A=new Map;for(let B of a){if(!B)continue;if(d&&d.length>0&&!d.includes(B.id)&&B.rect.current){A.set(B.id,B.rect.current);continue}const H=B.node.current,V=H?new Im(m(H),H):null;B.rect.current=V,V&&A.set(B.id,V)}return A}return E},[a,d,l,b,m]);return xt(()=>{v.current=a},[a]),xt(()=>{b||j()},[l,b]),xt(()=>{d&&d.length>0&&f(null)},[JSON.stringify(d)]),xt(()=>{b||typeof p!="number"||D.current!==null||(D.current=setTimeout(()=>{j(),D.current=null},p))},[p,b,j,...o]),{droppableRects:S,measureDroppableContainers:j,measuringScheduled:d!=null};function R(){switch(g){case vs.Always:return!1;case vs.BeforeDragging:return l;default:return!l}}}function _j(a,n){return ws(l=>a?l||(typeof n=="function"?n(a):a):null,[n,a])}function i3(a,n){return _j(a,n)}function l3(a){let{callback:n,disabled:l}=a;const o=qm(n),c=qt(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:d}=window;return new d(o)},[o,l]);return xt(()=>()=>c?.disconnect(),[c]),c}function _c(a){let{callback:n,disabled:l}=a;const o=qm(n),c=qt(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:d}=window;return new d(o)},[l]);return xt(()=>()=>c?.disconnect(),[c]),c}function r3(a){return new Im(Zl(a),a)}function Lb(a,n,l){n===void 0&&(n=r3);const[o,c]=Yn(null);function d(){c(m=>{if(!a)return null;if(a.isConnected===!1){var g;return(g=m??l)!=null?g:null}const v=n(a);return JSON.stringify(m)===JSON.stringify(v)?m:v})}const f=l3({callback(m){if(a)for(const g of m){const{type:v,target:b}=g;if(v==="childList"&&b instanceof HTMLElement&&b.contains(a)){d();break}}}}),p=_c({callback:d});return ha(()=>{d(),a?(p?.observe(a),f?.observe(document.body,{childList:!0,subtree:!0})):(p?.disconnect(),f?.disconnect())},[a]),o}function s3(a){const n=_j(a);return Rj(a,n)}const Ob=[];function o3(a){const n=Pt(a),l=ws(o=>a?o&&o!==Ob&&a&&n.current&&a.parentNode===n.current.parentNode?o:km(a):Ob,[a]);return xt(()=>{n.current=a},[a]),l}function c3(a){const[n,l]=Yn(null),o=Pt(a),c=Qn(d=>{const f=pf(d.target);f&&l(p=>p?(p.set(f,hm(f)),new Map(p)):null)},[]);return xt(()=>{const d=o.current;if(a!==d){f(d);const p=a.map(m=>{const g=pf(m);return g?(g.addEventListener("scroll",c,{passive:!0}),[g,hm(g)]):null}).filter(m=>m!=null);l(p.length?new Map(p):null),o.current=a}return()=>{f(a),f(d)};function f(p){p.forEach(m=>{const g=pf(m);g?.removeEventListener("scroll",c)})}},[c,a]),qt(()=>a.length?n?Array.from(n.values()).reduce((d,f)=>ql(d,f),Kn):Oj(a):Kn,[a,n])}function Ub(a,n){n===void 0&&(n=[]);const l=Pt(null);return xt(()=>{l.current=null},n),xt(()=>{const o=a!==Kn;o&&!l.current&&(l.current=a),!o&&l.current&&(l.current=null)},[a]),l.current?jc(a,l.current):Kn}function u3(a){xt(()=>{if(!Bc)return;const n=a.map(l=>{let{sensor:o}=l;return o.setup==null?void 0:o.setup()});return()=>{for(const l of n)l?.()}},a.map(n=>{let{sensor:l}=n;return l}))}function d3(a,n){return qt(()=>a.reduce((l,o)=>{let{eventName:c,handler:d}=o;return l[c]=f=>{d(f,n)},l},{}),[a,n])}function Fj(a){return qt(()=>a?U5(a):null,[a])}const zb=[];function f3(a,n){n===void 0&&(n=Zl);const[l]=a,o=Fj(l?cn(l):null),[c,d]=Yn(zb);function f(){d(()=>a.length?a.map(m=>$j(m)?o:new Im(n(m),m)):zb)}const p=_c({callback:f});return ha(()=>{p?.disconnect(),f(),a.forEach(m=>p?.observe(m))},[a]),c}function h3(a){if(!a)return null;if(a.children.length>1)return a;const n=a.children[0];return Ss(n)?n:a}function m3(a){let{measure:n}=a;const[l,o]=Yn(null),c=Qn(g=>{for(const{target:v}of g)if(Ss(v)){o(b=>{const x=n(v);return b?{...b,width:x.width,height:x.height}:x});break}},[n]),d=_c({callback:c}),f=Qn(g=>{const v=h3(g);d?.disconnect(),v&&d?.observe(v),o(v?n(v):null)},[n,d]),[p,m]=xc(f);return qt(()=>({nodeRef:p,rect:l,setRef:m}),[l,p,m])}const p3=[{sensor:Bj,options:{}},{sensor:zj,options:{}}],g3={current:{}},gc={draggable:{measure:Rb},droppable:{measure:Rb,strategy:vs.WhileDragging,frequency:pm.Optimized},dragOverlay:{measure:Zl}};class rs extends Map{get(n){var l;return n!=null&&(l=super.get(n))!=null?l:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:l}=n;return!l})}getNodeFor(n){var l,o;return(l=(o=this.get(n))==null?void 0:o.node.current)!=null?l:void 0}}const v3={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new rs,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Sc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:gc,measureDroppableContainers:Sc,windowRect:null,measuringScheduled:!1},b3={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Sc,draggableNodes:new Map,over:null,measureDroppableContainers:Sc},Fc=Es(b3),qj=Es(v3);function y3(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new rs}}}function x3(a,n){switch(n.type){case Et.DragStart:return{...a,draggable:{...a.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case Et.DragMove:return a.draggable.active==null?a:{...a,draggable:{...a.draggable,translate:{x:n.coordinates.x-a.draggable.initialCoordinates.x,y:n.coordinates.y-a.draggable.initialCoordinates.y}}};case Et.DragEnd:case Et.DragCancel:return{...a,draggable:{...a.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Et.RegisterDroppable:{const{element:l}=n,{id:o}=l,c=new rs(a.droppable.containers);return c.set(o,l),{...a,droppable:{...a.droppable,containers:c}}}case Et.SetDroppableDisabled:{const{id:l,key:o,disabled:c}=n,d=a.droppable.containers.get(l);if(!d||o!==d.key)return a;const f=new rs(a.droppable.containers);return f.set(l,{...d,disabled:c}),{...a,droppable:{...a.droppable,containers:f}}}case Et.UnregisterDroppable:{const{id:l,key:o}=n,c=a.droppable.containers.get(l);if(!c||o!==c.key)return a;const d=new rs(a.droppable.containers);return d.delete(l),{...a,droppable:{...a.droppable,containers:d}}}default:return a}}function j3(a){let{disabled:n}=a;const{active:l,activatorEvent:o,draggableNodes:c}=Il(Fc),d=dm(o),f=dm(l?.id);return xt(()=>{if(!n&&!o&&d&&f!=null){if(!Hm(d)||document.activeElement===d.target)return;const p=c.get(f);if(!p)return;const{activatorNode:m,node:g}=p;if(!m.current&&!g.current)return;requestAnimationFrame(()=>{for(const v of[m.current,g.current]){if(!v)continue;const b=s5(v);if(b){b.focus();break}}})}},[o,n,c,f,d]),null}function S3(a,n){let{transform:l,...o}=n;return a!=null&&a.length?a.reduce((c,d)=>d({transform:c,...o}),l):l}function w3(a){return qt(()=>({draggable:{...gc.draggable,...a?.draggable},droppable:{...gc.droppable,...a?.droppable},dragOverlay:{...gc.dragOverlay,...a?.dragOverlay}}),[a?.draggable,a?.droppable,a?.dragOverlay])}function C3(a){let{activeNode:n,measure:l,initialRect:o,config:c=!0}=a;const d=Pt(!1),{x:f,y:p}=typeof c=="boolean"?{x:c,y:c}:c;ha(()=>{if(!f&&!p||!n){d.current=!1;return}if(d.current||!o)return;const g=n?.node.current;if(!g||g.isConnected===!1)return;const v=l(g),b=Rj(v,o);if(f||(b.x=0),p||(b.y=0),d.current=!0,Math.abs(b.x)>0||Math.abs(b.y)>0){const x=Nj(g);x&&x.scrollBy({top:b.y,left:b.x})}},[n,f,p,o,l])}const Hj=Es({...Kn,scaleX:1,scaleY:1});var mi;(function(a){a[a.Uninitialized=0]="Uninitialized",a[a.Initializing=1]="Initializing",a[a.Initialized=2]="Initialized"})(mi||(mi={}));const E3=m5(function(n){var l,o,c,d;let{id:f,accessibility:p,autoScroll:m=!0,children:g,sensors:v=p3,collisionDetection:b=R5,measuring:x,modifiers:j,...D}=n;const S=p5(x3,void 0,y3),[R,E]=S,[A,B]=b5(),[H,V]=Yn(mi.Uninitialized),K=H===mi.Initialized,{draggable:{active:T,nodes:O,translate:Q},droppable:{containers:te}}=R,ae=T!=null?O.get(T):null,se=Pt({initial:null,translated:null}),Ee=qt(()=>{var nt;return T!=null?{id:T,data:(nt=ae?.data)!=null?nt:g3,rect:se}:null},[T,ae]),G=Pt(null),[W,U]=Yn(null),[k,Y]=Yn(null),ne=ps(D,Object.values(D)),re=Cs("DndDescribedBy",f),ge=qt(()=>te.getEnabled(),[te]),ie=w3(x),{droppableRects:ce,measureDroppableContainers:Se,measuringScheduled:je}=a3(ge,{dragging:K,dependencies:[Q.x,Q.y],config:ie.droppable}),Ue=t3(O,T),Ot=qt(()=>k?fm(k):null,[k]),Dt=ja(),Tt=i3(Ue,ie.draggable.measure);C3({activeNode:T!=null?O.get(T):null,config:Dt.layoutShiftCompensation,initialRect:Tt,measure:ie.draggable.measure});const Be=Lb(Ue,ie.draggable.measure,Tt),En=Lb(Ue?Ue.parentElement:null),ke=Pt({activatorEvent:null,active:null,activeNode:Ue,collisionRect:null,collisions:null,droppableRects:ce,draggableNodes:O,draggingNode:null,draggingNodeRect:null,droppableContainers:te,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ut=te.getNodeFor((l=ke.current.over)==null?void 0:l.id),It=m3({measure:ie.dragOverlay.measure}),ea=(o=It.nodeRef.current)!=null?o:Ue,Vt=K?(c=It.rect)!=null?c:Be:null,Yt=!!(It.nodeRef.current&&It.rect),Zi=s3(Yt?null:Be),ga=Fj(ea?cn(ea):null),un=o3(K?Ut??Ue:null),Hn=f3(un),Pa=S3(j,{transform:{x:Q.x-Zi.x,y:Q.y-Zi.y,scaleX:1,scaleY:1},activatorEvent:k,active:Ee,activeNodeRect:Be,containerNodeRect:En,draggingNodeRect:Vt,over:ke.current.over,overlayNodeRect:It.rect,scrollableAncestors:un,scrollableAncestorRects:Hn,windowRect:ga}),yi=Ot?ql(Ot,Q):null,Dn=c3(un),va=Ub(Dn),ta=Ub(Dn,[Be]),rt=ql(Pa,va),st=Vt?A5(Vt,Pa):null,Ve=Ee&&st?b({active:Ee,collisionRect:st,droppableRects:ce,droppableContainers:ge,pointerCoordinates:yi}):null,xi=E5(Ve,"id"),[Xt,Wi]=Yn(null),Qt=Yt?Pa:ql(Pa,ta),ba=N5(Qt,(d=Xt?.rect)!=null?d:null,Be),en=Pt(null),na=Qn((nt,zt)=>{let{sensor:jt,options:dn}=zt;if(G.current==null)return;const St=O.get(G.current);if(!St)return;const dt=nt.nativeEvent,Rt=new jt({active:G.current,activeNode:St,event:dt,options:dn,context:ke,onAbort(Ze){if(!O.get(Ze))return;const{onDragAbort:L}=ne.current,q={id:Ze};L?.(q),A({type:"onDragAbort",event:q})},onPending(Ze,M,L,q){if(!O.get(Ze))return;const{onDragPending:le}=ne.current,fe={id:Ze,constraint:M,initialCoordinates:L,offset:q};le?.(fe),A({type:"onDragPending",event:fe})},onStart(Ze){const M=G.current;if(M==null)return;const L=O.get(M);if(!L)return;const{onDragStart:q}=ne.current,ee={activatorEvent:dt,active:{id:M,data:L.data,rect:se}};Io(()=>{q?.(ee),V(mi.Initializing),E({type:Et.DragStart,initialCoordinates:Ze,active:M}),A({type:"onDragStart",event:ee}),U(en.current),Y(dt)})},onMove(Ze){E({type:Et.DragMove,coordinates:Ze})},onEnd:aa(Et.DragEnd),onCancel:aa(Et.DragCancel)});en.current=Rt;function aa(Ze){return async function(){const{active:L,collisions:q,over:ee,scrollAdjustedTranslate:le}=ke.current;let fe=null;if(L&&le){const{cancelDrop:be}=ne.current;fe={activatorEvent:dt,active:L,collisions:q,delta:le,over:ee},Ze===Et.DragEnd&&typeof be=="function"&&await Promise.resolve(be(fe))&&(Ze=Et.DragCancel)}G.current=null,Io(()=>{E({type:Ze}),V(mi.Uninitialized),Wi(null),U(null),Y(null),en.current=null;const be=Ze===Et.DragEnd?"onDragEnd":"onDragCancel";if(fe){const oe=ne.current[be];oe?.(fe),A({type:be,event:fe})}})}}},[O]),ya=Qn((nt,zt)=>(jt,dn)=>{const St=jt.nativeEvent,dt=O.get(dn);if(G.current!==null||!dt||St.dndKit||St.defaultPrevented)return;const Rt={active:dt};nt(jt,zt.options,Rt)===!0&&(St.dndKit={capturedBy:zt.sensor},G.current=dn,na(jt,zt))},[O,na]),ji=n3(v,ya);u3(v),ha(()=>{Be&&H===mi.Initializing&&V(mi.Initialized)},[Be,H]),xt(()=>{const{onDragMove:nt}=ne.current,{active:zt,activatorEvent:jt,collisions:dn,over:St}=ke.current;if(!zt||!jt)return;const dt={active:zt,activatorEvent:jt,collisions:dn,delta:{x:rt.x,y:rt.y},over:St};Io(()=>{nt?.(dt),A({type:"onDragMove",event:dt})})},[rt.x,rt.y]),xt(()=>{const{active:nt,activatorEvent:zt,collisions:jt,droppableContainers:dn,scrollAdjustedTranslate:St}=ke.current;if(!nt||G.current==null||!zt||!St)return;const{onDragOver:dt}=ne.current,Rt=dn.get(xi),aa=Rt&&Rt.rect.current?{id:Rt.id,rect:Rt.rect.current,data:Rt.data,disabled:Rt.disabled}:null,Ze={active:nt,activatorEvent:zt,collisions:jt,delta:{x:St.x,y:St.y},over:aa};Io(()=>{Wi(aa),dt?.(Ze),A({type:"onDragOver",event:Ze})})},[xi]),ha(()=>{ke.current={activatorEvent:k,active:Ee,activeNode:Ue,collisionRect:st,collisions:Ve,droppableRects:ce,draggableNodes:O,draggingNode:ea,draggingNodeRect:Vt,droppableContainers:te,over:Xt,scrollableAncestors:un,scrollAdjustedTranslate:rt},se.current={initial:Vt,translated:st}},[Ee,Ue,Ve,st,O,ea,Vt,ce,te,Xt,un,rt]),W5({...Dt,delta:Q,draggingRect:st,pointerCoordinates:yi,scrollableAncestors:un,scrollableAncestorRects:Hn});const xa=qt(()=>({active:Ee,activeNode:Ue,activeNodeRect:Be,activatorEvent:k,collisions:Ve,containerNodeRect:En,dragOverlay:It,draggableNodes:O,droppableContainers:te,droppableRects:ce,over:Xt,measureDroppableContainers:Se,scrollableAncestors:un,scrollableAncestorRects:Hn,measuringConfiguration:ie,measuringScheduled:je,windowRect:ga}),[Ee,Ue,Be,k,Ve,En,It,O,te,ce,Xt,Se,un,Hn,ie,je,ga]),Si=qt(()=>({activatorEvent:k,activators:ji,active:Ee,activeNodeRect:Be,ariaDescribedById:{draggable:re},dispatch:E,draggableNodes:O,over:Xt,measureDroppableContainers:Se}),[k,ji,Ee,Be,E,re,O,Xt,Se]);return Gn.createElement(Tj.Provider,{value:B},Gn.createElement(Fc.Provider,{value:Si},Gn.createElement(qj.Provider,{value:xa},Gn.createElement(Hj.Provider,{value:ba},g)),Gn.createElement(j3,{disabled:p?.restoreFocus===!1})),Gn.createElement(j5,{...p,hiddenTextDescribedById:re}));function ja(){const nt=W?.autoScrollEnabled===!1,zt=typeof m=="object"?m.enabled===!1:m===!1,jt=K&&!nt&&!zt;return typeof m=="object"?{...m,enabled:jt}:{enabled:jt}}}),D3=Es(null),Bb="button",T3="Draggable";function R3(a){let{id:n,data:l,disabled:o=!1,attributes:c}=a;const d=Cs(T3),{activators:f,activatorEvent:p,active:m,activeNodeRect:g,ariaDescribedById:v,draggableNodes:b,over:x}=Il(Fc),{role:j=Bb,roleDescription:D="draggable",tabIndex:S=0}=c??{},R=m?.id===n,E=Il(R?Hj:D3),[A,B]=xc(),[H,V]=xc(),K=d3(f,n),T=ps(l);ha(()=>(b.set(n,{id:n,key:d,node:A,activatorNode:H,data:T}),()=>{const Q=b.get(n);Q&&Q.key===d&&b.delete(n)}),[b,n]);const O=qt(()=>({role:j,tabIndex:S,"aria-disabled":o,"aria-pressed":R&&j===Bb?!0:void 0,"aria-roledescription":D,"aria-describedby":v.draggable}),[o,j,S,R,D,v.draggable]);return{active:m,activatorEvent:p,activeNodeRect:g,attributes:O,isDragging:R,listeners:o?void 0:K,node:A,over:x,setNodeRef:B,setActivatorNodeRef:V,transform:E}}function N3(){return Il(qj)}const M3="Droppable",A3={timeout:25};function $3(a){let{data:n,disabled:l=!1,id:o,resizeObserverConfig:c}=a;const d=Cs(M3),{active:f,dispatch:p,over:m,measureDroppableContainers:g}=Il(Fc),v=Pt({disabled:l}),b=Pt(!1),x=Pt(null),j=Pt(null),{disabled:D,updateMeasurementsFor:S,timeout:R}={...A3,...c},E=ps(S??o),A=Qn(()=>{if(!b.current){b.current=!0;return}j.current!=null&&clearTimeout(j.current),j.current=setTimeout(()=>{g(Array.isArray(E.current)?E.current:[E.current]),j.current=null},R)},[R]),B=_c({callback:A,disabled:D||!f}),H=Qn((O,Q)=>{B&&(Q&&(B.unobserve(Q),b.current=!1),O&&B.observe(O))},[B]),[V,K]=xc(H),T=ps(n);return xt(()=>{!B||!V.current||(B.disconnect(),b.current=!1,B.observe(V.current))},[V,B]),xt(()=>(p({type:Et.RegisterDroppable,element:{id:o,key:d,disabled:l,node:V,rect:x,data:T}}),()=>p({type:Et.UnregisterDroppable,key:d,id:o})),[o]),xt(()=>{l!==v.current.disabled&&(p({type:Et.SetDroppableDisabled,id:o,key:d,disabled:l}),v.current.disabled=l)},[o,d,l,p]),{active:f,rect:x,isOver:m?.id===o,node:V,over:m,setNodeRef:K}}const L3=a=>{let{transform:n}=a;return{...n,x:0}},Gm=await C("react"),{useMemo:Cc,useRef:Ym,useEffect:Ec,useState:O3,useContext:U3}=Gm;function Pj(a,n,l){const o=a.slice();return o.splice(l<0?o.length+l:l,0,o.splice(n,1)[0]),o}function z3(a,n){return a.reduce((l,o,c)=>{const d=n.get(o);return d&&(l[c]=d),l},Array(a.length))}function Vo(a){return a!==null&&a>=0}function B3(a,n){if(a===n)return!0;if(a.length!==n.length)return!1;for(let l=0;l<a.length;l++)if(a[l]!==n[l])return!1;return!0}function _3(a){return typeof a=="boolean"?{draggable:a,droppable:a}:a}const kj=a=>{let{rects:n,activeIndex:l,overIndex:o,index:c}=a;const d=Pj(n,o,l),f=n[c],p=d[c];return!p||!f?null:{x:p.left-f.left,y:p.top-f.top,scaleX:p.width/f.width,scaleY:p.height/f.height}},Go={scaleX:1,scaleY:1},F3=a=>{var n;let{activeIndex:l,activeNodeRect:o,index:c,rects:d,overIndex:f}=a;const p=(n=d[l])!=null?n:o;if(!p)return null;if(c===l){const g=d[f];return g?{x:0,y:l<f?g.top+g.height-(p.top+p.height):g.top-p.top,...Go}:null}const m=q3(d,c,l);return c>l&&c<=f?{x:0,y:-p.height-m,...Go}:c<l&&c>=f?{x:0,y:p.height+m,...Go}:{x:0,y:0,...Go}};function q3(a,n,l){const o=a[n],c=a[n-1],d=a[n+1];return o?l<n?c?o.top-(c.top+c.height):d?d.top-(o.top+o.height):0:d?d.top-(o.top+o.height):c?o.top-(c.top+c.height):0:0}const Ij="Sortable",Vj=Gm.createContext({activeIndex:-1,containerId:Ij,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:kj,disabled:{draggable:!1,droppable:!1}});function H3(a){let{children:n,id:l,items:o,strategy:c=kj,disabled:d=!1}=a;const{active:f,dragOverlay:p,droppableRects:m,over:g,measureDroppableContainers:v}=N3(),b=Cs(Ij,l),x=p.rect!==null,j=Cc(()=>o.map(K=>typeof K=="object"&&"id"in K?K.id:K),[o]),D=f!=null,S=f?j.indexOf(f.id):-1,R=g?j.indexOf(g.id):-1,E=Ym(j),A=!B3(j,E.current),B=R!==-1&&S===-1||A,H=_3(d);ha(()=>{A&&D&&v(j)},[A,j,D,v]),Ec(()=>{E.current=j},[j]);const V=Cc(()=>({activeIndex:S,containerId:b,disabled:H,disableTransforms:B,items:j,overIndex:R,useDragOverlay:x,sortedRects:z3(j,m),strategy:c}),[S,b,H.draggable,H.droppable,B,j,R,m,x,c]);return Gm.createElement(Vj.Provider,{value:V},n)}const P3=a=>{let{id:n,items:l,activeIndex:o,overIndex:c}=a;return Pj(l,o,c).indexOf(n)},k3=a=>{let{containerId:n,isSorting:l,wasDragging:o,index:c,items:d,newIndex:f,previousItems:p,previousContainerId:m,transition:g}=a;return!g||!o||p!==d&&c===f?!1:l?!0:f!==c&&n===m},I3={duration:200,easing:"ease"},Gj="transform",V3=gs.Transition.toString({property:Gj,duration:0,easing:"linear"}),G3={roleDescription:"sortable"};function Y3(a){let{disabled:n,index:l,node:o,rect:c}=a;const[d,f]=O3(null),p=Ym(l);return ha(()=>{if(!n&&l!==p.current&&o.current){const m=c.current;if(m){const g=Zl(o.current,{ignoreTransform:!0}),v={x:m.left-g.left,y:m.top-g.top,scaleX:m.width/g.width,scaleY:m.height/g.height};(v.x||v.y)&&f(v)}}l!==p.current&&(p.current=l)},[n,l,o,c]),Ec(()=>{d&&f(null)},[d]),d}function X3(a){let{animateLayoutChanges:n=k3,attributes:l,disabled:o,data:c,getNewIndex:d=P3,id:f,strategy:p,resizeObserverConfig:m,transition:g=I3}=a;const{items:v,containerId:b,activeIndex:x,disabled:j,disableTransforms:D,sortedRects:S,overIndex:R,useDragOverlay:E,strategy:A}=U3(Vj),B=Q3(o,j),H=v.indexOf(f),V=Cc(()=>({sortable:{containerId:b,index:H,items:v},...c}),[b,c,H,v]),K=Cc(()=>v.slice(v.indexOf(f)),[v,f]),{rect:T,node:O,isOver:Q,setNodeRef:te}=$3({id:f,data:V,disabled:B.droppable,resizeObserverConfig:{updateMeasurementsFor:K,...m}}),{active:ae,activatorEvent:se,activeNodeRect:Ee,attributes:G,setNodeRef:W,listeners:U,isDragging:k,over:Y,setActivatorNodeRef:ne,transform:re}=R3({id:f,data:V,attributes:{...G3,...l},disabled:B.draggable}),ge=a5(te,W),ie=!!ae,ce=ie&&!D&&Vo(x)&&Vo(R),Se=!E&&k,je=Se&&ce?re:null,Ot=ce?je??(p??A)({rects:S,activeNodeRect:Ee,activeIndex:x,overIndex:R,index:H}):null,Dt=Vo(x)&&Vo(R)?d({id:f,items:v,activeIndex:x,overIndex:R}):H,Tt=ae?.id,Be=Ym({activeId:Tt,items:v,newIndex:Dt,containerId:b}),En=v!==Be.current.items,ke=n({active:ae,containerId:b,isDragging:k,isSorting:ie,id:f,index:H,items:v,newIndex:Be.current.newIndex,previousItems:Be.current.items,previousContainerId:Be.current.containerId,transition:g,wasDragging:Be.current.activeId!=null}),Ut=Y3({disabled:!ke,index:H,node:O,rect:T});return Ec(()=>{ie&&Be.current.newIndex!==Dt&&(Be.current.newIndex=Dt),b!==Be.current.containerId&&(Be.current.containerId=b),v!==Be.current.items&&(Be.current.items=v)},[ie,Dt,b,v]),Ec(()=>{if(Tt===Be.current.activeId)return;if(Tt!=null&&Be.current.activeId==null){Be.current.activeId=Tt;return}const ea=setTimeout(()=>{Be.current.activeId=Tt},50);return()=>clearTimeout(ea)},[Tt]),{active:ae,activeIndex:x,attributes:G,data:V,rect:T,index:H,newIndex:Dt,items:v,isOver:Q,isSorting:ie,isDragging:k,listeners:U,node:O,overIndex:R,over:Y,setNodeRef:ge,setActivatorNodeRef:ne,setDroppableNodeRef:te,setDraggableNodeRef:W,transform:Ut??Ot,transition:It()};function It(){if(Ut||En&&Be.current.newIndex===H)return V3;if(!(Se&&!Hm(se)||!g)&&(ie||ke))return gs.Transition.toString({...g,property:Gj})}}function Q3(a,n){var l,o;return typeof a=="boolean"?{draggable:a,droppable:!1}:{draggable:(l=a?.draggable)!=null?l:n.draggable,droppable:(o=a?.droppable)!=null?o:n.droppable}}Pe.Down,Pe.Right,Pe.Up,Pe.Left;function K3(a){return Yi({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M2.49998 4.09998C2.27906 4.09998 2.09998 4.27906 2.09998 4.49998C2.09998 4.72089 2.27906 4.89998 2.49998 4.89998H12.5C12.7209 4.89998 12.9 4.72089 12.9 4.49998C12.9 4.27906 12.7209 4.09998 12.5 4.09998H2.49998ZM2.49998 6.09998C2.27906 6.09998 2.09998 6.27906 2.09998 6.49998C2.09998 6.72089 2.27906 6.89998 2.49998 6.89998H12.5C12.7209 6.89998 12.9 6.72089 12.9 6.49998C12.9 6.27906 12.7209 6.09998 12.5 6.09998H2.49998ZM2.09998 8.49998C2.09998 8.27906 2.27906 8.09998 2.49998 8.09998H12.5C12.7209 8.09998 12.9 8.27906 12.9 8.49998C12.9 8.72089 12.7209 8.89998 12.5 8.89998H2.49998C2.27906 8.89998 2.09998 8.72089 2.09998 8.49998ZM2.49998 10.1C2.27906 10.1 2.09998 10.2791 2.09998 10.5C2.09998 10.7209 2.27906 10.9 2.49998 10.9H12.5C12.7209 10.9 12.9 10.7209 12.9 10.5C12.9 10.2791 12.7209 10.1 12.5 10.1H2.49998Z",fill:"currentColor"},child:[]}]})(a)}const{Button:Z3}=await C("@baseplate-dev/ui-components");function W3({id:a,children:n}){const{attributes:l,listeners:o,setNodeRef:c,transform:d,transition:f}=X3({id:a}),p={transform:gs.Transform.toString(d),transition:f};return s.jsxs("div",{className:"flex w-full items-center gap-2",ref:c,style:p,children:[s.jsx("div",{className:"flex w-10 items-center justify-center",...l,...o,children:s.jsx(Z3,{className:"cursor-grab",variant:"ghost",size:"icon",children:s.jsx(K3,{})})}),s.jsx("div",{className:"flex-1",children:n})]})}function Yj({listItems:a,sortItems:n}){const l=({active:o,over:c})=>{if(c&&o.id!==c.id){const d=a.findIndex(p=>p.id===o.id),f=a.findIndex(p=>p.id===c.id);n(d,f)}};return s.jsx(E3,{collisionDetection:D5,onDragEnd:l,modifiers:[L3],children:s.jsx("div",{className:"flex w-full flex-col gap-4",children:s.jsx(H3,{items:a.map(({id:o})=>o),strategy:F3,children:a.map(o=>s.jsx(W3,{id:o.id,children:o.element},o.id))})})})}const _b=a=>Symbol.iterator in a,Fb=a=>"entries"in a,qb=(a,n)=>{const l=a instanceof Map?a:new Map(a.entries()),o=n instanceof Map?n:new Map(n.entries());if(l.size!==o.size)return!1;for(const[c,d]of l)if(!Object.is(d,o.get(c)))return!1;return!0},J3=(a,n)=>{const l=a[Symbol.iterator](),o=n[Symbol.iterator]();let c=l.next(),d=o.next();for(;!c.done&&!d.done;){if(!Object.is(c.value,d.value))return!1;c=l.next(),d=o.next()}return!!c.done&&!!d.done};function eD(a,n){return Object.is(a,n)?!0:typeof a!="object"||a===null||typeof n!="object"||n===null?!1:!_b(a)||!_b(n)?qb({entries:()=>Object.entries(a)},{entries:()=>Object.entries(n)}):Fb(a)&&Fb(n)?qb(a,n):J3(a,n)}const tD=await C("react");function nD(a){const n=tD.useRef(void 0);return l=>{const o=a(l);return eD(n.current,o)?n.current:n.current=o}}class Dc extends Error{constructor(n){super(`Project not found for project ID: ${n}`),this.name="ProjectNotFoundError"}}function Wl(a){return n=>{throw C6(n)&&n.data?.code==="NOT_FOUND"?new Dc(a):n}}async function aD(a){return Fn?[]:Lt.plugins.getAvailablePlugins.mutate({projectId:a}).catch(Wl(a))}async function iD(a){if(Fn){const o=await(await fetch("/preview-app.json")).text();return{contents:o,hash:await yj(o)}}return(await Lt.projects.readDefinition.query({id:a}).catch(Wl(a))).contents}async function lD(a,n,l){return Fn?{type:"success"}:(await Lt.projects.writeDefinition.mutate({id:a,newContents:n,oldContentsHash:l}).catch(Wl(a))).result}function rD(a,n){if(Fn)return()=>{};const l=Lt.projects.onProjectJsonChanged.subscribe({id:a},{onData:n});return()=>{l.unsubscribe()}}async function sD(){return Fn?[{id:"preview-project",name:"Preview Project",directory:"~/preview-project"}]:Lt.projects.list.query()}async function oD(a){Fn||await Lt.sync.startSync.mutate({id:a}).catch(Wl(a))}async function cD(a){return Fn?{status:"success",startedAt:new Date().toISOString(),packages:{"app:NmEolDU3Iggt":{status:"not-synced",path:"packages/admin",name:"admin",order:0}}}:Lt.sync.getSyncMetadata.query({id:a}).catch(Wl(a))}async function uD(a){Fn||await Lt.sync.cancelSync.mutate({id:a}).catch(Wl(a))}async function dD(){return Fn?{version:"preview",featureFlags:[],userConfig:{}}:Lt.version.get.query()}const{toast:Yo}=await C("@baseplate-dev/ui-components"),{useEffect:fD}=await C("react"),Xj={status:"not-started",packages:{}},Qj=Cm(a=>({metadata:Xj,setMetadata:n=>{a({metadata:n})}}));function hD(){const{currentProjectId:a}=Cn(),{setMetadata:n}=Qj();fD(()=>{if(n(Xj),!a)return;let l=!1;const o=()=>{cD(a).then(p=>{l||n(p)}).catch(p=>{p instanceof Dc||Yo.error(wn(p,"Failed to fetch sync metadata."))})};if(o(),Fn)return;const c=Um.on("open",o),d=Lt.sync.onSyncMetadataChanged.subscribe({id:a},{onData:p=>{n(p.syncMetadata)}}),f=Lt.sync.onSyncCompleted.subscribe({id:a},{onData:p=>{const{status:m}=p.syncMetadata;Object.values(p.syncMetadata.packages).some(v=>v.status==="conflicts")?Yo.warning("Sync completed with conflicts! Please review."):m==="success"?Yo.success("Sync completed successfully!"):m==="error"&&Yo.error("Sync failed with errors!")}});return()=>{d.unsubscribe(),f.unsubscribe(),c(),l=!0}},[a,n])}function Tc(a){return Qj(nD(n=>a?a(n.metadata):n.metadata))}function Xo(a){const n=new Date(a);if(!Number.isNaN(n.valueOf()))return n;const l=String(a).match(/\d+/g);if(l==null||l.length<=2)return n;{const[o,c,...d]=l.map(m=>parseInt(m)),f=[o,c-1,...d];return new Date(Date.UTC(...f))}}const Kr=(a,n,l)=>{const o=a!==1?n+"s":n;return a+" "+o+" "+l},mD=({locale:a,...n})=>(l,o,c)=>{const d=Intl.RelativeTimeFormat;if(!d)throw new Error("Intl.RelativeTimeFormat is not supported");return new d(a,{style:"long",numeric:"auto",...n}).format(c==="ago"?-l:l,o)};function gm(){return gm=Object.assign?Object.assign.bind():function(a){for(var n=1;n<arguments.length;n++){var l=arguments[n];for(var o in l)({}).hasOwnProperty.call(l,o)&&(a[o]=l[o])}return a},gm.apply(null,arguments)}const pD=await C("react"),{useEffect:Hb,useState:gD}=await C("react"),ns=60,as=ns*60,Hl=as*24,Qo=Hl*7,Pb=Hl*30,kb=Hl*365,vD=()=>Date.now();function Kj({date:a,formatter:n,component:l="time",live:o=!0,minPeriod:c=0,maxPeriod:d=Qo,title:f,now:p=vD,...m}){const[g,v]=gD(p());Hb(()=>{if(!o)return;const T=(()=>{const O=Xo(a).valueOf();if(!O)return console.warn("[react-timeago] Invalid Date provided"),0;const Q=Math.round(Math.abs(g-O)/1e3),te=Q<ns?1e3:Q<as?1e3*ns:Q<Hl?1e3*as:1e3*Qo,ae=Math.min(Math.max(te,c*1e3),d*1e3);return ae?setTimeout(()=>{v(p())},ae):0})();return()=>{T&&clearTimeout(T)}},[a,o,d,c,p,g]),Hb(()=>{v(p())},[a]);const b=l,x=Xo(a).valueOf();if(!x)return null;const j=Math.round(Math.abs(g-x)/1e3),D=x<g?"ago":"from now",[S,R]=j<ns?[Math.round(j),"second"]:j<as?[Math.round(j/ns),"minute"]:j<Hl?[Math.round(j/as),"hour"]:j<Qo?[Math.round(j/Hl),"day"]:j<Pb?[Math.round(j/Qo),"week"]:j<kb?[Math.round(j/Pb),"month"]:[Math.round(j/kb),"year"],E=typeof f>"u"?typeof a=="string"?a:Xo(a).toISOString().substring(0,16).replace("T"," "):f,A=b==="time"?{...m,dateTime:Xo(a).toISOString()}:m,B=(K=K,T=T,O=O,Q=x,te=Kr,ae=ae)=>Kr(K,T,O),H=n||Kr;let V;try{V=H(S,R,D,x,B,p),V||(V=Kr(S,R,D,x,B,p))}catch(K){console.error("[react-timeago] Formatter threw an error:",K),V=Kr(S,R,D)}return pD.createElement(b,gm({},A,{title:E}),V)}const Zj=await C("react"),Wj=Zj.createContext(null);function Jj(){const a=Zj.useContext(Wj);if(!a)throw new Error("useClientVersion must be used within a <ClientVersionContext.Provider>");return a}const bD=mD({locale:"en"}),eS=(...a)=>a[1]==="second"?"Just now":bD(...a),{Badge:yD,Button:bf,Table:xD,TableBody:jD,TableCell:yf,TableHead:xf,TableHeader:SD,TableRow:Ib,toast:Zr,Tooltip:wD,TooltipContent:CD,TooltipTrigger:ED}=await C("@baseplate-dev/ui-components");function DD(a){switch(a){case"success":return s.jsx(qw,{className:"text-success-foreground"});case"unknown-error":case"command-error":return s.jsx(Fw,{className:"text-error-foreground"});case"conflicts":return s.jsx(Nx,{className:"text-warning-foreground"});case"cancelled":return s.jsx(_w,{className:"text-secondary-foreground"});case"not-synced":return s.jsx(U0,{className:"text-secondary-foreground"});case"in-progress":return s.jsx(Rx,{className:"text-secondary-foreground"});default:return s.jsx(U0,{className:"text-secondary-foreground"})}}function TD(a){switch(a){case"success":return"Synced";case"unknown-error":return"Sync error";case"command-error":return"Command error";case"conflicts":return"Conflicts";case"cancelled":return"Cancelled";case"not-synced":return"Not Synced";case"in-progress":return"Syncing...";default:return"Unknown"}}function RD(a){switch(a){case"merge-conflict":return"Merge Conflict";case"working-deleted":return"Deleted by User";case"generated-deleted":return"Deleted in Generated";default:return"Unknown"}}function ND(a){switch(a){case"merge-conflict":return"This file was modified in both the working codebase and the generated codebase. Please resolve the conflicts manually.";case"working-deleted":return"This file was deleted in the working codebase but modified in the generated codebase. Choose whether to keep or delete it.";case"generated-deleted":return"This file was deleted in the generated codebase but modified in the working codebase. Choose whether to keep or delete it.";default:return"Unknown conflict type"}}function MD({packageId:a,filesWithConflicts:n}){const l=Jj(),{currentProjectId:o}=Cn();if(n.length===0)return null;const c=p=>{o&&Lt.sync.openEditor.mutate({id:o,packageId:a,relativePath:p}).catch(m=>{Zr.error(wn(m,"Failed to open editor"))})},d=p=>{o&&Lt.sync.keepConflictFile.mutate({id:o,packageId:a,relativePath:p.relativePath}).then(()=>{Zr.success(`File ${p.relativePath} was kept!`)}).catch(m=>{Zr.error(wn(m,"Failed to keep file"))})},f=p=>{o&&Lt.sync.deleteConflictFile.mutate({id:o,packageId:a,relativePath:p.relativePath}).then(()=>{Zr.success(`File ${p.relativePath} was deleted!`)}).catch(m=>{Zr.error(wn(m,"Failed to delete file"))})};return s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:"Merge Conflicts"}),s.jsxs(xD,{children:[s.jsx(SD,{children:s.jsxs(Ib,{children:[s.jsx(xf,{className:"w-3/5",children:"Name"}),s.jsx(xf,{className:"w-1/5",children:s.jsx("div",{className:"flex items-center gap-2",children:"Type"})}),s.jsx(xf,{className:"w-1/5",children:"Actions"})]})}),s.jsx(jD,{children:n.map(p=>s.jsxs(Ib,{children:[s.jsx(yf,{children:l.userConfig.sync?.editor?s.jsx("button",{className:"hover:underline",onClick:()=>{c(p.generatedConflictRelativePath??p.relativePath)},children:s.jsx("div",{className:"w-full text-start",children:p.generatedConflictRelativePath??p.relativePath})}):s.jsx("span",{children:p.generatedConflictRelativePath??p.relativePath})}),s.jsx(yf,{children:s.jsxs(wD,{children:[s.jsx(ED,{children:s.jsx("span",{children:RD(p.conflictType)})}),s.jsx(CD,{side:"left",className:"max-w-sm",children:ND(p.conflictType)})]})}),s.jsxs(yf,{children:[p.conflictType==="merge-conflict"&&l.userConfig.sync?.editor&&s.jsx(bf,{variant:"outline",size:"sm",onClick:()=>{c(p.generatedConflictRelativePath??p.relativePath)},children:"View"}),p.conflictType!=="merge-conflict"&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx(bf,{variant:"outline",size:"sm",onClick:()=>{d(p)},children:"Keep"}),s.jsx(bf,{variant:"destructive",size:"sm",onClick:()=>{f(p)},children:"Delete"})]})]})]},p.relativePath))})]})]})}function AD({packageId:a,packageInfo:n,className:l}){const o=n.status==="unknown-error"||n.status==="command-error"||n.status==="conflicts",c=n.result?.filesWithConflicts??[];return s.jsxs("div",{className:Te("w-full rounded-md border",l),children:[s.jsxs("div",{className:"flex w-full items-center justify-between px-4 py-3",children:[s.jsx("span",{className:"font-medium",children:n.name}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx("span",{children:n.result?.completedAt?s.jsx(Kj,{date:new Date(n.result.completedAt),formatter:eS}):"-"}),s.jsxs(yD,{variant:n.status==="unknown-error"||n.status==="command-error"?"destructive":"secondary",className:"flex items-center gap-1",children:[DD(n.status),TD(n.status)]})]})]}),o&&s.jsxs("div",{className:"space-y-4 border-t p-4",children:[n.result?.errors&&n.result.errors.length>0&&s.jsxs("div",{className:"mt-2 space-y-1",children:[s.jsx("h4",{className:"font-medium",children:"Errors:"}),s.jsx("ul",{className:"list-disc pl-5 text-sm text-destructive",children:n.result.errors.map((d,f)=>s.jsx("li",{className:"font-mono whitespace-pre-wrap",children:d.message},f))})]}),s.jsx(MD,{packageId:a,filesWithConflicts:c}),n.result?.failedCommands&&n.result.failedCommands.length>0&&s.jsxs("div",{className:"mt-2 space-y-1",children:[s.jsx("h4",{className:"font-medium",children:"Failed Commands:"}),s.jsx("ul",{className:"list-disc pl-5 text-sm text-destructive",children:n.result.failedCommands.map((d,f)=>s.jsx("li",{children:s.jsx("code",{children:d.command})},f))})]})]})]})}const{Alert:Vb,AlertDescription:Gb,AlertTitle:Yb}=await C("@baseplate-dev/ui-components");function $D({className:a}){const n=Tc();if(n.globalErrors?.length)return s.jsxs(Vb,{variant:"error",children:[s.jsx(Yb,{children:"Error compiling project."}),s.jsx(Gb,{children:n.globalErrors.map(d=>s.jsx("div",{className:"font-mono whitespace-pre-wrap",children:d},d))})]});if(!(Object.keys(n.packages).length>0))return n.status==="not-started"||n.status==="in-progress"?s.jsx("div",{className:Te("flex h-40 items-center justify-center text-muted-foreground",a),children:s.jsx("span",{children:"Waiting for sync to start..."})}):s.jsxs(Vb,{variant:"default",children:[s.jsx(Yb,{children:"No packages found to be synced."}),s.jsx(Gb,{children:"Sync status will appear here once packages have been added."})]});const o=Object.entries(n.packages),c=Zn(o,[([,d])=>d.order]);return s.jsx("div",{className:Te("space-y-3",a),children:c.map(([d,f])=>s.jsx(AD,{packageId:d,packageInfo:f},d))})}const{useBlockBeforeContinue:LD,useProjectDefinition:OD}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Ko,Dialog:UD,DialogContent:zD,DialogDescription:BD,DialogFooter:_D,DialogHeader:FD,DialogTitle:qD,DialogTrigger:HD,Tabs:PD,TabsContent:Xb,TabsList:kD,TabsTrigger:Qb,toast:jf}=await C("@baseplate-dev/ui-components"),{useRef:ID,useState:VD}=await C("react");function GD({className:a}){const[n,l]=VD(!1),{definitionContainer:o}=OD(),{currentProjectId:c}=Cn(),d=LD(),f=ID(o);f.current=o;const p=Tc(b=>b.status==="in-progress"),m=Tc(b=>Object.values(b.packages).some(x=>x.status==="conflicts")),g=()=>{if(c){if(m){jf.warning("Conflicts must be resolved before syncing");return}oD(c).catch(b=>jf.error(wn(b))),l(!0)}},v=()=>{c&&uD(c).catch(b=>jf.error(Gl(b)))};return s.jsx("div",{className:Te(a),children:s.jsxs(UD,{open:n,onOpenChange:b=>{l(b)},children:[s.jsx(HD,{asChild:!0,children:s.jsxs(Ko,{onClick:b=>{l(!0),!p&&!m&&(d({onContinue:g}),b.preventDefault())},size:"sm","data-testid":"sync-button",children:[m?s.jsx(Nx,{}):s.jsx(Rx,{}),p?"Syncing...":m?"Resolve conflicts":"Sync"]})}),s.jsxs(zD,{width:"lg","aria-description":"Sync project dialog",children:[s.jsxs(FD,{children:[s.jsx(qD,{children:"Sync Project"}),s.jsx(BD,{children:"Sync the project configuration to the codebase of your project."})]}),s.jsxs(PD,{defaultValue:"packages",className:"mt-4 min-w-0",children:[s.jsxs(kD,{className:"grid w-full grid-cols-2",children:[s.jsx(Qb,{value:"packages",children:"Packages"}),s.jsx(Qb,{value:"console-log",children:"Console log"})]}),s.jsx(Xb,{value:"packages",className:"mt-4",children:s.jsx($D,{})}),s.jsx(Xb,{value:"console-log",className:"mt-4",children:s.jsx(xj,{})})]}),s.jsxs(_D,{children:[p?s.jsx(Ko,{variant:"destructive",onClick:v,children:"Stop"}):s.jsx(Ko,{variant:"secondary",onClick:g,children:"Sync Again"}),s.jsx(Ko,{variant:"outline",onClick:()=>{l(!1)},children:"Close"})]})]})]})})}const{useProjectDefinition:YD}=await C("@baseplate-dev/project-builder-lib/web"),{Breadcrumb:XD,BreadcrumbItem:Kb,BreadcrumbLink:QD,BreadcrumbList:KD,BreadcrumbPage:ZD,BreadcrumbSeparator:Zb,Button:WD,DropdownMenu:JD,DropdownMenuContent:e8,DropdownMenuGroup:t8,DropdownMenuItem:n8,DropdownMenuTrigger:a8}=await C("@baseplate-dev/ui-components"),{Fragment:i8}=await C("react");function l8(){const{definitionContainer:a}=YD(),l=pC().map(m=>{const g=m.handle?.crumb;if(!g)return null;const v=typeof g=="function"?g(m.params,a):g,{label:b,url:x}=typeof v=="string"?{label:v,url:void 0}:v;return{id:m.id,label:b,url:x}}).filter(Mx),o=Cn(m=>m.projects),c=Cn(m=>m.setCurrentProjectId),d=on(),f=Ww(o,["name"],["asc"]),p=a.definition.settings.general.name;return s.jsxs("div",{className:"flex items-center space-x-2",children:[o.length>1&&s.jsxs(JD,{children:[s.jsx(a8,{asChild:!0,children:s.jsxs(WD,{variant:"ghost",size:"none",className:"-ml-2 h-8 px-2 text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center text-sm",children:[wb(p)," project"]}),s.jsx(Hw,{})]})}),s.jsx(e8,{children:s.jsx(t8,{children:f.map(m=>s.jsx(n8,{onSelect:()=>{c(m.id),d("/")},children:s.jsxs("div",{className:"flex flex-col space-y-1",children:[s.jsx("div",{children:s.jsx("strong",{children:m.name})}),s.jsx("div",{className:"text-xs text-muted-foreground",children:m.directory})]})},m.id))})})]}),s.jsx(XD,{children:s.jsxs(KD,{children:[o.length<=1&&s.jsxs(s.Fragment,{children:[s.jsxs(Kb,{children:[wb(p)," project"]}),l.length>0&&s.jsx(Zb,{})]}),l.map((m,g)=>s.jsxs(i8,{children:[g!==0&&s.jsx(Zb,{className:"hidden sm:block"}),g===l.length-1?s.jsx(ZD,{children:m.label}):s.jsx(Kb,{className:"hidden sm:block",children:m.url?s.jsx(QD,{asChild:!0,children:s.jsx(Sn,{to:m.url,children:m.label})}):m.label})]},m.id))]})})]})}function Xm(a){return Yi({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M3 12v3c0 1.657 3.134 3 7 3s7-1.343 7-3v-3c0 1.657-3.134 3-7 3s-7-1.343-7-3z"},child:[]},{tag:"path",attr:{d:"M3 7v3c0 1.657 3.134 3 7 3s7-1.343 7-3V7c0 1.657-3.134 3-7 3S3 8.657 3 7z"},child:[]},{tag:"path",attr:{d:"M17 5c0 1.657-3.134 3-7 3S3 6.657 3 5s3.134-3 7-3 7 1.343 7 3z"},child:[]}]})(a)}function Rc(a){return Yi({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"},child:[]}]})(a)}function Wr(a){return Yi({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"},child:[]}]})(a)}function Zo({icon:a,to:n,label:l,end:o}){return s.jsx(Ht,{to:n,className:'flex h-12 w-[50px] items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-[current="page"]:bg-accent/80 aria-[current="page"]:text-accent-foreground aria-[current="page"]:hover:bg-accent',end:o,children:s.jsxs("div",{className:"flex flex-col items-center space-y-1",children:[s.jsx(a,{className:"size-5"}),s.jsx("div",{className:"text-xs font-medium",children:l})]})})}function r8(){return s.jsx("nav",{className:"flex h-full flex-col items-center justify-between px-2 pt-2.5 pb-4",children:s.jsxs("div",{className:"space-y-8",children:[s.jsx(Sn,{to:"/",className:"group flex shrink-0 items-center justify-center",children:s.jsx("img",{src:"/images/logo.png",className:"size-8 transition-all group-hover:scale-110",alt:"Baseplate Home"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Zo,{to:"/apps",icon:Dm,label:"Apps"}),s.jsx(Zo,{to:"/data",icon:Xm,label:"Data"}),s.jsx(Zo,{to:"/plugins",icon:Ax,label:"Plugins"}),s.jsx(Zo,{to:"/settings",icon:$x,label:"Settings"})]})]})})}const{SheetClose:s8}=await C("@baseplate-dev/ui-components");function Jr({icon:a,to:n,label:l,end:o}){return s.jsx(s8,{asChild:!0,children:s.jsxs(Ht,{to:n,className:'flex items-center gap-4 px-2.5 py-4 text-muted-foreground transition-colors hover:text-accent-foreground aria-[current="page"]:bg-accent/80 aria-[current="page"]:text-accent-foreground',end:o,children:[s.jsx(a,{className:"size-5 transition-all group-hover:scale-110"}),l]})})}function o8(){return s.jsxs("nav",{className:"grid gap-6 text-lg font-medium",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("img",{src:"/images/logo.png",alt:"logo",className:"size-12"}),s.jsx("h3",{children:"Baseplate"})]}),s.jsxs("div",{children:[s.jsx(Jr,{to:"/",icon:Pw,label:"Home",end:!0}),s.jsx(Jr,{to:"/apps",icon:Dm,label:"Apps"}),s.jsx(Jr,{to:"/data/models",icon:Xm,label:"Models"}),s.jsx(Jr,{to:"/plugins",icon:Ax,label:"Plugins"}),s.jsx(Jr,{to:"/settings",icon:$x,label:"Settings"})]})]})}function c8({className:a}){const n=Tc(l=>l.completedAt);return n?s.jsxs("div",{className:Te("text-style-muted",a),children:["Last Sync: ",s.jsx(Kj,{date:n,formatter:eS})]}):null}const{Button:u8,Sheet:d8,SheetContent:f8,SheetTrigger:h8}=await C("@baseplate-dev/ui-components");function m8({className:a}){return s.jsxs("div",{className:Te("flex h-screen w-full min-w-(--min-app-width) flex-col bg-background",a),style:{"--sidebar-width":"70px","--topbar-height":"52px","--action-bar-height":"52px","--min-app-width":"800px"},children:[s.jsx("aside",{className:"fixed inset-y-0 left-0 z-10 hidden w-(--sidebar-width) flex-col border-r bg-background sm:flex",children:s.jsx(r8,{})}),s.jsxs("div",{className:"flex h-full flex-col pt-(--topbar-height) sm:pl-(--sidebar-width)",children:[s.jsxs("header",{className:"fixed inset-x-0 top-0 z-30 flex h-(--topbar-height) items-center gap-4 border-b bg-background px-4 sm:left-(--sidebar-width) sm:px-4",children:[s.jsxs(d8,{children:[s.jsx(h8,{asChild:!0,children:s.jsxs(u8,{size:"icon",variant:"outline",className:"sm:hidden",children:[s.jsx(kw,{className:"size-5"}),s.jsx("span",{className:"sr-only",children:"Toggle Menu"})]})}),s.jsx(f8,{side:"left",className:"max-w-xs",children:s.jsx(o8,{})})]}),s.jsxs("div",{className:"flex w-full items-center justify-between py-3",children:[s.jsx(l8,{}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(c8,{}),s.jsx(GD,{})]})]})]}),s.jsx("main",{className:"h-[calc(100vh-var(--topbar-height)-1px)] overflow-auto",children:s.jsx(Yl,{children:s.jsx(bi,{})})})]})]})}const{ErrorableLoader:p8}=await C("@baseplate-dev/ui-components"),{useCallback:g8,useEffect:Wb,useMemo:v8,useState:Jb}=await C("react");function b8({children:a}){const[n,l]=Jb(),[o,c]=Jb(),d=g8(()=>{dD().then(m=>{l(m)}).catch(m=>{c(wn(m,"Failed to fetch version info."))})},[]);Wb(()=>(d(),Um.on("open",d)),[d]);const f=zm(n?.version);Wb(()=>{n&&f&&f!==n.version&&globalThis.location.reload()},[n,f]);const p=v8(()=>n?{version:n.version,featureFlags:n.featureFlags,userConfig:n.userConfig}:void 0,[n]);return p?s.jsx(Wj.Provider,{value:p,children:a}):s.jsx(p8,{error:o})}var Wo={exports:{}},Sf,e1;function qc(){if(e1)return Sf;e1=1;const a="2.0.0",n=256,l=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,c=n-6;return Sf={MAX_LENGTH:n,MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:c,MAX_SAFE_INTEGER:l,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:a,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Sf}var wf,t1;function Hc(){if(t1)return wf;t1=1;var a={};return wf=typeof process=="object"&&a&&a.NODE_DEBUG&&/\bsemver\b/i.test(a.NODE_DEBUG)?(...l)=>console.error("SEMVER",...l):()=>{},wf}var n1;function Ds(){return n1||(n1=1,function(a,n){const{MAX_SAFE_COMPONENT_LENGTH:l,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:c}=qc(),d=Hc();n=a.exports={};const f=n.re=[],p=n.safeRe=[],m=n.src=[],g=n.safeSrc=[],v=n.t={};let b=0;const x="[a-zA-Z0-9-]",j=[["\\s",1],["\\d",c],[x,o]],D=R=>{for(const[E,A]of j)R=R.split(`${E}*`).join(`${E}{0,${A}}`).split(`${E}+`).join(`${E}{1,${A}}`);return R},S=(R,E,A)=>{const B=D(E),H=b++;d(R,H,E),v[R]=H,m[H]=E,g[H]=B,f[H]=new RegExp(E,A?"g":void 0),p[H]=new RegExp(B,A?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*"),S("NUMERICIDENTIFIERLOOSE","\\d+"),S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${x}*`),S("MAINVERSION",`(${m[v.NUMERICIDENTIFIER]})\\.(${m[v.NUMERICIDENTIFIER]})\\.(${m[v.NUMERICIDENTIFIER]})`),S("MAINVERSIONLOOSE",`(${m[v.NUMERICIDENTIFIERLOOSE]})\\.(${m[v.NUMERICIDENTIFIERLOOSE]})\\.(${m[v.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASEIDENTIFIER",`(?:${m[v.NONNUMERICIDENTIFIER]}|${m[v.NUMERICIDENTIFIER]})`),S("PRERELEASEIDENTIFIERLOOSE",`(?:${m[v.NONNUMERICIDENTIFIER]}|${m[v.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASE",`(?:-(${m[v.PRERELEASEIDENTIFIER]}(?:\\.${m[v.PRERELEASEIDENTIFIER]})*))`),S("PRERELEASELOOSE",`(?:-?(${m[v.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${m[v.PRERELEASEIDENTIFIERLOOSE]})*))`),S("BUILDIDENTIFIER",`${x}+`),S("BUILD",`(?:\\+(${m[v.BUILDIDENTIFIER]}(?:\\.${m[v.BUILDIDENTIFIER]})*))`),S("FULLPLAIN",`v?${m[v.MAINVERSION]}${m[v.PRERELEASE]}?${m[v.BUILD]}?`),S("FULL",`^${m[v.FULLPLAIN]}$`),S("LOOSEPLAIN",`[v=\\s]*${m[v.MAINVERSIONLOOSE]}${m[v.PRERELEASELOOSE]}?${m[v.BUILD]}?`),S("LOOSE",`^${m[v.LOOSEPLAIN]}$`),S("GTLT","((?:<|>)?=?)"),S("XRANGEIDENTIFIERLOOSE",`${m[v.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),S("XRANGEIDENTIFIER",`${m[v.NUMERICIDENTIFIER]}|x|X|\\*`),S("XRANGEPLAIN",`[v=\\s]*(${m[v.XRANGEIDENTIFIER]})(?:\\.(${m[v.XRANGEIDENTIFIER]})(?:\\.(${m[v.XRANGEIDENTIFIER]})(?:${m[v.PRERELEASE]})?${m[v.BUILD]}?)?)?`),S("XRANGEPLAINLOOSE",`[v=\\s]*(${m[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[v.XRANGEIDENTIFIERLOOSE]})(?:${m[v.PRERELEASELOOSE]})?${m[v.BUILD]}?)?)?`),S("XRANGE",`^${m[v.GTLT]}\\s*${m[v.XRANGEPLAIN]}$`),S("XRANGELOOSE",`^${m[v.GTLT]}\\s*${m[v.XRANGEPLAINLOOSE]}$`),S("COERCEPLAIN",`(^|[^\\d])(\\d{1,${l}})(?:\\.(\\d{1,${l}}))?(?:\\.(\\d{1,${l}}))?`),S("COERCE",`${m[v.COERCEPLAIN]}(?:$|[^\\d])`),S("COERCEFULL",m[v.COERCEPLAIN]+`(?:${m[v.PRERELEASE]})?(?:${m[v.BUILD]})?(?:$|[^\\d])`),S("COERCERTL",m[v.COERCE],!0),S("COERCERTLFULL",m[v.COERCEFULL],!0),S("LONETILDE","(?:~>?)"),S("TILDETRIM",`(\\s*)${m[v.LONETILDE]}\\s+`,!0),n.tildeTrimReplace="$1~",S("TILDE",`^${m[v.LONETILDE]}${m[v.XRANGEPLAIN]}$`),S("TILDELOOSE",`^${m[v.LONETILDE]}${m[v.XRANGEPLAINLOOSE]}$`),S("LONECARET","(?:\\^)"),S("CARETTRIM",`(\\s*)${m[v.LONECARET]}\\s+`,!0),n.caretTrimReplace="$1^",S("CARET",`^${m[v.LONECARET]}${m[v.XRANGEPLAIN]}$`),S("CARETLOOSE",`^${m[v.LONECARET]}${m[v.XRANGEPLAINLOOSE]}$`),S("COMPARATORLOOSE",`^${m[v.GTLT]}\\s*(${m[v.LOOSEPLAIN]})$|^$`),S("COMPARATOR",`^${m[v.GTLT]}\\s*(${m[v.FULLPLAIN]})$|^$`),S("COMPARATORTRIM",`(\\s*)${m[v.GTLT]}\\s*(${m[v.LOOSEPLAIN]}|${m[v.XRANGEPLAIN]})`,!0),n.comparatorTrimReplace="$1$2$3",S("HYPHENRANGE",`^\\s*(${m[v.XRANGEPLAIN]})\\s+-\\s+(${m[v.XRANGEPLAIN]})\\s*$`),S("HYPHENRANGELOOSE",`^\\s*(${m[v.XRANGEPLAINLOOSE]})\\s+-\\s+(${m[v.XRANGEPLAINLOOSE]})\\s*$`),S("STAR","(<|>)?=?\\s*\\*"),S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Wo,Wo.exports)),Wo.exports}var Cf,a1;function Qm(){if(a1)return Cf;a1=1;const a=Object.freeze({loose:!0}),n=Object.freeze({});return Cf=o=>o?typeof o!="object"?a:o:n,Cf}var Ef,i1;function tS(){if(i1)return Ef;i1=1;const a=/^[0-9]+$/,n=(o,c)=>{const d=a.test(o),f=a.test(c);return d&&f&&(o=+o,c=+c),o===c?0:d&&!f?-1:f&&!d?1:o<c?-1:1};return Ef={compareIdentifiers:n,rcompareIdentifiers:(o,c)=>n(c,o)},Ef}var Df,l1;function Jt(){if(l1)return Df;l1=1;const a=Hc(),{MAX_LENGTH:n,MAX_SAFE_INTEGER:l}=qc(),{safeRe:o,t:c}=Ds(),d=Qm(),{compareIdentifiers:f}=tS();class p{constructor(g,v){if(v=d(v),g instanceof p){if(g.loose===!!v.loose&&g.includePrerelease===!!v.includePrerelease)return g;g=g.version}else if(typeof g!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof g}".`);if(g.length>n)throw new TypeError(`version is longer than ${n} characters`);a("SemVer",g,v),this.options=v,this.loose=!!v.loose,this.includePrerelease=!!v.includePrerelease;const b=g.trim().match(v.loose?o[c.LOOSE]:o[c.FULL]);if(!b)throw new TypeError(`Invalid Version: ${g}`);if(this.raw=g,this.major=+b[1],this.minor=+b[2],this.patch=+b[3],this.major>l||this.major<0)throw new TypeError("Invalid major version");if(this.minor>l||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>l||this.patch<0)throw new TypeError("Invalid patch version");b[4]?this.prerelease=b[4].split(".").map(x=>{if(/^[0-9]+$/.test(x)){const j=+x;if(j>=0&&j<l)return j}return x}):this.prerelease=[],this.build=b[5]?b[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(g){if(a("SemVer.compare",this.version,this.options,g),!(g instanceof p)){if(typeof g=="string"&&g===this.version)return 0;g=new p(g,this.options)}return g.version===this.version?0:this.compareMain(g)||this.comparePre(g)}compareMain(g){return g instanceof p||(g=new p(g,this.options)),f(this.major,g.major)||f(this.minor,g.minor)||f(this.patch,g.patch)}comparePre(g){if(g instanceof p||(g=new p(g,this.options)),this.prerelease.length&&!g.prerelease.length)return-1;if(!this.prerelease.length&&g.prerelease.length)return 1;if(!this.prerelease.length&&!g.prerelease.length)return 0;let v=0;do{const b=this.prerelease[v],x=g.prerelease[v];if(a("prerelease compare",v,b,x),b===void 0&&x===void 0)return 0;if(x===void 0)return 1;if(b===void 0)return-1;if(b===x)continue;return f(b,x)}while(++v)}compareBuild(g){g instanceof p||(g=new p(g,this.options));let v=0;do{const b=this.build[v],x=g.build[v];if(a("build compare",v,b,x),b===void 0&&x===void 0)return 0;if(x===void 0)return 1;if(b===void 0)return-1;if(b===x)continue;return f(b,x)}while(++v)}inc(g,v,b){if(g.startsWith("pre")){if(!v&&b===!1)throw new Error("invalid increment argument: identifier is empty");if(v){const x=`-${v}`.match(this.options.loose?o[c.PRERELEASELOOSE]:o[c.PRERELEASE]);if(!x||x[1]!==v)throw new Error(`invalid identifier: ${v}`)}}switch(g){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",v,b);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",v,b);break;case"prepatch":this.prerelease.length=0,this.inc("patch",v,b),this.inc("pre",v,b);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",v,b),this.inc("pre",v,b);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const x=Number(b)?1:0;if(this.prerelease.length===0)this.prerelease=[x];else{let j=this.prerelease.length;for(;--j>=0;)typeof this.prerelease[j]=="number"&&(this.prerelease[j]++,j=-2);if(j===-1){if(v===this.prerelease.join(".")&&b===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(x)}}if(v){let j=[v,x];b===!1&&(j=[v]),f(this.prerelease[0],v)===0?isNaN(this.prerelease[1])&&(this.prerelease=j):this.prerelease=j}break}default:throw new Error(`invalid increment argument: ${g}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Df=p,Df}var Tf,r1;function Jl(){if(r1)return Tf;r1=1;const a=Jt();return Tf=(l,o,c=!1)=>{if(l instanceof a)return l;try{return new a(l,o)}catch(d){if(!c)return null;throw d}},Tf}var Rf,s1;function y8(){if(s1)return Rf;s1=1;const a=Jl();return Rf=(l,o)=>{const c=a(l,o);return c?c.version:null},Rf}var Nf,o1;function x8(){if(o1)return Nf;o1=1;const a=Jl();return Nf=(l,o)=>{const c=a(l.trim().replace(/^[=v]+/,""),o);return c?c.version:null},Nf}var Mf,c1;function j8(){if(c1)return Mf;c1=1;const a=Jt();return Mf=(l,o,c,d,f)=>{typeof c=="string"&&(f=d,d=c,c=void 0);try{return new a(l instanceof a?l.version:l,c).inc(o,d,f).version}catch{return null}},Mf}var Af,u1;function S8(){if(u1)return Af;u1=1;const a=Jl();return Af=(l,o)=>{const c=a(l,null,!0),d=a(o,null,!0),f=c.compare(d);if(f===0)return null;const p=f>0,m=p?c:d,g=p?d:c,v=!!m.prerelease.length;if(!!g.prerelease.length&&!v){if(!g.patch&&!g.minor)return"major";if(g.compareMain(m)===0)return g.minor&&!g.patch?"minor":"patch"}const x=v?"pre":"";return c.major!==d.major?x+"major":c.minor!==d.minor?x+"minor":c.patch!==d.patch?x+"patch":"prerelease"},Af}var $f,d1;function w8(){if(d1)return $f;d1=1;const a=Jt();return $f=(l,o)=>new a(l,o).major,$f}var Lf,f1;function C8(){if(f1)return Lf;f1=1;const a=Jt();return Lf=(l,o)=>new a(l,o).minor,Lf}var Of,h1;function E8(){if(h1)return Of;h1=1;const a=Jt();return Of=(l,o)=>new a(l,o).patch,Of}var Uf,m1;function D8(){if(m1)return Uf;m1=1;const a=Jl();return Uf=(l,o)=>{const c=a(l,o);return c&&c.prerelease.length?c.prerelease:null},Uf}var zf,p1;function Wn(){if(p1)return zf;p1=1;const a=Jt();return zf=(l,o,c)=>new a(l,c).compare(new a(o,c)),zf}var Bf,g1;function T8(){if(g1)return Bf;g1=1;const a=Wn();return Bf=(l,o,c)=>a(o,l,c),Bf}var _f,v1;function R8(){if(v1)return _f;v1=1;const a=Wn();return _f=(l,o)=>a(l,o,!0),_f}var Ff,b1;function Km(){if(b1)return Ff;b1=1;const a=Jt();return Ff=(l,o,c)=>{const d=new a(l,c),f=new a(o,c);return d.compare(f)||d.compareBuild(f)},Ff}var qf,y1;function N8(){if(y1)return qf;y1=1;const a=Km();return qf=(l,o)=>l.sort((c,d)=>a(c,d,o)),qf}var Hf,x1;function M8(){if(x1)return Hf;x1=1;const a=Km();return Hf=(l,o)=>l.sort((c,d)=>a(d,c,o)),Hf}var Pf,j1;function Pc(){if(j1)return Pf;j1=1;const a=Wn();return Pf=(l,o,c)=>a(l,o,c)>0,Pf}var kf,S1;function Zm(){if(S1)return kf;S1=1;const a=Wn();return kf=(l,o,c)=>a(l,o,c)<0,kf}var If,w1;function nS(){if(w1)return If;w1=1;const a=Wn();return If=(l,o,c)=>a(l,o,c)===0,If}var Vf,C1;function aS(){if(C1)return Vf;C1=1;const a=Wn();return Vf=(l,o,c)=>a(l,o,c)!==0,Vf}var Gf,E1;function Wm(){if(E1)return Gf;E1=1;const a=Wn();return Gf=(l,o,c)=>a(l,o,c)>=0,Gf}var Yf,D1;function Jm(){if(D1)return Yf;D1=1;const a=Wn();return Yf=(l,o,c)=>a(l,o,c)<=0,Yf}var Xf,T1;function iS(){if(T1)return Xf;T1=1;const a=nS(),n=aS(),l=Pc(),o=Wm(),c=Zm(),d=Jm();return Xf=(p,m,g,v)=>{switch(m){case"===":return typeof p=="object"&&(p=p.version),typeof g=="object"&&(g=g.version),p===g;case"!==":return typeof p=="object"&&(p=p.version),typeof g=="object"&&(g=g.version),p!==g;case"":case"=":case"==":return a(p,g,v);case"!=":return n(p,g,v);case">":return l(p,g,v);case">=":return o(p,g,v);case"<":return c(p,g,v);case"<=":return d(p,g,v);default:throw new TypeError(`Invalid operator: ${m}`)}},Xf}var Qf,R1;function A8(){if(R1)return Qf;R1=1;const a=Jt(),n=Jl(),{safeRe:l,t:o}=Ds();return Qf=(d,f)=>{if(d instanceof a)return d;if(typeof d=="number"&&(d=String(d)),typeof d!="string")return null;f=f||{};let p=null;if(!f.rtl)p=d.match(f.includePrerelease?l[o.COERCEFULL]:l[o.COERCE]);else{const j=f.includePrerelease?l[o.COERCERTLFULL]:l[o.COERCERTL];let D;for(;(D=j.exec(d))&&(!p||p.index+p[0].length!==d.length);)(!p||D.index+D[0].length!==p.index+p[0].length)&&(p=D),j.lastIndex=D.index+D[1].length+D[2].length;j.lastIndex=-1}if(p===null)return null;const m=p[2],g=p[3]||"0",v=p[4]||"0",b=f.includePrerelease&&p[5]?`-${p[5]}`:"",x=f.includePrerelease&&p[6]?`+${p[6]}`:"";return n(`${m}.${g}.${v}${b}${x}`,f)},Qf}var Kf,N1;function $8(){if(N1)return Kf;N1=1;class a{constructor(){this.max=1e3,this.map=new Map}get(l){const o=this.map.get(l);if(o!==void 0)return this.map.delete(l),this.map.set(l,o),o}delete(l){return this.map.delete(l)}set(l,o){if(!this.delete(l)&&o!==void 0){if(this.map.size>=this.max){const d=this.map.keys().next().value;this.delete(d)}this.map.set(l,o)}return this}}return Kf=a,Kf}var Zf,M1;function Jn(){if(M1)return Zf;M1=1;const a=/\s+/g;class n{constructor(W,U){if(U=c(U),W instanceof n)return W.loose===!!U.loose&&W.includePrerelease===!!U.includePrerelease?W:new n(W.raw,U);if(W instanceof d)return this.raw=W.value,this.set=[[W]],this.formatted=void 0,this;if(this.options=U,this.loose=!!U.loose,this.includePrerelease=!!U.includePrerelease,this.raw=W.trim().replace(a," "),this.set=this.raw.split("||").map(k=>this.parseRange(k.trim())).filter(k=>k.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const k=this.set[0];if(this.set=this.set.filter(Y=>!S(Y[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(const Y of this.set)if(Y.length===1&&R(Y[0])){this.set=[Y];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let W=0;W<this.set.length;W++){W>0&&(this.formatted+="||");const U=this.set[W];for(let k=0;k<U.length;k++)k>0&&(this.formatted+=" "),this.formatted+=U[k].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(W){const k=((this.options.includePrerelease&&j)|(this.options.loose&&D))+":"+W,Y=o.get(k);if(Y)return Y;const ne=this.options.loose,re=ne?m[g.HYPHENRANGELOOSE]:m[g.HYPHENRANGE];W=W.replace(re,se(this.options.includePrerelease)),f("hyphen replace",W),W=W.replace(m[g.COMPARATORTRIM],v),f("comparator trim",W),W=W.replace(m[g.TILDETRIM],b),f("tilde trim",W),W=W.replace(m[g.CARETTRIM],x),f("caret trim",W);let ge=W.split(" ").map(je=>A(je,this.options)).join(" ").split(/\s+/).map(je=>ae(je,this.options));ne&&(ge=ge.filter(je=>(f("loose invalid filter",je,this.options),!!je.match(m[g.COMPARATORLOOSE])))),f("range list",ge);const ie=new Map,ce=ge.map(je=>new d(je,this.options));for(const je of ce){if(S(je))return[je];ie.set(je.value,je)}ie.size>1&&ie.has("")&&ie.delete("");const Se=[...ie.values()];return o.set(k,Se),Se}intersects(W,U){if(!(W instanceof n))throw new TypeError("a Range is required");return this.set.some(k=>E(k,U)&&W.set.some(Y=>E(Y,U)&&k.every(ne=>Y.every(re=>ne.intersects(re,U)))))}test(W){if(!W)return!1;if(typeof W=="string")try{W=new p(W,this.options)}catch{return!1}for(let U=0;U<this.set.length;U++)if(Ee(this.set[U],W,this.options))return!0;return!1}}Zf=n;const l=$8(),o=new l,c=Qm(),d=kc(),f=Hc(),p=Jt(),{safeRe:m,t:g,comparatorTrimReplace:v,tildeTrimReplace:b,caretTrimReplace:x}=Ds(),{FLAG_INCLUDE_PRERELEASE:j,FLAG_LOOSE:D}=qc(),S=G=>G.value==="<0.0.0-0",R=G=>G.value==="",E=(G,W)=>{let U=!0;const k=G.slice();let Y=k.pop();for(;U&&k.length;)U=k.every(ne=>Y.intersects(ne,W)),Y=k.pop();return U},A=(G,W)=>(f("comp",G,W),G=K(G,W),f("caret",G),G=H(G,W),f("tildes",G),G=O(G,W),f("xrange",G),G=te(G,W),f("stars",G),G),B=G=>!G||G.toLowerCase()==="x"||G==="*",H=(G,W)=>G.trim().split(/\s+/).map(U=>V(U,W)).join(" "),V=(G,W)=>{const U=W.loose?m[g.TILDELOOSE]:m[g.TILDE];return G.replace(U,(k,Y,ne,re,ge)=>{f("tilde",G,k,Y,ne,re,ge);let ie;return B(Y)?ie="":B(ne)?ie=`>=${Y}.0.0 <${+Y+1}.0.0-0`:B(re)?ie=`>=${Y}.${ne}.0 <${Y}.${+ne+1}.0-0`:ge?(f("replaceTilde pr",ge),ie=`>=${Y}.${ne}.${re}-${ge} <${Y}.${+ne+1}.0-0`):ie=`>=${Y}.${ne}.${re} <${Y}.${+ne+1}.0-0`,f("tilde return",ie),ie})},K=(G,W)=>G.trim().split(/\s+/).map(U=>T(U,W)).join(" "),T=(G,W)=>{f("caret",G,W);const U=W.loose?m[g.CARETLOOSE]:m[g.CARET],k=W.includePrerelease?"-0":"";return G.replace(U,(Y,ne,re,ge,ie)=>{f("caret",G,Y,ne,re,ge,ie);let ce;return B(ne)?ce="":B(re)?ce=`>=${ne}.0.0${k} <${+ne+1}.0.0-0`:B(ge)?ne==="0"?ce=`>=${ne}.${re}.0${k} <${ne}.${+re+1}.0-0`:ce=`>=${ne}.${re}.0${k} <${+ne+1}.0.0-0`:ie?(f("replaceCaret pr",ie),ne==="0"?re==="0"?ce=`>=${ne}.${re}.${ge}-${ie} <${ne}.${re}.${+ge+1}-0`:ce=`>=${ne}.${re}.${ge}-${ie} <${ne}.${+re+1}.0-0`:ce=`>=${ne}.${re}.${ge}-${ie} <${+ne+1}.0.0-0`):(f("no pr"),ne==="0"?re==="0"?ce=`>=${ne}.${re}.${ge}${k} <${ne}.${re}.${+ge+1}-0`:ce=`>=${ne}.${re}.${ge}${k} <${ne}.${+re+1}.0-0`:ce=`>=${ne}.${re}.${ge} <${+ne+1}.0.0-0`),f("caret return",ce),ce})},O=(G,W)=>(f("replaceXRanges",G,W),G.split(/\s+/).map(U=>Q(U,W)).join(" ")),Q=(G,W)=>{G=G.trim();const U=W.loose?m[g.XRANGELOOSE]:m[g.XRANGE];return G.replace(U,(k,Y,ne,re,ge,ie)=>{f("xRange",G,k,Y,ne,re,ge,ie);const ce=B(ne),Se=ce||B(re),je=Se||B(ge),Ue=je;return Y==="="&&Ue&&(Y=""),ie=W.includePrerelease?"-0":"",ce?Y===">"||Y==="<"?k="<0.0.0-0":k="*":Y&&Ue?(Se&&(re=0),ge=0,Y===">"?(Y=">=",Se?(ne=+ne+1,re=0,ge=0):(re=+re+1,ge=0)):Y==="<="&&(Y="<",Se?ne=+ne+1:re=+re+1),Y==="<"&&(ie="-0"),k=`${Y+ne}.${re}.${ge}${ie}`):Se?k=`>=${ne}.0.0${ie} <${+ne+1}.0.0-0`:je&&(k=`>=${ne}.${re}.0${ie} <${ne}.${+re+1}.0-0`),f("xRange return",k),k})},te=(G,W)=>(f("replaceStars",G,W),G.trim().replace(m[g.STAR],"")),ae=(G,W)=>(f("replaceGTE0",G,W),G.trim().replace(m[W.includePrerelease?g.GTE0PRE:g.GTE0],"")),se=G=>(W,U,k,Y,ne,re,ge,ie,ce,Se,je,Ue)=>(B(k)?U="":B(Y)?U=`>=${k}.0.0${G?"-0":""}`:B(ne)?U=`>=${k}.${Y}.0${G?"-0":""}`:re?U=`>=${U}`:U=`>=${U}${G?"-0":""}`,B(ce)?ie="":B(Se)?ie=`<${+ce+1}.0.0-0`:B(je)?ie=`<${ce}.${+Se+1}.0-0`:Ue?ie=`<=${ce}.${Se}.${je}-${Ue}`:G?ie=`<${ce}.${Se}.${+je+1}-0`:ie=`<=${ie}`,`${U} ${ie}`.trim()),Ee=(G,W,U)=>{for(let k=0;k<G.length;k++)if(!G[k].test(W))return!1;if(W.prerelease.length&&!U.includePrerelease){for(let k=0;k<G.length;k++)if(f(G[k].semver),G[k].semver!==d.ANY&&G[k].semver.prerelease.length>0){const Y=G[k].semver;if(Y.major===W.major&&Y.minor===W.minor&&Y.patch===W.patch)return!0}return!1}return!0};return Zf}var Wf,A1;function kc(){if(A1)return Wf;A1=1;const a=Symbol("SemVer ANY");class n{static get ANY(){return a}constructor(v,b){if(b=l(b),v instanceof n){if(v.loose===!!b.loose)return v;v=v.value}v=v.trim().split(/\s+/).join(" "),f("comparator",v,b),this.options=b,this.loose=!!b.loose,this.parse(v),this.semver===a?this.value="":this.value=this.operator+this.semver.version,f("comp",this)}parse(v){const b=this.options.loose?o[c.COMPARATORLOOSE]:o[c.COMPARATOR],x=v.match(b);if(!x)throw new TypeError(`Invalid comparator: ${v}`);this.operator=x[1]!==void 0?x[1]:"",this.operator==="="&&(this.operator=""),x[2]?this.semver=new p(x[2],this.options.loose):this.semver=a}toString(){return this.value}test(v){if(f("Comparator.test",v,this.options.loose),this.semver===a||v===a)return!0;if(typeof v=="string")try{v=new p(v,this.options)}catch{return!1}return d(v,this.operator,this.semver,this.options)}intersects(v,b){if(!(v instanceof n))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new m(v.value,b).test(this.value):v.operator===""?v.value===""?!0:new m(this.value,b).test(v.semver):(b=l(b),b.includePrerelease&&(this.value==="<0.0.0-0"||v.value==="<0.0.0-0")||!b.includePrerelease&&(this.value.startsWith("<0.0.0")||v.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&v.operator.startsWith(">")||this.operator.startsWith("<")&&v.operator.startsWith("<")||this.semver.version===v.semver.version&&this.operator.includes("=")&&v.operator.includes("=")||d(this.semver,"<",v.semver,b)&&this.operator.startsWith(">")&&v.operator.startsWith("<")||d(this.semver,">",v.semver,b)&&this.operator.startsWith("<")&&v.operator.startsWith(">")))}}Wf=n;const l=Qm(),{safeRe:o,t:c}=Ds(),d=iS(),f=Hc(),p=Jt(),m=Jn();return Wf}var Jf,$1;function Ic(){if($1)return Jf;$1=1;const a=Jn();return Jf=(l,o,c)=>{try{o=new a(o,c)}catch{return!1}return o.test(l)},Jf}var eh,L1;function L8(){if(L1)return eh;L1=1;const a=Jn();return eh=(l,o)=>new a(l,o).set.map(c=>c.map(d=>d.value).join(" ").trim().split(" ")),eh}var th,O1;function O8(){if(O1)return th;O1=1;const a=Jt(),n=Jn();return th=(o,c,d)=>{let f=null,p=null,m=null;try{m=new n(c,d)}catch{return null}return o.forEach(g=>{m.test(g)&&(!f||p.compare(g)===-1)&&(f=g,p=new a(f,d))}),f},th}var nh,U1;function U8(){if(U1)return nh;U1=1;const a=Jt(),n=Jn();return nh=(o,c,d)=>{let f=null,p=null,m=null;try{m=new n(c,d)}catch{return null}return o.forEach(g=>{m.test(g)&&(!f||p.compare(g)===1)&&(f=g,p=new a(f,d))}),f},nh}var ah,z1;function z8(){if(z1)return ah;z1=1;const a=Jt(),n=Jn(),l=Pc();return ah=(c,d)=>{c=new n(c,d);let f=new a("0.0.0");if(c.test(f)||(f=new a("0.0.0-0"),c.test(f)))return f;f=null;for(let p=0;p<c.set.length;++p){const m=c.set[p];let g=null;m.forEach(v=>{const b=new a(v.semver.version);switch(v.operator){case">":b.prerelease.length===0?b.patch++:b.prerelease.push(0),b.raw=b.format();case"":case">=":(!g||l(b,g))&&(g=b);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${v.operator}`)}}),g&&(!f||l(f,g))&&(f=g)}return f&&c.test(f)?f:null},ah}var ih,B1;function B8(){if(B1)return ih;B1=1;const a=Jn();return ih=(l,o)=>{try{return new a(l,o).range||"*"}catch{return null}},ih}var lh,_1;function ep(){if(_1)return lh;_1=1;const a=Jt(),n=kc(),{ANY:l}=n,o=Jn(),c=Ic(),d=Pc(),f=Zm(),p=Jm(),m=Wm();return lh=(v,b,x,j)=>{v=new a(v,j),b=new o(b,j);let D,S,R,E,A;switch(x){case">":D=d,S=p,R=f,E=">",A=">=";break;case"<":D=f,S=m,R=d,E="<",A="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(c(v,b,j))return!1;for(let B=0;B<b.set.length;++B){const H=b.set[B];let V=null,K=null;if(H.forEach(T=>{T.semver===l&&(T=new n(">=0.0.0")),V=V||T,K=K||T,D(T.semver,V.semver,j)?V=T:R(T.semver,K.semver,j)&&(K=T)}),V.operator===E||V.operator===A||(!K.operator||K.operator===E)&&S(v,K.semver))return!1;if(K.operator===A&&R(v,K.semver))return!1}return!0},lh}var rh,F1;function _8(){if(F1)return rh;F1=1;const a=ep();return rh=(l,o,c)=>a(l,o,">",c),rh}var sh,q1;function F8(){if(q1)return sh;q1=1;const a=ep();return sh=(l,o,c)=>a(l,o,"<",c),sh}var oh,H1;function q8(){if(H1)return oh;H1=1;const a=Jn();return oh=(l,o,c)=>(l=new a(l,c),o=new a(o,c),l.intersects(o,c)),oh}var ch,P1;function H8(){if(P1)return ch;P1=1;const a=Ic(),n=Wn();return ch=(l,o,c)=>{const d=[];let f=null,p=null;const m=l.sort((x,j)=>n(x,j,c));for(const x of m)a(x,o,c)?(p=x,f||(f=x)):(p&&d.push([f,p]),p=null,f=null);f&&d.push([f,null]);const g=[];for(const[x,j]of d)x===j?g.push(x):!j&&x===m[0]?g.push("*"):j?x===m[0]?g.push(`<=${j}`):g.push(`${x} - ${j}`):g.push(`>=${x}`);const v=g.join(" || "),b=typeof o.raw=="string"?o.raw:String(o);return v.length<b.length?v:o},ch}var uh,k1;function P8(){if(k1)return uh;k1=1;const a=Jn(),n=kc(),{ANY:l}=n,o=Ic(),c=Wn(),d=(b,x,j={})=>{if(b===x)return!0;b=new a(b,j),x=new a(x,j);let D=!1;e:for(const S of b.set){for(const R of x.set){const E=m(S,R,j);if(D=D||E!==null,E)continue e}if(D)return!1}return!0},f=[new n(">=0.0.0-0")],p=[new n(">=0.0.0")],m=(b,x,j)=>{if(b===x)return!0;if(b.length===1&&b[0].semver===l){if(x.length===1&&x[0].semver===l)return!0;j.includePrerelease?b=f:b=p}if(x.length===1&&x[0].semver===l){if(j.includePrerelease)return!0;x=p}const D=new Set;let S,R;for(const O of b)O.operator===">"||O.operator===">="?S=g(S,O,j):O.operator==="<"||O.operator==="<="?R=v(R,O,j):D.add(O.semver);if(D.size>1)return null;let E;if(S&&R){if(E=c(S.semver,R.semver,j),E>0)return null;if(E===0&&(S.operator!==">="||R.operator!=="<="))return null}for(const O of D){if(S&&!o(O,String(S),j)||R&&!o(O,String(R),j))return null;for(const Q of x)if(!o(O,String(Q),j))return!1;return!0}let A,B,H,V,K=R&&!j.includePrerelease&&R.semver.prerelease.length?R.semver:!1,T=S&&!j.includePrerelease&&S.semver.prerelease.length?S.semver:!1;K&&K.prerelease.length===1&&R.operator==="<"&&K.prerelease[0]===0&&(K=!1);for(const O of x){if(V=V||O.operator===">"||O.operator===">=",H=H||O.operator==="<"||O.operator==="<=",S){if(T&&O.semver.prerelease&&O.semver.prerelease.length&&O.semver.major===T.major&&O.semver.minor===T.minor&&O.semver.patch===T.patch&&(T=!1),O.operator===">"||O.operator===">="){if(A=g(S,O,j),A===O&&A!==S)return!1}else if(S.operator===">="&&!o(S.semver,String(O),j))return!1}if(R){if(K&&O.semver.prerelease&&O.semver.prerelease.length&&O.semver.major===K.major&&O.semver.minor===K.minor&&O.semver.patch===K.patch&&(K=!1),O.operator==="<"||O.operator==="<="){if(B=v(R,O,j),B===O&&B!==R)return!1}else if(R.operator==="<="&&!o(R.semver,String(O),j))return!1}if(!O.operator&&(R||S)&&E!==0)return!1}return!(S&&H&&!R&&E!==0||R&&V&&!S&&E!==0||T||K)},g=(b,x,j)=>{if(!b)return x;const D=c(b.semver,x.semver,j);return D>0?b:D<0||x.operator===">"&&b.operator===">="?x:b},v=(b,x,j)=>{if(!b)return x;const D=c(b.semver,x.semver,j);return D<0?b:D>0||x.operator==="<"&&b.operator==="<="?x:b};return uh=d,uh}var dh,I1;function k8(){if(I1)return dh;I1=1;const a=Ds(),n=qc(),l=Jt(),o=tS(),c=Jl(),d=y8(),f=x8(),p=j8(),m=S8(),g=w8(),v=C8(),b=E8(),x=D8(),j=Wn(),D=T8(),S=R8(),R=Km(),E=N8(),A=M8(),B=Pc(),H=Zm(),V=nS(),K=aS(),T=Wm(),O=Jm(),Q=iS(),te=A8(),ae=kc(),se=Jn(),Ee=Ic(),G=L8(),W=O8(),U=U8(),k=z8(),Y=B8(),ne=ep(),re=_8(),ge=F8(),ie=q8(),ce=H8(),Se=P8();return dh={parse:c,valid:d,clean:f,inc:p,diff:m,major:g,minor:v,patch:b,prerelease:x,compare:j,rcompare:D,compareLoose:S,compareBuild:R,sort:E,rsort:A,gt:B,lt:H,eq:V,neq:K,gte:T,lte:O,cmp:Q,coerce:te,Comparator:ae,Range:se,satisfies:Ee,toComparators:G,maxSatisfying:W,minSatisfying:U,minVersion:k,validRange:Y,outside:ne,gtr:re,ltr:ge,intersects:ie,simplifyRange:ce,subset:Se,SemVer:l,re:a.re,src:a.src,tokens:a.t,SEMVER_SPEC_VERSION:n.SEMVER_SPEC_VERSION,RELEASE_TYPES:n.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers},dh}var I8=k8();const V8=Em(I8),{createPluginImplementationStore:G8,isMigrateableProjectDefinition:Y8,ProjectDefinitionContainer:X8,runPluginMigrations:Q8,runSchemaMigrations:K8,SchemaMigrationError:Z8}=await C("@baseplate-dev/project-builder-lib"),{ZodError:W8}=await C("zod");function J8(a,n){try{const l=JSON.parse(a);if(!Y8(l))throw new da("The project configuration is not valid project definition with a schemaVersion property. Please check the file and try again.");const{migratedDefinition:o}=K8(l),c=G8(n.pluginStore,o),d=Q8(o,c);return X8.fromSerializedConfig(d,n)}catch(l){throw l instanceof SyntaxError?new da("The project configuration is not a valid JSON file. Please check the file and try again."):l instanceof W8?new da(`The project configuration is not valid: ${VE(l)}`):l instanceof Z8?new da(l.message):l}}const{useCallback:e7,useEffect:t7,useMemo:n7,useRef:a7}=await C("react");function i7({schemaParserContext:a,projectDefinitionFilePayload:n}){const l=a7(void 0),{projectDefinitionContainer:o,error:c}=n7(()=>{try{return!a||!n?{projectDefinitionContainer:void 0,error:void 0}:l.current?.contents===n.contents?{projectDefinitionContainer:{container:l.current.container,hash:n.hash},error:void 0}:{projectDefinitionContainer:{container:J8(n.contents,a),hash:n.hash},error:void 0}}catch(d){return{projectDefinitionContainer:void 0,error:d}}},[a,n]);return t7(()=>{c&&console.error(c)},[c]),{projectDefinitionContainer:o?.container,cacheProjectDefinitionContainer:e7((d,f)=>{l.current={container:d,contents:f}},[]),error:c}}class l7{projectId;_definitionFileContentsHash;_pendingDefinitionFileContentsHash;constructor(n){this.projectId=n}async downloadDefinitionContents(){const{contents:n,hash:l}=await iD(this.projectId),o=this._pendingDefinitionFileContentsHash!==l&&this._definitionFileContentsHash!==l;return this._definitionFileContentsHash=l,{contents:n,hash:l,updatedExternally:o}}async uploadDefinitionContents(n){if(!this._definitionFileContentsHash)throw new Error("Definition file must be downloaded before uploading");if(this._pendingDefinitionFileContentsHash)throw new Error("Only one upload can be pending at a time. Please wait for the current upload to complete before uploading again.");try{this._pendingDefinitionFileContentsHash=await yj(n);const l=await lD(this.projectId,n,this._definitionFileContentsHash);return l.type==="original-contents-mismatch"?(this._definitionFileContentsHash=l.currentPayload.hash,{contents:l.currentPayload.contents,hash:l.currentPayload.hash,updatedExternally:!0}):(this._definitionFileContentsHash=this._pendingDefinitionFileContentsHash,{contents:n,hash:this._pendingDefinitionFileContentsHash,updatedExternally:!1})}finally{this._pendingDefinitionFileContentsHash=void 0}}listenForDefinitionFileChanges(n){return rD(this.projectId,l=>{this._definitionFileContentsHash!==l.hash&&(this._definitionFileContentsHash=l.hash,n({contents:l.contents,hash:l.hash,updatedExternally:this._pendingDefinitionFileContentsHash!==l.hash}))})}}const{useCallback:r7,useEffect:s7,useState:fh}=await C("react");function o7(){const[a,n]=fh(),[l,o]=fh(),[c,d]=fh(),{currentProjectId:f,projectsLoaded:p,resetCurrentProjectId:m}=Cn();s7(()=>{if(n(void 0),o(void 0),!f||!p){d(void 0);return}const v=new l7(f);return d(v),v.downloadDefinitionContents().then(b=>{n(b)}).catch(b=>{b instanceof Dc?m():o(b)}),v.listenForDefinitionFileChanges(b=>{n(b)})},[f,p,m]);const g=r7(async v=>{if(!c)throw new Error("Project definition file manager not found");await c.uploadDefinitionContents(v).then(b=>{n(b)}).catch(b=>{throw b instanceof Dc&&m(),b})},[c,m]);return{projectDefinitionFilePayload:a,uploadProjectDefinitionContents:g,error:l}}function c7(a,n){return()=>{}}const lS={placeholder:{url:"http://localhost:3001/remoteEntry.js",format:"esm",from:"vite"}},V1={},u7=async(a,n)=>{const l=typeof a=="function"?await a():a,o=document.createElement("script");o.type="text/javascript",o.onload=n,o.src=l,document.getElementsByTagName("head")[0].appendChild(o)};function Ll(a,n){return d7(a).then(l=>()=>n==="webpack"&&Object.prototype.toString.call(l).indexOf("Module")>-1&&l.default?l.default:l)}function rS(a,n){const l=Object.assign(a,n);for(const o of Object.keys(l))typeof l[o]=="object"&&typeof n[o]=="object"&&(l[o]=rS(l[o],n[o]));return l}const G1=a=>rS({react:{"19.1.0":{get:()=>Ll(new URL("__federation_shared_react-CTQ9xfiH.js",import.meta.url).href,a),loaded:1}},"react-dom":{"19.1.0":{get:()=>Ll(new URL("__federation_shared_react-dom-DPv53nVg.js",import.meta.url).href,a),loaded:1}},zod:{"3.24.1":{get:()=>Ll(new URL("__federation_shared_zod-DQ8g46gT.js",import.meta.url).href,a),loaded:1}},"@baseplate-dev/project-builder-lib":{"*":{get:()=>Ll(new URL("__federation_shared_@baseplate-dev/project-builder-lib-zvGcQ6PN.js",import.meta.url).href,a),loaded:1}},"@baseplate-dev/project-builder-lib/web":{"*":{get:()=>Ll(new URL("__federation_shared_@baseplate-dev/project-builder-lib/web-DNtY4wq3.js",import.meta.url).href,a),loaded:1}},"@baseplate-dev/ui-components":{"*":{get:()=>Ll(new URL("__federation_shared_@baseplate-dev/ui-components-DQh2UKHB.js",import.meta.url).href,a),loaded:1}}},(globalThis.__federation_shared__||{}).default||{});async function d7(a){return V1[a]??=import(a),V1[a]}async function f7(a){const n=lS[a];if(n.inited)return n.lib;if(n.format==="var")return new Promise(l=>{const o=()=>{n.inited||(n.lib=window[a],n.lib.init(G1(n.from)),n.inited=!0),l(n.lib)};return u7(n.url,o)});if(["esm","systemjs"].includes(n.format))return new Promise((l,o)=>{(typeof n.url=="function"?n.url:()=>Promise.resolve(n.url))().then(d=>{import(d).then(f=>{if(!n.inited){const p=G1(n.from);f.init(p),n.lib=f,n.lib.init(p),n.inited=!0}l(n.lib)}).catch(o)})})}function h7(a){return a?.__esModule||a?.[Symbol.toStringTag]==="Module"?a.default:a}function m7(a,n){return f7(a).then(l=>l.get(n).then(o=>o()))}function p7(a,n){lS[a]=n}let sS=Math.random();function g7(){sS=Math.random()}async function v7(a,n){const l=`${a}/${n.id}`,o=`/api/plugins/${a}/${n.id}/web/assets/remoteEntry.js?rnd=${sS}`;return p7(l,{url:o,externalType:"url",format:"esm",from:"vite"}),(await Promise.all(n.webModulePaths.map(p=>m7(l,p)))).map(p=>h7(p)).map((p,m)=>({key:n.webModulePaths[m],module:p}))}const{webConfigSpec:b7}=await C("@baseplate-dev/project-builder-lib"),{adminCrudInputWebSpec:y7,modelTransformerWebSpec:x7}=await C("@baseplate-dev/project-builder-lib/web");async function j7(a,n){return{pluginStore:{availablePlugins:await Promise.all(n.map(async l=>{const o=await v7(a,l);return{metadata:l,modules:o}})),builtinSpecImplementations:[b7,x7,y7]}}}class S7{projectId;_pluginsMetadata;_schemaParserContext;constructor(n){this.projectId=n}async loadSchemaParserContext(){return this._pluginsMetadata??=await aD(this.projectId),g7(),this._schemaParserContext=await j7(this.projectId,this._pluginsMetadata),this._schemaParserContext}listenForPluginAssetsChanges(n,l){return c7()}}const{toast:Y1}=await C("@baseplate-dev/ui-components"),{useEffect:w7,useState:X1}=await C("react");function C7(){const{currentProjectId:a,projectsLoaded:n}=Cn(),[l,o]=X1(void 0),[c,d]=X1();return w7(()=>{if(o(void 0),d(void 0),!a||!n)return;const f=new S7(a);return f.loadSchemaParserContext().then(p=>{o(p)}).catch(p=>{Y1.error(wn(p)),d(p)}),f.listenForPluginAssetsChanges(p=>{o(p)},p=>{Y1.error(wn(p))})},[a,n]),{schemaParserContext:l,error:c}}const Q1=(a,n,l)=>{if(a&&"reportValidity"in a){const o=lm(l,n);a.setCustomValidity(o&&o.message||""),a.reportValidity()}},oS=(a,n)=>{for(const l in n.fields){const o=n.fields[l];o&&o.ref&&"reportValidity"in o.ref?Q1(o.ref,l,a):o&&o.refs&&o.refs.forEach(c=>Q1(c,l,a))}},E7=(a,n)=>{n.shouldUseNativeValidation&&oS(a,n);const l={};for(const o in a){const c=lm(n.fields,o),d=Object.assign(a[o]||{},{ref:c&&c.ref});if(D7(n.names||Object.keys(a),o)){const f=Object.assign({},lm(l,o));Xd(f,"root",d),Xd(l,o,f)}else Xd(l,o,d)}return l},D7=(a,n)=>{const l=K1(n);return a.some(o=>K1(o).match(`^${l}\\.\\d+`))};function K1(a){return a.replace(/\]|\[/g,"")}function T7(a,n){for(var l={};a.length;){var o=a[0],c=o.code,d=o.message,f=o.path.join(".");if(!l[f])if("unionErrors"in o){var p=o.unionErrors[0].errors[0];l[f]={message:p.message,type:p.code}}else l[f]={message:d,type:c};if("unionErrors"in o&&o.unionErrors.forEach(function(v){return v.errors.forEach(function(b){return a.push(b)})}),n){var m=l[f].types,g=m&&m[o.code];l[f]=Lw(f,n,l,c,g?[].concat(g,o.message):o.message)}a.shift()}return l}function kt(a,n,l){return l===void 0&&(l={}),function(o,c,d){try{return Promise.resolve(function(f,p){try{var m=Promise.resolve(a[l.mode==="sync"?"parse":"parseAsync"](o,n)).then(function(g){return d.shouldUseNativeValidation&&oS({},d),{errors:{},values:l.raw?Object.assign({},o):g}})}catch(g){return p(g)}return m&&m.then?m.then(void 0,p):m}(0,function(f){if(function(p){return Array.isArray(p?.errors)}(f))return{values:{},errors:E7(T7(f.errors,!d.shouldUseNativeValidation&&d.criteriaMode==="all"),d)};throw f}))}catch(f){return Promise.reject(f)}}}const{generalSettingsSchema:R7}=await C("@baseplate-dev/project-builder-lib"),{Button:N7,Card:M7,CardContent:A7,InputFieldController:Z1,toast:$7}=await C("@baseplate-dev/ui-components");function L7({existingProject:a,saveProject:n}){const{control:l,handleSubmit:o,formState:{isSubmitting:c}}=gi({defaultValues:a?.settings.general,resolver:kt(R7)}),d=o(f=>{n(f).catch(p=>{$7.error(wn(p,"Failed to save project"))})});return s.jsx(M7,{className:"w-80 animate-in fade-in zoom-in-70 sm:w-120",children:s.jsxs(A7,{className:"flex flex-col space-y-4",children:[s.jsx("img",{className:"mx-auto w-16",src:"/images/logo.png",alt:"Baseplate Logo"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("h1",{className:"text-center",children:"Welcome to Baseplate"}),s.jsx("p",{className:"text-center text-style-lead",children:"Let's get you set up!"})]}),s.jsxs("form",{onSubmit:d,className:"flex flex-col space-y-4",children:[s.jsx(Z1,{name:"name",label:"Project Name",description:"Lowercase letters and dashes, e.g. my-project",control:l,placeholder:"e.g. my-project"}),s.jsx(Z1,{name:"portOffset",label:"Port Offset",description:"Multiple of 1000, e.g. 4000. This will offset the ports used by the project, e.g. API at 4001, database at 4432, to avoid conflicts with other projects.",control:l,registerOptions:{valueAsNumber:!0}}),s.jsx(N7,{className:"mx-auto",type:"submit",disabled:c,children:"Initialize Project"})]})]})})}const{createPluginImplementationStore:O7,createProjectDefinitionSchemaWithContext:U7,fixRefDeletions:z7,ProjectDefinitionContainer:B7}=await C("@baseplate-dev/project-builder-lib"),{ProjectDefinitionContext:_7}=await C("@baseplate-dev/project-builder-lib/web"),{Button:hh,ErrorableLoader:F7,ErrorDisplay:q7,toast:W1}=await C("@baseplate-dev/ui-components"),{useMemo:H7,useState:P7}=await C("react");function k7({children:a}){const{schemaParserContext:n,error:l}=C7(),{projectDefinitionFilePayload:o,uploadProjectDefinitionContents:c,error:d}=o7(),{projectDefinitionContainer:f,error:p,cacheProjectDefinitionContainer:m}=i7({schemaParserContext:n,projectDefinitionFilePayload:o}),{projects:g,resetCurrentProjectId:v}=Cn(),{version:b}=Jj(),{showRefIssues:x}=Sj(),[j,D]=P7(!1);hD();const S=!!o?.updatedExternally,R=H7(()=>{if(!f||!n)return;const{definition:A}=f,B=n;async function H(K){D(!0);try{const T=Jw(A,K),O=U7(T,B),Q=z7(O,T);if(Q.type==="failure")throw new yb(Q.issues);const te=Q.value;te.cliVersion=b;const ae=new B7(Q.refPayload,B,O.pluginStore),se=ae.toSerializedContents();m(ae,se),await c(se)}finally{D(!1)}}async function V(K,T={}){return H(K).then(()=>(W1.success(T.successMessage??"Successfully saved!"),T.onSuccess?.(),{success:!0})).catch(O=>(O instanceof yb&&!T.disableDeleteRefDialog?x({issues:O.issues}):W1.error(wn(O,"Failed to save project definition.")),{success:!1}))}return{definition:A,definitionContainer:f,saveDefinition:H,saveDefinitionWithFeedback:V,saveDefinitionWithFeedbackSync:(K,T)=>{V(K,T)},isSavingDefinition:j,pluginContainer:f.pluginStore,schemaParserContext:n,updatedExternally:S,definitionSchemaCreatorOptions:{plugins:O7(n.pluginStore,A)}}},[b,f,j,n,S,c,x,m]),E=l??d??p;return R?R.definition.isInitialized?R.definition.cliVersion&&b&&b!=="preview"&&V8.gt(R.definition.cliVersion,b)?s.jsx(q7,{header:"Upgrade your Baseplate client",actions:s.jsxs("div",{className:"flex flex-col space-y-4",children:[s.jsx(hh,{onClick:()=>{globalThis.location.reload()},children:"Refresh Page"}),g.length>1&&s.jsx(hh,{variant:"secondary",onClick:()=>{v()},children:"Switch Project"})]}),error:s.jsxs(s.Fragment,{children:["This project requires a newer version of the client (",R.definition.cliVersion,"). Please upgrade your client by running ",s.jsx("strong",{children:"pnpm install"}),"."]})}):s.jsx(_7.Provider,{value:R,children:a}):s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(L7,{existingProject:R.definition,saveProject:async A=>{await R.saveDefinition(B=>{B.settings.general={...A,packageScope:""},B.isInitialized=!0})}})}):s.jsx(F7,{error:E&&Gl(E,""),header:"Failed to load project config",actions:s.jsx("div",{className:"flex flex-col space-y-4",children:g.length>1&&s.jsx(hh,{variant:"secondary",onClick:()=>{v()},children:"Switch Project"})})})}const{Button:J1,Dialog:I7,DialogContent:V7,DialogHeader:G7,DialogTitle:Y7,Table:X7,TableBody:Q7,TableCell:mh,TableHead:ph,TableHeader:K7,TableRow:ey}=await C("@baseplate-dev/ui-components");function Z7({onClose:a,isOpen:n}){const{currentProjectId:l,setCurrentProjectId:o,projects:c}=Cn(),d=on();return s.jsx(I7,{onOpenChange:a??(()=>{}),open:n,children:s.jsxs(V7,{width:"lg",children:[s.jsx(G7,{children:s.jsx(Y7,{children:"Pick Project"})}),s.jsxs(X7,{children:[s.jsx(K7,{children:s.jsxs(ey,{children:[s.jsx(ph,{children:"Name"}),s.jsx(ph,{children:"Directory"}),s.jsx(ph,{})]})}),s.jsx(Q7,{children:c.map(f=>s.jsxs(ey,{children:[s.jsx(mh,{children:s.jsx("strong",{children:f.name})}),s.jsx(mh,{children:f.directory}),s.jsx(mh,{children:l===f.id?s.jsx(J1,{variant:"link",disabled:!0,children:"Selected"}):s.jsx(J1,{variant:"link",onClick:()=>{o(f.id),d("/"),a&&a()},children:"Select"})})]},f.id))})]})]})})}const{ErrorableLoader:W7}=await C("@baseplate-dev/ui-components"),{useEffect:ty,useState:J7}=await C("react");function eT({children:a}){const[n,l]=J7(),{currentProjectId:o,projectsLoaded:c,setProjects:d}=Cn();return ty(()=>{sD().then(f=>{d(f)}).catch(f=>{l(wn(f,"Failed to fetch projects."))})},[d]),ty(()=>{gj(o)},[o]),c?o?s.jsx(s.Fragment,{children:a}):s.jsx(Z7,{isOpen:!0}):s.jsx(W7,{error:n})}const{ErrorHandlerContext:tT}=await C("@baseplate-dev/project-builder-lib/web"),{ConfirmDialog:nT,Toaster:aT,TooltipProvider:iT}=await C("@baseplate-dev/ui-components"),{useMemo:lT}=await C("react");function rT(){const a=lT(()=>({formatError:Gl,logAndFormatError:wn,logError:_l}),[]);return s.jsx(Yl,{children:s.jsx(tT.Provider,{value:a,children:s.jsxs(iT,{children:[s.jsx(b8,{children:s.jsx(eT,{children:s.jsxs(k7,{children:[s.jsx(bi,{}),s.jsx(t5,{})]})})}),s.jsx(aT,{}),s.jsx(nT,{}),s.jsx(h6,{})]})})})}function Ts(){return s.jsx(zc,{})}const Rs={path:"*",element:s.jsx(Ts,{})},{appEntityType:ny,baseAppSchema:sT}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:oT}=await C("@baseplate-dev/project-builder-lib/web"),{Button:ay,Dialog:cT,DialogContent:uT,DialogDescription:dT,DialogFooter:fT,DialogHeader:hT,DialogTitle:mT,DialogTrigger:pT,InputFieldController:gT,SelectFieldController:vT,useControlledState:bT}=await C("@baseplate-dev/ui-components");function vm({children:a,open:n,onOpenChange:l}){const[o,c]=bT(n,l,!1),{saveDefinitionWithFeedback:d,isSavingDefinition:f}=oT(),p=on(),{control:m,handleSubmit:g,reset:v}=gi({resolver:kt(sT),defaultValues:{id:ny.generateNewId(),name:"",type:"backend"}}),b=[{label:"Backend App",value:"backend"},{label:"Web App",value:"web"},{label:"Admin App",value:"admin"}],x=g(D=>d(S=>{const R=[...S.apps,D];S.apps=Zn(R,[E=>E.name])},{successMessage:`Successfully created ${D.name}!`,onSuccess:()=>{c(!1),v(),p(`/apps/edit/${ny.keyFromId(D.id)}`)}})),j=D=>{c(D),D||v()};return s.jsxs(cT,{open:o,onOpenChange:j,children:[s.jsx(pT,{asChild:!0,children:a}),s.jsxs(uT,{className:"sm:max-w-md",children:[s.jsxs(hT,{children:[s.jsx(mT,{children:"Create New App"}),s.jsx(dT,{children:"Create a new application in your project. Choose the type that best fits your needs."})]}),s.jsxs("form",{onSubmit:D=>(D.stopPropagation(),x(D)),className:"space-y-4",children:[s.jsx(gT,{label:"Name",control:m,name:"name",placeholder:"e.g. backend, web, admin",description:"The name of the app, such as 'backend' or 'web'"}),s.jsx(vT,{label:"Type",control:m,name:"type",options:b,description:"Backend apps provide APIs, web apps are client applications, and admin apps manage data"}),s.jsxs(fT,{children:[s.jsx(ay,{type:"button",variant:"outline",onClick:()=>{j(!1)},children:"Cancel"}),s.jsx(ay,{type:"submit",disabled:f,children:f?"Creating...":"Create App"})]})]})]})]})}const{appEntityType:yT}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:xT}=await C("@baseplate-dev/project-builder-lib/web"),{Button:jT,NavigationMenu:ST,NavigationMenuItemWithLink:wT,NavigationMenuList:CT,SidebarLayout:ET,SidebarLayoutContent:DT,SidebarLayoutSidebar:TT}=await C("@baseplate-dev/ui-components");function RT(){const{definition:a}=xT(),{apps:n}=a,l=Zn(n,[o=>o.name]);return s.jsxs(ET,{className:"flex-1",children:[s.jsxs(TT,{className:"space-y-4",width:"sm",children:[s.jsx("div",{className:"flex flex-col gap-4",children:s.jsx(vm,{children:s.jsxs(jT,{variant:"secondary",className:"w-full",children:[s.jsx(vi,{}),"New App"]})})}),s.jsx(ST,{orientation:"vertical",children:s.jsx(CT,{children:l.map(o=>s.jsx(wT,{asChild:!0,children:s.jsx(Ht,{to:`/apps/edit/${yT.keyFromId(o.id)}`,children:o.name})},o.id))})})]}),s.jsx(DT,{children:s.jsx(bi,{})})]})}const{useProjectDefinition:NT}=await C("@baseplate-dev/project-builder-lib/web"),{useMemo:MT}=await C("react");function qn(a){const{definitionSchemaCreatorOptions:n}=NT();return MT(()=>a(n),[n,a])}const{authConfigSpec:AT,createAdminAppSchema:$T,zPluginWrapper:LT}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:OT,useProjectDefinition:UT,useResettableForm:zT}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:BT,InputFieldController:iy,MultiComboboxFieldController:_T,SectionList:FT,SectionListSection:ly,SectionListSectionContent:ry,SectionListSectionDescription:sy,SectionListSectionHeader:oy,SectionListSectionTitle:cy}=await C("@baseplate-dev/ui-components"),{useMemo:qT}=await C("react");function HT({className:a,appConfig:n}){const{definition:l,saveDefinitionWithFeedback:o,pluginContainer:c}=UT(),d=qn($T),f=qT(()=>LT(d,c),[c,d]),p=zT({resolver:kt(f),values:n}),{control:m,handleSubmit:g,reset:v}=p,b=g(j=>o(D=>{D.apps=D.apps.map(S=>S.id===n.id?j:S)}));OT({control:m,reset:v,onSubmit:b});const x=c.getPluginSpecOptional(AT)?.getAuthRoles(l).map(j=>({label:j.name,value:j.id}));return s.jsxs("form",{className:Te("w-full max-w-7xl space-y-4 p-4",a),onSubmit:b,children:[s.jsxs(FT,{children:[s.jsxs(ly,{children:[s.jsxs(oy,{children:[s.jsx(cy,{children:"General"}),s.jsx(sy,{children:"Basic configuration for your admin application."})]}),s.jsxs(ry,{className:"space-y-6",children:[s.jsx(iy,{label:"Name",control:m,name:"name"}),s.jsx(iy,{label:"Package Location (optional)",placeholder:"e.g. packages/admin",control:m,name:"packageLocation"})]})]}),x&&s.jsxs(ly,{children:[s.jsxs(oy,{children:[s.jsx(cy,{children:"Access Control"}),s.jsx(sy,{children:"Configure which user roles can access the admin application."})]}),s.jsx(ry,{children:s.jsx(_T,{label:"Allowed Roles",control:m,options:x,name:"allowedRoles"})})]})]}),s.jsx(BT,{form:p})]})}const{ModelUtils:PT}=await C("@baseplate-dev/project-builder-lib"),{createAdminCrudInputWebConfig:kT,useProjectDefinition:IT}=await C("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:uy}=await C("@baseplate-dev/ui-components");function VT({formProps:a,name:n,model:l,embeddedFormOptions:o}){const{definition:c}=IT(),d=PT.getRelationsToModel(c,l.id).map(m=>({label:`${m.relation.foreignRelationName} (${m.model.name})`,value:m.relation.foreignId})),f=n,p=a.control;return s.jsxs(s.Fragment,{children:[s.jsx(uy,{label:"Relation Name",control:p,name:`${f}.modelRelationRef`,options:d}),s.jsx(uy,{label:"Embedded Form",control:p,name:`${f}.embeddedFormRef`,options:o})]})}const GT=kT({name:"embedded",pluginId:void 0,label:"Embedded",getNewInput:()=>({label:"",type:"embedded",modelRelationRef:"",embeddedFormRef:""}),Form:VT}),{createAdminCrudInputWebConfig:YT}=await C("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:dy}=await C("@baseplate-dev/ui-components");function XT({formProps:a,name:n,model:l,embeddedFormOptions:o}){const c=l.model.relations?.map(p=>({label:`${p.name} (${p.modelRef})`,value:p.id}))??[],d=n,f=a.control;return s.jsxs(s.Fragment,{children:[s.jsx(dy,{label:"Relation Name",control:f,name:`${d}.localRelationRef`,options:c}),s.jsx(dy,{label:"Embedded Form",control:f,name:`${d}.embeddedFormRef`,options:o})]})}const QT=YT({name:"embeddedLocal",pluginId:void 0,label:"Embedded Local",getNewInput:()=>({label:"",type:"embeddedLocal",embeddedFormRef:"",localRelationRef:""}),Form:XT}),{createAdminCrudInputWebConfig:KT}=await C("@baseplate-dev/project-builder-lib/web"),{SelectFieldController:ZT}=await C("@baseplate-dev/ui-components");function WT({formProps:a,name:n,model:l}){const o=l.model.fields.filter(f=>f.type==="enum").map(f=>({label:f.name,value:f.id})),c=n,d=a.control;return s.jsx(ZT,{label:"Enum Field",control:d,name:`${c}.modelFieldRef`,options:o})}const JT=KT({name:"enum",pluginId:void 0,label:"Enum",getNewInput:()=>({label:"",type:"enum",modelFieldRef:""}),Form:WT}),{createAdminCrudInputWebConfig:eR}=await C("@baseplate-dev/project-builder-lib/web"),{InputFieldController:Jo,SelectFieldController:tR}=await C("@baseplate-dev/ui-components");function nR({formProps:a,name:n,model:l}){const o=l.model.relations?.map(f=>({label:`${f.name} (${f.modelRef})`,value:f.id}))??[],c=n,d=a.control;return s.jsxs(s.Fragment,{children:[s.jsx(tR,{label:"Local Relation Name",control:d,name:`${c}.localRelationRef`,options:o}),s.jsx(Jo,{label:"Label Expression (e.g. name)",control:d,name:`${c}.labelExpression`}),s.jsx(Jo,{label:"Value Expression (e.g. id)",control:d,name:`${c}.valueExpression`}),s.jsx(Jo,{label:"Default Label (optional)",control:d,name:`${c}.defaultLabel`}),s.jsx(Jo,{label:"Empty Label (optional) - only if field is nullable",control:d,name:`${c}.nullLabel`})]})}const aR=eR({name:"foreign",pluginId:void 0,label:"Foreign",getNewInput:()=>({label:"",type:"foreign",localRelationRef:"",labelExpression:"",valueExpression:"",defaultLabel:"",nullLabel:""}),Form:nR}),{createAdminCrudInputWebConfig:iR}=await C("@baseplate-dev/project-builder-lib/web"),{InputFieldController:lR,SelectFieldController:rR}=await C("@baseplate-dev/ui-components");function sR({formProps:a,name:n,model:l}){const o=l.model.fields.map(f=>({label:f.name,value:f.id})),c=n,d=a.control;return s.jsxs(s.Fragment,{children:[s.jsx(rR,{label:"Field",control:d,name:`${c}.modelFieldRef`,options:o}),s.jsx(lR,{label:"Validation (zod), e.g. z.string().min(1) (optional)",control:d,name:`${c}.validation`})]})}const oR=iR({name:"text",pluginId:void 0,label:"Text",getNewInput:()=>({label:"",type:"text",modelFieldRef:""}),Form:sR}),fy=[GT,QT,JT,aR,oR],{ModelUtils:cR}=await C("@baseplate-dev/project-builder-lib"),{adminCrudInputWebSpec:uR,useProjectDefinition:dR}=await C("@baseplate-dev/project-builder-lib/web"),{Button:fR,InputFieldController:hR,SelectFieldController:mR}=await C("@baseplate-dev/ui-components");function pR({idx:a,formProps:n,embeddedFormOptions:l}){const{control:o}=n,c=it({control:o,name:"modelRef"}),{definition:d,pluginContainer:f}=dR(),p=c?cR.byIdOrThrow(d,c):void 0,m=f.getPluginSpec(uR),g=m.getInputWebConfigs(fy).map(j=>({label:j.label,value:j.name})),v=it({control:o,name:`form.fields.${a}.type`}),b=m.getInputWebConfig(v,fy),x=b.Form;return s.jsxs("div",{className:"space-y-4",children:[s.jsx(mR,{label:"Type",control:o,options:g,name:`form.fields.${a}.type`}),s.jsx(hR,{label:"Label",control:o,name:`form.fields.${a}.label`}),x&&p&&s.jsx(x,{formProps:n,name:`form.fields.${a}`,model:p,embeddedFormOptions:l,pluginId:b.pluginId})]})}function cS({className:a,formProps:n,embeddedFormOptions:l}){const{control:o}=n,{fields:c,append:d,remove:f}=bs({control:o,name:"form.fields"});return s.jsxs("div",{className:Te("space-y-4",a),children:[c.map((p,m)=>s.jsx(pj,{collapsedContents:s.jsxs("div",{children:[p.label," (",p.type,")"]}),onRemove:()=>{f(m)},defaultOpen:!p.label,children:s.jsx(pR,{idx:m,formProps:n,embeddedFormOptions:l},p.id)},p.id)),s.jsx(fR,{onClick:()=>{d({type:"text",label:""})},children:"Add Field"})]})}const{adminCrudDisplayTypes:gR,ModelUtils:vR}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:bR}=await C("@baseplate-dev/project-builder-lib/web"),{Button:yR,InputFieldController:gh,SelectFieldController:vh}=await C("@baseplate-dev/ui-components");function xR({idx:a,control:n,fieldOptions:l,localRelationOptions:o}){const c=gR.map(f=>({label:f,value:f})),d=it({control:n,name:`table.columns.${a}.display.type`});return s.jsxs("div",{className:"space-y-4",children:[s.jsx(vh,{label:"Type",control:n,options:c,name:`table.columns.${a}.display.type`}),s.jsx(gh,{label:"Label",control:n,name:`table.columns.${a}.label`}),d==="text"&&s.jsx(vh,{label:"Field",control:n,name:`table.columns.${a}.display.modelFieldRef`,options:l}),d==="foreign"&&s.jsxs(s.Fragment,{children:[s.jsx(vh,{label:"Local Relation Name",control:n,name:`table.columns.${a}.display.localRelationRef`,options:o}),s.jsx(gh,{label:"Label Expression (e.g. name)",control:n,name:`table.columns.${a}.display.labelExpression`}),s.jsx(gh,{label:"Value Expression (e.g. id)",control:n,name:`table.columns.${a}.display.valueExpression`})]})]})}function uS({className:a,control:n}){const l=it({control:n,name:"modelRef"}),{definition:o,definitionContainer:c}=bR(),d=l?vR.byIdOrThrow(o,l):void 0,{fields:f,append:p,remove:m}=bs({control:n,name:"table.columns"}),g=d?.model.relations?.map(b=>({label:`${b.name} (${c.nameFromId(b.modelRef)})`,value:b.id}))??[],v=d?.model.fields.map(b=>({label:b.name,value:b.id}))??[];return s.jsxs("div",{className:Te("space-y-4",a),children:[f.map((b,x)=>s.jsx(pj,{collapsedContents:s.jsxs("div",{children:[b.label," (",b.display.type,")"]}),onRemove:()=>{m(x)},defaultOpen:!b.label,children:s.jsx(xR,{idx:x,control:n,fieldOptions:v,localRelationOptions:g},b.id)},b.id)),s.jsx(yR,{onClick:()=>{p({display:{type:"text",modelFieldRef:""},label:""})},children:"Add Column"})]})}const{createAdminCrudEmbeddedFormSchema:jR,zPluginWrapper:SR}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:dS}=await C("@baseplate-dev/project-builder-lib/web"),{Button:bm,CheckboxFieldController:wR,InputFieldController:CR,SelectFieldController:hy,Table:ER,TableBody:DR,TableCell:ec,TableHead:tc,TableHeader:TR,TableRow:my,toast:RR}=await C("@baseplate-dev/ui-components"),{useId:NR}=await C("react");function MR({items:a,edit:n,remove:l}){const{definitionContainer:o}=dS();return s.jsxs(ER,{className:"max-w-6xl",children:[s.jsx(TR,{children:s.jsxs(my,{children:[s.jsx(tc,{children:"Form Name"}),s.jsx(tc,{children:"Model Name"}),s.jsx(tc,{children:"Type"}),s.jsx(tc,{children:"Actions"})]})}),s.jsx(DR,{children:a.map((c,d)=>s.jsxs(my,{children:[s.jsx(ec,{children:c.name}),s.jsx(ec,{children:o.nameFromId(c.modelRef)}),s.jsx(ec,{children:c.type}),s.jsxs(ec,{className:"space-x-4",children:[s.jsx(bm,{variant:"link",size:"none",onClick:()=>{n(d)},children:"Edit"}),s.jsx(bm,{variant:"linkDestructive",size:"none",onClick:()=>{l(d)},children:"Remove"})]})]},c.id))})]})}const AR=[{label:"Object",value:"object"},{label:"List",value:"list"}];function $R({initialData:a,onSubmit:n,embeddedFormOptions:l}){const{definition:o,pluginContainer:c}=dS(),d=qn(jR),f=SR(d,c),p=gi({resolver:kt(f),defaultValues:a}),{handleSubmit:m,control:g,watch:v}=p,b=o.models.map(D=>({label:D.name,value:D.id})),x=v("type"),j=NR();return s.jsxs("form",{onSubmit:D=>{D.stopPropagation(),m(n)(D).catch(S=>{RR.error(wn(S))})},id:j,className:"space-y-4",children:[s.jsx(CR,{label:"Name",control:g,name:"name"}),s.jsx(hy,{label:"Type",control:g,name:"type",options:AR}),s.jsx(wR,{label:"Include ID Field? (useful for list types)",control:g,name:"includeIdField"}),s.jsx(hy,{label:"Model",control:g,options:b,name:"modelRef"}),x==="list"&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{children:"Table"}),s.jsx(uS,{control:g})]}),s.jsx("h2",{children:"Form"}),s.jsx(cS,{formProps:p,embeddedFormOptions:l}),s.jsx(bm,{type:"submit",form:j,children:"Save"})]})}const{useProjectDefinition:LR}=await C("@baseplate-dev/project-builder-lib/web"),{CheckboxFieldController:OR,SelectFieldController:UR}=await C("@baseplate-dev/ui-components");function zR({className:a,formProps:n}){const{control:l}=n,{definition:o}=LR(),c=o.models.map(f=>({label:f.name,value:f.id})),d=it({control:l,name:"embeddedForms"})?.map(f=>({label:f.name,value:f.id}))??[];return s.jsxs("div",{className:Te("space-y-4",a),children:[s.jsx(UR,{label:"Model",control:l,options:c,name:"modelRef"}),s.jsx(OR,{label:"Disable Create?",control:l,name:"disableCreate"}),s.jsx("h2",{children:"Table"}),s.jsx(uS,{control:l}),s.jsx("h2",{children:"Form"}),s.jsx(cS,{formProps:n,embeddedFormOptions:d}),s.jsx("h2",{children:"Embedded Forms"}),s.jsx(ms.LabelledController,{control:l,name:"embeddedForms",renderForm:f=>s.jsx($R,{...f,embeddedFormOptions:d}),renderTable:f=>s.jsx(MR,{...f}),defaultValue:{type:"object"}})]})}const{adminSectionEntityType:bh,createAdminSectionSchema:BR,zPluginWrapper:_R}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:FR,useProjectDefinition:qR,useResettableForm:HR}=await C("@baseplate-dev/project-builder-lib/web"),{Button:py,ComboboxFieldController:PR,InputFieldController:gy,SelectFieldController:kR,useConfirmDialog:IR}=await C("@baseplate-dev/ui-components"),{useEffect:VR}=await C("react"),GR=[{label:"Crud",value:"crud"}];function vy({className:a,appConfig:n}){const{requestConfirm:l}=IR(),{sectionId:o}=Ki(),{saveDefinitionWithFeedback:c,saveDefinitionWithFeedbackSync:d,isSavingDefinition:f,definition:p,pluginContainer:m}=qR(),g=on(),v=o?bh.idFromKey(o):void 0,b=v?n.sections?.find(T=>T.id===v):void 0,x=qn(BR),j=_R(x,m),D=HR({values:b,defaultValues:{type:"crud"},resolver:kt(j)}),{control:S,handleSubmit:R,watch:E,reset:A}=D;VR(()=>{A(b??{type:"crud"})},[A,b]);const B=R(T=>{const O=T.id||bh.generateNewId();return c(Q=>{const te=Q.apps.find(ae=>ae.id===n.id);if(te?.type!=="admin")throw new Error("Cannot add a section to a non-admin app");te.sections=Zn([...(te.sections??[]).filter(ae=>!v||ae.id!==v),{...T,id:O}],[ae=>ae.name])},{onSuccess:()=>{v||g(`edit/${bh.keyFromId(O)}`)}})});FR({control:S,reset:A,onSubmit:B});const H=E("type");function V(){l({title:"Delete Section",content:`Are you sure you want to delete ${b?.name??"this section"}?`,onConfirm:()=>{d(T=>{const O=T.apps.find(Q=>Q.id===n.id);if(O?.type!=="admin")throw new Error("Cannot add a section to a non-admin app");O.sections=(O.sections??[]).filter(Q=>!v||Q.id!==v)},{successMessage:"Successfully deleted section!",onSuccess:()=>{g("..")}})}})}const K=p.features.map(T=>({label:T.name,value:T.id}));return s.jsx("div",{className:Te("",a),children:s.jsxs("form",{onSubmit:B,className:"space-y-4",children:[v&&s.jsx(py,{variant:"link",size:"none",onClick:()=>{V()},children:"Delete Section"}),s.jsx(gy,{label:"Name",control:S,name:"name"}),s.jsx(PR,{label:"Feature",control:S,options:K,name:"featureRef"}),s.jsx(gy,{label:"Icon",control:S,name:"icon"}),s.jsx(kR,{label:"Type",control:S,name:"type",options:GR}),(()=>{switch(H){case"crud":return s.jsx(zR,{formProps:D});default:return s.jsxs("div",{children:["Unsupported type ",H]})}})(),s.jsx(py,{type:"submit",disabled:f,children:"Save"})]})})}const{adminSectionEntityType:fS}=await C("@baseplate-dev/project-builder-lib"),{NavigationMenu:YR,NavigationMenuItemWithLink:by,NavigationMenuList:XR,SidebarLayout:QR,SidebarLayoutContent:KR,SidebarLayoutSidebar:ZR}=await C("@baseplate-dev/ui-components");js(fS,"/apps/edit/{parentKey}/sections/edit/{key}");function WR({className:a,appConfig:n}){const l=Zn(n.sections??[],[o=>o.name]);return s.jsxs(QR,{className:a,children:[s.jsxs(ZR,{className:"space-y-4",width:"sm",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsx("h2",{children:"Sections"})}),s.jsx(YR,{orientation:"vertical",children:s.jsxs(XR,{children:[s.jsx("li",{children:s.jsx(by,{asChild:!0,children:s.jsx(Sn,{to:"new",className:"text-green-500",children:"New Section"})})}),l.map(o=>s.jsx("li",{children:s.jsx(by,{asChild:!0,children:s.jsx(Sn,{to:`edit/${fS.keyFromId(o.id)}`,children:o.name})})},o.id))]})})]}),s.jsx(KR,{className:"p-4",children:s.jsxs(Jx,{children:[s.jsx(ds,{path:"new",element:s.jsx(vy,{appConfig:n},"new")}),s.jsx(ds,{path:"edit/:sectionId",element:s.jsx(vy,{appConfig:n})})]})})]})}const{Alert:JR,AlertDescription:e9,AlertTitle:t9,NavigationTabs:n9,NavigationTabsItem:yy}=await C("@baseplate-dev/ui-components");function a9({className:a,appConfig:n}){return s.jsxs("div",{className:Te("p-4",a),children:[s.jsxs(JR,{variant:"warning",className:"mb-4",children:[s.jsx(t9,{children:"⚠️ Development Preview"}),s.jsx(e9,{children:"The admin app functionality will likely be fully rewritten in future versions. This is provided for preview purposes only and should not be relied upon for production use."})]}),s.jsxs(n9,{children:[s.jsx(yy,{asChild:!0,children:s.jsx(Ht,{to:"",end:!0,children:"General"})}),s.jsx(yy,{asChild:!0,children:s.jsx(Ht,{to:"sections",children:"Sections"})})]}),s.jsx("div",{className:"mt-4 border-t",children:s.jsxs(Jx,{children:[s.jsx(ds,{index:!0,element:s.jsx(HT,{appConfig:n})}),s.jsx(ds,{path:"/sections/*",element:s.jsx(WR,{appConfig:n})})]})})]})}const{createBackendAppSchema:i9}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:l9,useProjectDefinition:r9,useResettableForm:s9}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:o9,InputFieldController:xy,SectionList:c9,SectionListSection:jy,SectionListSectionContent:Sy,SectionListSectionDescription:wy,SectionListSectionHeader:Cy,SectionListSectionTitle:Ey,SwitchFieldController:Ol}=await C("@baseplate-dev/ui-components");function u9({className:a,appConfig:n}){const{saveDefinitionWithFeedback:l}=r9(),o=qn(i9),c=s9({resolver:kt(o),values:n}),{control:d,handleSubmit:f,reset:p}=c,m=f(g=>l(v=>{v.apps=v.apps.map(b=>b.id===n.id?g:b)}));return l9({control:d,reset:p,onSubmit:m}),s.jsxs("form",{className:Te("w-full max-w-7xl space-y-4 px-4",a),onSubmit:m,children:[s.jsxs(c9,{children:[s.jsxs(jy,{children:[s.jsxs(Cy,{children:[s.jsx(Ey,{children:"General"}),s.jsx(wy,{children:"Basic configuration for your backend application."})]}),s.jsxs(Sy,{className:"space-y-6",children:[s.jsx(xy,{label:"Name",control:d,name:"name"}),s.jsx(xy,{label:"Package Location (optional)",placeholder:"e.g. packages/backend",control:d,name:"packageLocation"})]})]}),s.jsxs(jy,{children:[s.jsxs(Cy,{children:[s.jsx(Ey,{children:"Configuration"}),s.jsx(wy,{children:"Enable or disable external services and features for your backend application."})]}),s.jsx(Sy,{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(Ol,{control:d,name:"enableStripe",label:"Stripe",description:"Enable Stripe for payment processing"}),s.jsx(Ol,{control:d,name:"enablePostmark",label:"Postmark",description:"Enable Postmark for email delivery"}),s.jsx(Ol,{control:d,name:"enableRedis",label:"Redis",description:"Enable Redis for caching and session storage"}),s.jsx(Ol,{control:d,name:"enableBullQueue",label:"Bull Queue",description:"Enable Bull Queue for background job processing"}),s.jsx(Ol,{control:d,name:"enableSubscriptions",label:"GraphQL Subscriptions",description:"Enable GraphQL Subscriptions for real-time updates"}),s.jsx(Ol,{control:d,name:"enableAxios",label:"Axios",description:"Enable Axios for HTTP requests"})]})})]})]}),s.jsx(o9,{form:c})]})}const{authConfigSpec:d9,createWebAppSchema:f9}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:h9,useProjectDefinition:Dy,useResettableForm:m9}=await C("@baseplate-dev/project-builder-lib/web"),{Button:p9,CheckboxFieldController:yh,InputFieldController:nc,MultiComboboxFieldController:g9}=await C("@baseplate-dev/ui-components");function v9({className:a,appConfig:n}){const{saveDefinitionWithFeedback:l,isSavingDefinition:o}=Dy(),c=qn(f9),d=m9({resolver:kt(c),values:n}),{control:f,handleSubmit:p,reset:m}=d,{definition:g,pluginContainer:v}=Dy(),b=p(j=>l(D=>{D.apps=D.apps.map(S=>S.id===n.id?j:S)}));h9({control:f,reset:m,onSubmit:b});const x=v.getPluginSpecOptional(d9)?.getAuthRoles(g).map(j=>({label:j.name,value:j.id}));return s.jsx("div",{className:Te("p-4",a),children:s.jsxs("form",{onSubmit:b,className:"space-y-4",children:[s.jsx(nc,{label:"Name",control:f,name:"name"}),s.jsx(nc,{label:"Package Location (optional) e.g. packages/web",control:f,name:"packageLocation"}),s.jsx(nc,{label:"Page Title",control:f,name:"title"}),s.jsx(nc,{label:"Description Meta Tag",control:f,name:"description"}),s.jsx(yh,{label:"Include Auth?",control:f,name:"includeAuth"}),s.jsx(yh,{label:"Include Upload Components?",control:f,name:"includeUploadComponents"}),s.jsx(yh,{label:"Enable Subscriptions?",control:f,name:"enableSubscriptions"}),x&&s.jsx(g9,{label:"Allowed Roles?",control:f,options:x,name:"allowedRoles"}),s.jsx(p9,{type:"submit",disabled:o,children:"Save"})]})})}const{appEntityType:b9}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:y9}=await C("@baseplate-dev/project-builder-lib/web"),{Button:xh,Dialog:x9,DialogClose:j9,DialogContent:S9,DialogFooter:w9,DialogHeader:C9,DialogTitle:E9,DialogTrigger:D9,ErrorDisplay:T9}=await C("@baseplate-dev/ui-components");function R9(){const{key:a}=Ki(),{saveDefinitionWithFeedbackSync:n,definition:l,isSavingDefinition:o}=y9(),c=a?b9.idFromKey(a):void 0,d=c&&l.apps.find(g=>g.id===c),f=on();if(!a||!d)return s.jsx(zc,{});const p=()=>{n(g=>{g.apps=g.apps.filter(v=>v.id!==c)},{successMessage:"Successfully unlinked app!",disableDeleteRefDialog:!0,onSuccess:()=>{f("/apps")}})},{packageScope:m}=l.settings.general;return s.jsxs("div",{className:"relative flex h-full flex-1 flex-col overflow-hidden",children:[s.jsx("div",{className:"max-w-7xl space-y-4 p-4",children:s.jsxs("div",{className:"flex items-center justify-between space-x-4",children:[s.jsxs("div",{children:[s.jsx("h2",{children:m?`@${m}/${d.name}`:d.name}),s.jsxs("p",{className:"text-base text-muted-foreground",children:[d.type," app"]})]}),s.jsxs(x9,{children:[s.jsx(D9,{asChild:!0,children:s.jsx(xh,{variant:"secondary",children:"Delete"})}),s.jsxs(S9,{children:[s.jsx(C9,{children:s.jsxs(E9,{children:["Delete ",d.name]})}),s.jsxs("p",{children:["Are you sure you want to delete ",s.jsx("strong",{children:d.name}),"?"]}),s.jsx("p",{className:"text-style-muted",children:"This action will unlink the app from the generation process, so it will no longer be updated or managed through Baseplate. If already generated, the app will remain on the file system. You can manually delete it afterwards if no longer needed."}),s.jsxs(w9,{children:[s.jsx(j9,{children:s.jsx(xh,{variant:"secondary",children:"Cancel"})}),s.jsx(xh,{variant:"destructive",onClick:p,disabled:o,children:"Unlink App"})]})]})]})]})}),s.jsx("div",{className:"mb-(--action-bar-height) flex flex-1 overflow-y-auto",style:{"--action-bar-height":"52px"},children:(()=>{switch(d.type){case"backend":return s.jsx(u9,{appConfig:d},d.id);case"web":return s.jsx(v9,{appConfig:d},d.id);case"admin":return s.jsx(a9,{appConfig:d},d.id);default:return s.jsx(T9,{error:`Unknown app type: ${d.type}`})}})()})]},d.id)}const{appEntityType:N9}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:M9}=await C("@baseplate-dev/project-builder-lib/web"),{Button:jh,Card:A9,EmptyDisplay:$9}=await C("@baseplate-dev/ui-components");function L9(){const{definition:a}=M9(),{apps:n}=a,l=Zn(n,[o=>o.name]);return l.length===0?s.jsx($9,{icon:Dm,header:"No Apps",subtitle:"You haven't created any apps yet",actions:s.jsx(vm,{children:s.jsx(jh,{children:"New App"})})}):s.jsxs("div",{className:"space-y-4 p-4",children:[s.jsx("h1",{children:"Apps"}),s.jsx("p",{children:"These are the apps that are defined in your project. You can edit them here."}),s.jsx(vm,{children:s.jsx(jh,{children:"New App"})}),s.jsx("div",{className:"max-w-xl space-y-4",children:l.map(o=>s.jsxs(A9,{className:"flex justify-between space-x-4 p-4",children:[s.jsxs("div",{children:[s.jsxs("h3",{children:[o.name," (",o.type,")"]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:o.packageLocation})]}),s.jsx(Sn,{to:`/apps/edit/${N9.keyFromId(o.id)}`,className:"inline-block",children:s.jsx(jh,{variant:"secondary",children:"Edit"})})]},o.id))})]})}const{appEntityType:O9}=await C("@baseplate-dev/project-builder-lib"),U9=[{element:s.jsx(RT,{}),children:[{index:!0,element:s.jsx(L9,{})},{path:"edit/:key/*",element:s.jsx(R9,{}),handle:{crumb:Uc(O9,"Edit App")}},{path:"*",element:s.jsx(Ts,{})}]}],{modelEntityType:Ty,modelEnumEntityType:Ry}=await C("@baseplate-dev/project-builder-lib");function hS(a){return`/data/models/edit/${Ty.isId(a)?Ty.keyFromId(a):a}`}function mS(a){return`/data/enums/edit/${Ry.isId(a)?Ry.keyFromId(a):a}`}const{FeatureComboboxFieldController:z9}=await C("@baseplate-dev/project-builder-lib/web"),{InputFieldController:B9}=await C("@baseplate-dev/ui-components");function pS({className:a,control:n}){return s.jsxs("div",{className:Te("max-w-md space-y-4",a),children:[s.jsx(B9,{label:"Name",control:n,name:"name",description:"The name of the enum (PascalCase)"}),s.jsx(z9,{label:"Feature",control:n,name:"featureRef",description:"The feature this enum belongs to (dash-case)",canCreate:!0})]})}const{createEnumBaseSchema:_9,EnumUtils:F9,FeatureUtils:q9,modelEnumEntityType:ym}=await C("@baseplate-dev/project-builder-lib"),{usePluginEnhancedSchema:H9,useProjectDefinition:P9,useResettableForm:k9}=await C("@baseplate-dev/project-builder-lib/web"),{useEventCallback:I9}=await C("@baseplate-dev/ui-components"),{useMemo:Sh}=await C("react");function V9(){return{id:ym.generateNewId(),name:"",featureRef:"",isExposed:!1,values:[]}}function tp({schema:a,onSubmitSuccess:n,isCreate:l}={}){const{key:o}=Ki(),{definition:c,saveDefinitionWithFeedback:d,isSavingDefinition:f}=P9(),p=on(),m=l?void 0:ym.idFromKey(o),g=m?F9.byId(c,m):void 0;if(!l&&!g)throw new hj("Enum not found");const v=Sh(()=>V9(),[]),b=qn(_9),x=H9(a??b),j=Sh(()=>{const H=g??v;return a?x.parse(H):H},[g,v,a,x]),D=k9({resolver:kt(x),defaultValues:j}),{reset:S,handleSubmit:R,setError:E}=D,A=I9(n),B=Sh(()=>R(H=>{const V={...g,...H,id:g?.id??ym.generateNewId()};if(c.enums?.find(T=>T.id!==V.id&&T.name.toLowerCase()===V.name.toLowerCase())){E("name",{message:`Enum with name ${V.name} already exists.`});return}return d(T=>{V.featureRef=q9.ensureFeatureByNameRecursively(T,V.featureRef),T.enums=Zn([...T.enums?.filter(O=>O.id!==V.id)??[],V],[O=>O.name])},{successMessage:l?"Successfully created enum!":"Successfully saved enum!",onSuccess:()=>{l?(p(mS(V.id)),S(v)):S(H),A?.()}})}),[p,S,d,E,R,c,l,g,v,A]);return{form:D,onSubmit:B,defaultValues:j,isSavingDefinition:f}}const{useBlockBeforeContinue:G9}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Ny,Dialog:Y9,DialogClose:X9,DialogContent:Q9,DialogDescription:K9,DialogFooter:Z9,DialogHeader:W9,DialogTitle:J9,DialogTrigger:eN,SwitchFieldController:tN,useControlledState:nN}=await C("@baseplate-dev/ui-components");function gS({children:a,open:n,onOpenChange:l}){const[o,c]=nN(n,l,!1),{onSubmit:d,form:{control:f},isSavingDefinition:p}=tp({isCreate:!0,onSubmitSuccess:()=>{c(!1)}}),m=G9();return s.jsxs(Y9,{open:o,onOpenChange:g=>{g?m({onContinue:()=>{c(!0)}}):c(!1)},children:[s.jsx(eN,{asChild:!0,children:a}),s.jsxs(Q9,{children:[s.jsxs(W9,{children:[s.jsx(J9,{children:"New Enum"}),s.jsx(K9,{children:"Enums are a list of values that can be used in your data models."})]}),s.jsxs("form",{onSubmit:d,className:"space-y-4",children:[s.jsx(pS,{control:f}),s.jsx(tN,{label:"Expose in GraphQL schema",control:f,name:"isExposed",description:"Whether to expose this enum in the GraphQL schema"}),s.jsxs(Z9,{children:[s.jsx(X9,{asChild:!0,children:s.jsx(Ny,{variant:"secondary",children:"Cancel"})}),s.jsx(Ny,{type:"submit",disabled:p,children:"Create Enum"})]})]})]})]})}const{useProjectDefinition:aN}=await C("@baseplate-dev/project-builder-lib/web"),{Button:My,InputField:iN,NavigationMenu:lN,NavigationMenuItemWithLink:rN,NavigationMenuList:sN,ScrollArea:oN}=await C("@baseplate-dev/ui-components"),{useState:Ay}=await C("react");function cN({className:a}){const{definition:{enums:n=[]}}=aN(),[l,o]=Ay(""),c=n.filter(m=>m.name.toLowerCase().includes(l.toLowerCase())),d=Zn(c,[m=>m.name]),[f,p]=Ay(!1);return s.jsxs("div",{className:Te(a,"flex flex-1 flex-col space-y-4 overflow-y-auto"),children:[s.jsxs("div",{className:"space-y-4 px-4",children:[s.jsx(gS,{children:s.jsxs(My,{variant:"secondary",className:"w-full",children:[s.jsx(vi,{}),"New Enum"]})}),n.length>0&&s.jsxs("div",{className:"relative",children:[s.jsx(iN,{value:l,onChange:m=>{o(m)},placeholder:"Search"}),l&&s.jsx(My,{variant:"ghost",className:"absolute top-1/2 right-4 -translate-y-1/2",size:"icon",onClick:()=>{o("")},children:s.jsx(Lx,{})})]})]}),s.jsxs(oN,{className:Te("flex-1 px-2",f&&"border-t"),onScrollCapture:m=>{const g=m.currentTarget.scrollTop>0;g!==f&&p(g)},children:[d.length===0&&l&&s.jsx("div",{className:"py-4 text-center text-style-muted",children:"No enums found"}),s.jsx(lN,{orientation:"vertical",children:s.jsx(sN,{children:d.map(m=>s.jsx("li",{children:s.jsx(rN,{asChild:!0,children:s.jsx(Ht,{to:mS(m.id),children:m.name})})},m.id))})})]})]})}const{createModelBaseSchema:uN,FeatureUtils:dN,modelEntityType:xm,modelScalarFieldEntityType:fN,ModelUtils:hN}=await C("@baseplate-dev/project-builder-lib"),{usePluginEnhancedSchema:mN,useProjectDefinition:pN,useResettableForm:gN}=await C("@baseplate-dev/project-builder-lib/web"),{toast:ac,useEventCallback:vN}=await C("@baseplate-dev/ui-components"),{useMemo:ic,useRef:bN}=await C("react");function yN(){const a=fN.generateNewId();return{id:xm.generateNewId(),name:"",featureRef:"",service:{create:{enabled:!1},update:{enabled:!1},delete:{enabled:!1},transformers:[]},model:{primaryKeyFieldRefs:[a],fields:[{id:a,name:"id",type:"uuid",isOptional:!1,options:{default:"",genUuid:!0}}]}}}function Ns({onSubmitSuccess:a,isCreate:n,omit:l}={}){const{key:o}=Ki(),{definition:c,saveDefinitionWithFeedback:d}=pN(),f=on(),p=n?void 0:xm.idFromKey(o),m=p?hN.byIdOrThrow(c,p):void 0;if(!n&&!m)throw new hj("The model you were looking for could not be found.");const g=ic(()=>yN(),[]),v=qn(uN),b=bN(l),x=ic(()=>b.current?v.omit(Object.fromEntries(b.current.map(V=>[V,!0]))):v,[v]),j=mN(x),D=ic(()=>{const V=m??g;return b.current?j.parse(V):V},[m,g,j]),S=gN({resolver:kt(j),defaultValues:D}),{reset:R,handleSubmit:E,setError:A}=S,B=vN(a),H=ic(()=>E(V=>{const K={...m,...V,id:m?.id??xm.generateNewId()};if(K.model.fields.length===0){ac.error("Model must have at least one field.");return}if(K.model.primaryKeyFieldRefs.length===0){ac.error("Model must have at least one primary key field.");return}if(c.models.find(Q=>Q.id!==V.id&&Q.name.toLowerCase()===K.name.toLowerCase())){A("name",{message:`Model with name ${K.name} already exists.`});return}const{service:O}=K;if(O.create.enabled){if(!O.create.fields?.length&&!O.create.transformerNames?.length){ac.error("Create method must have at least one field or transformer.");return}}else O.create={enabled:!1};if(O.update.enabled){if(!O.update.fields?.length&&!O.update.transformerNames?.length){ac.error("Update method must have at least one field or transformer.");return}}else O.update={enabled:!1};return O.delete.enabled||(O.delete={enabled:!1}),!O.create.enabled&&!O.update.enabled&&!O.delete.enabled&&(K.service={create:{enabled:!1},update:{enabled:!1},delete:{enabled:!1},transformers:[]}),d(Q=>{K.featureRef=dN.ensureFeatureByNameRecursively(Q,K.featureRef),Q.models=Zn([...Q.models.filter(te=>te.id!==K.id),K],[te=>te.name])},{successMessage:n?"Successfully created model!":"Successfully saved model!",onSuccess:()=>{n?(f(hS(K.id)),R(g)):R(V),B?.()}})}),[R,A,E,d,n,f,B,c,g,m]);return{form:S,onSubmit:H,originalModel:m,defaultValues:D}}const{FeatureComboboxFieldController:xN}=await C("@baseplate-dev/project-builder-lib/web"),{InputFieldController:jN}=await C("@baseplate-dev/ui-components");function vS({className:a,control:n}){return s.jsxs("div",{className:Te("space-y-4",a),children:[s.jsx(jN,{control:n,label:"Name",name:"name",description:"The name of the model (PascalCase)"}),s.jsx(xN,{control:n,name:"featureRef",description:"The feature this model belongs to (dash-case)",canCreate:!0})]})}const{useBlockBeforeContinue:SN}=await C("@baseplate-dev/project-builder-lib/web"),{Button:$y,Dialog:wN,DialogClose:CN,DialogContent:EN,DialogDescription:DN,DialogFooter:TN,DialogHeader:RN,DialogTitle:NN,DialogTrigger:MN,useControlledState:AN}=await C("@baseplate-dev/ui-components");function jm({children:a,open:n,onOpenChange:l}){const[o,c]=AN(n,l,!1),{onSubmit:d,form:{control:f}}=Ns({isCreate:!0,onSubmitSuccess:()=>{c(!1)}}),p=SN();return s.jsxs(wN,{open:o,onOpenChange:m=>{m?p({onContinue:()=>{c(!0)}}):c(!1)},children:[s.jsx(MN,{asChild:!0,children:a}),s.jsxs(EN,{children:[s.jsxs(RN,{children:[s.jsx(NN,{children:"New Model"}),s.jsx(DN,{children:"Models define the structure of your data."})]}),s.jsxs("form",{onSubmit:d,className:"space-y-4",children:[s.jsx(vS,{control:f}),s.jsxs(TN,{children:[s.jsx(CN,{asChild:!0,children:s.jsx($y,{variant:"secondary",children:"Cancel"})}),s.jsx($y,{type:"submit",children:"Create Model"})]})]})]})]})}const{useProjectDefinition:$N}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Ly,InputField:LN,NavigationMenu:ON,NavigationMenuItemWithLink:UN,NavigationMenuList:zN,ScrollArea:BN}=await C("@baseplate-dev/ui-components"),{useState:Oy}=await C("react");function _N({className:a}){const{definition:{models:n}}=$N(),[l,o]=Oy(""),c=n.filter(m=>m.name.toLowerCase().includes(l.toLowerCase())),d=Zn(c,[m=>m.name]),[f,p]=Oy(!1);return s.jsxs("div",{className:Te(a,"flex flex-1 flex-col space-y-4 overflow-y-auto"),children:[s.jsxs("div",{className:"space-y-4 px-4",children:[s.jsx(jm,{children:s.jsxs(Ly,{variant:"secondary",className:"w-full",children:[s.jsx(vi,{}),"New Model"]})}),n.length>0&&s.jsxs("div",{className:"relative",children:[s.jsx(LN,{value:l,onChange:m=>{o(m)},placeholder:"Search"}),l&&s.jsx(Ly,{variant:"ghost",className:"absolute top-1/2 right-4 -translate-y-1/2",onClick:()=>{o("")},size:"icon",children:s.jsx(Lx,{})})]})]}),s.jsxs(BN,{className:Te("flex-1 px-2",f&&"border-t"),onScrollCapture:m=>{const g=m.currentTarget.scrollTop>0;g!==f&&p(g)},children:[d.length===0&&l&&s.jsx("div",{className:"py-4 text-center text-style-muted",children:"No models found"}),s.jsx(ON,{orientation:"vertical",children:s.jsx(zN,{children:d.map(m=>s.jsx(UN,{asChild:!0,children:s.jsx(Ht,{to:hS(m.id),children:m.name})},m.id))})})]})]})}const{useProjectDefinition:FN}=await C("@baseplate-dev/project-builder-lib/web"),{NavigationTabs:qN,NavigationTabsItem:Uy,SidebarLayout:HN,SidebarLayoutContent:PN,SidebarLayoutSidebar:kN}=await C("@baseplate-dev/ui-components");function IN(){const{definition:{models:a=[],enums:n=[]}}=FN(),l=j6([...a,...n],d=>d.name.length)?.name,o=ab("/data/models/*"),c=ab("/data/enums/*");return s.jsxs(HN,{className:"flex-1",children:[s.jsxs(kN,{className:"flex h-[calc(100vh-var(--topbar-height)-1px)] max-w-sm min-w-[230px] flex-col space-y-4",width:"auto",noPadding:!0,children:[s.jsx("div",{className:"invisible block h-1 overflow-hidden font-semibold text-transparent",children:l}),s.jsx("div",{className:"px-4",children:s.jsxs(qN,{className:"w-full",children:[s.jsx(Uy,{asChild:!0,children:s.jsx(Ht,{to:"models",children:"Models"})}),s.jsx(Uy,{asChild:!0,children:s.jsx(Ht,{to:"enums",children:"Enums"})})]})}),o?s.jsx(_N,{}):null,c?s.jsx(cN,{}):null]}),s.jsx(PN,{className:"h-[calc(100vh-var(--topbar-height)-1px)]",children:s.jsx(Yl,{children:s.jsx(bi,{})})})]})}const{SectionListSection:VN,SectionListSectionContent:GN,SectionListSectionHeader:YN,SectionListSectionTitle:XN,SwitchFieldController:QN}=await C("@baseplate-dev/ui-components");function KN({control:a}){return s.jsxs(VN,{children:[s.jsx(YN,{children:s.jsx(XN,{children:"GraphQL"})}),s.jsx(GN,{className:"space-y-4",children:s.jsx(QN,{label:"Expose in GraphQL schema",control:a,name:"isExposed",description:"Whether to expose this enum in the GraphQL schema"})})]})}function ZN(a){return a.split("_").map(o=>o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()).join(" ")}const{modelEnumValueEntityType:WN}=await C("@baseplate-dev/project-builder-lib"),{Button:zy,InputFieldController:By,Label:_y,SectionListSection:JN,SectionListSectionContent:eM,SectionListSectionDescription:tM,SectionListSectionHeader:nM,SectionListSectionTitle:aM}=await C("@baseplate-dev/ui-components");function iM({control:a,setValue:n}){const{fields:l,remove:o,append:c,move:d}=bs({control:a,name:"values"}),f=it({control:a,name:"values"}),p="grid grid-cols-[repeat(2,minmax(130px,1fr))_80px] gap-3",m=l.map((g,v)=>({id:g.id,element:s.jsxs("div",{className:p,children:[s.jsx(By,{control:a,name:`values.${v}.name`}),s.jsx(By,{control:a,name:`values.${v}.friendlyName`,onFocus:()=>{!f[v].friendlyName&&f[v].name&&n(`values.${v}.friendlyName`,ZN(f[v].name))}}),s.jsxs(zy,{variant:"ghost",size:"icon",onClick:()=>{o(v)},children:[s.jsx(ys,{}),s.jsx("div",{className:"sr-only",children:"Delete Enum"})]})]})}));return s.jsxs(JN,{children:[s.jsxs(nM,{children:[s.jsx(aM,{children:"Values"}),s.jsx(tM,{children:"Configure the allowed values for this enum."})]}),s.jsxs(eM,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:Te(p,"pl-12"),children:[s.jsx(_y,{children:"Value Name, e.g. ACTIVE"}),s.jsx(_y,{children:"Value Friendly Name, e.g. Active"}),s.jsx("div",{})]}),l.length===0?s.jsx("p",{className:"pt-4 text-style-muted",children:"Add some values to get started"}):s.jsx(Yj,{listItems:m,sortItems:d})]}),s.jsx(zy,{size:"sm",variant:"secondary",onClick:()=>{c({id:WN.generateNewId(),name:"",friendlyName:""})},children:"Add Value"})]})]})}const{createEnumBaseSchema:lM}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:rM}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:sM,SectionList:oM}=await C("@baseplate-dev/ui-components");function cM(){const a=qn(lM),{form:n,onSubmit:l,isSavingDefinition:o}=tp({schema:a.omit({name:!0,featureRef:!0})}),{control:c,setValue:d}=n;return rM({control:c,reset:n.reset,onSubmit:l}),s.jsx(Yl,{children:s.jsxs("form",{onSubmit:l,className:"mx-4 max-w-7xl min-w-[700px] flex-1 space-y-4 pb-4",children:[s.jsxs(oM,{children:[s.jsx(KN,{control:c}),s.jsx(iM,{control:c,setValue:d})]}),s.jsx(sM,{form:n,disabled:o})]})})}const{Button:Fy,Dialog:uM,DialogClose:dM,DialogContent:fM,DialogFooter:hM,DialogHeader:mM,DialogTitle:pM,DialogTrigger:gM,useControlledState:vM}=await C("@baseplate-dev/ui-components");function bM({open:a,onOpenChange:n,asChild:l,children:o}){const[c,d]=vM(a,n,!1),{form:{control:f,reset:p},onSubmit:m,defaultValues:g,isSavingDefinition:v}=tp({onSubmitSuccess(){d(!1)}});return s.jsxs(uM,{open:c,onOpenChange:b=>{d(b),b||p(g)},children:[s.jsx(gM,{asChild:l,children:o}),s.jsx(fM,{"aria-describedby":void 0,children:s.jsxs("form",{onSubmit:m,className:"space-y-4",children:[s.jsx(mM,{children:s.jsx(pM,{children:"Edit Enum Info"})}),s.jsx(pS,{control:f}),s.jsxs(hM,{children:[s.jsx(dM,{asChild:!0,children:s.jsx(Fy,{variant:"secondary",children:"Cancel"})}),s.jsx(Fy,{type:"submit",disabled:v,children:"Save"})]})]})})]})}const{FeatureUtils:yM}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:xM}=await C("@baseplate-dev/project-builder-lib/web"),{Button:jM,useConfirmDialog:SM}=await C("@baseplate-dev/ui-components");function wM({className:a,enumDefinition:n}){const{definition:l,saveDefinitionWithFeedbackSync:o,isSavingDefinition:c}=xM(),d=on(),{requestConfirm:f}=SM(),p=m=>{o(g=>{g.enums=g.enums?.filter(v=>v.id!==m)},{onSuccess:()=>{d("/data/enums")}})};return s.jsxs("div",{className:Te("flex items-center justify-between",a),children:[s.jsxs("div",{children:[s.jsx(bM,{asChild:!0,children:s.jsxs("button",{className:"group flex items-center space-x-2 hover:cursor-pointer",type:"button",title:"Edit Enum Info",children:[s.jsx("h1",{children:n.name}),s.jsx(Vl,{className:"invisible size-4 group-hover:visible"})]})}),n.featureRef&&s.jsx("div",{className:"text-xs text-muted-foreground",children:yM.getFeatureById(l,n.featureRef)?.name})]}),s.jsx("div",{className:"flex gap-8",children:s.jsxs(jM,{variant:"outline",size:"icon",onClick:()=>{f({title:"Confirm delete",content:`Are you sure you want to delete ${n.name}?`,buttonConfirmVariant:"destructive",buttonConfirmText:"Delete",onConfirm:()=>{p(n.id)}})},disabled:c,children:[s.jsx(ys,{className:"text-destructive"}),s.jsx("div",{className:"sr-only",children:"Delete Enum"})]})})]})}const{EnumUtils:CM,modelEnumEntityType:EM}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:DM}=await C("@baseplate-dev/project-builder-lib/web");function TM(){const{key:a}=Ki(),{definition:n}=DM(),l=EM.idFromKey(a),o=CM.byId(n,l??"");return o?s.jsxs("div",{className:"relative flex h-full flex-1 flex-col overflow-hidden",children:[s.jsx("div",{className:"mx-4 max-w-7xl space-y-4 border-b py-4",children:s.jsx(wM,{enumDefinition:o})}),s.jsx("div",{className:"mb-(--action-bar-height) flex flex-1 overflow-y-auto",children:s.jsx(bi,{})})]},l):s.jsx(zc,{})}const{modelEnumEntityType:RM}=await C("@baseplate-dev/project-builder-lib"),NM={path:"edit/:key/*",element:s.jsx(TM,{}),handle:{crumb:Uc(RM,"Edit Enum","/data/enums/edit/:key")},children:[{index:!0,element:s.jsx(cM,{})},Rs]},{Button:MM}=await C("@baseplate-dev/ui-components");function AM(){return s.jsxs("div",{className:"max-w-4xl space-y-4 p-4 text-style-prose",children:[s.jsx("h1",{children:"Enums"}),s.jsxs("p",{children:["Enums are a way to define a set of named values. They can be used to define a type that can only have a certain set of values. For example, you might have an enum called ",s.jsx("strong",{children:"Color"})," with values"," ",s.jsx("code",{children:"RED"}),", ",s.jsx("code",{children:"GREEN"}),", and ",s.jsx("code",{children:"BLUE"}),"."]}),s.jsxs("p",{children:["Choose an enum to edit from the sidebar or"," ",s.jsx(gS,{children:s.jsx(MM,{variant:"link",size:"none",children:"create a new enum"})}),"."]})]})}const $M={path:"enums/*",handle:{crumb:{label:"Enums",url:"/data/enums"}},children:[{index:!0,element:s.jsx(AM,{})},NM,Rs]},{Button:qy,Dialog:LM,DialogClose:OM,DialogContent:UM,DialogFooter:zM,DialogHeader:BM,DialogTitle:_M,DialogTrigger:FM,useControlledState:qM}=await C("@baseplate-dev/ui-components");function HM({open:a,onOpenChange:n,children:l,asChild:o}){const[c,d]=qM(a,n,!1),{form:{control:f,reset:p},onSubmit:m,defaultValues:g}=Ns({onSubmitSuccess(){d(!1)}});return s.jsxs(LM,{open:c,onOpenChange:v=>{d(v),v||p(g)},children:[l&&s.jsx(FM,{asChild:o,children:l}),s.jsx(UM,{"aria-describedby":void 0,children:s.jsxs("form",{onSubmit:m,className:"space-y-4",children:[s.jsx(BM,{children:s.jsx(_M,{children:"Edit Model Info"})}),s.jsx(vS,{control:f}),s.jsxs(zM,{children:[s.jsx(OM,{asChild:!0,children:s.jsx(qy,{variant:"secondary",children:"Cancel"})}),s.jsx(qy,{type:"submit",children:"Save"})]})]})})]})}const{FeatureUtils:PM}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:kM}=await C("@baseplate-dev/project-builder-lib/web"),{Button:IM,useConfirmDialog:VM}=await C("@baseplate-dev/ui-components");function GM({className:a,model:n}){const{definition:l,saveDefinitionWithFeedbackSync:o,isSavingDefinition:c}=kM(),d=on(),{requestConfirm:f}=VM(),p=m=>{o(g=>{g.models=g.models.filter(v=>v.id!==m)},{onSuccess:()=>{d("/data/models")},successMessage:"Successfully deleted model!"})};return s.jsxs("div",{className:Te("flex items-center justify-between border-b py-4",a),children:[s.jsxs("div",{children:[s.jsx(HM,{asChild:!0,children:s.jsxs("button",{className:"group flex items-center space-x-2 hover:cursor-pointer",type:"button",title:"Edit Model Info",children:[s.jsx("h1",{children:n.name}),s.jsx(Vl,{className:"invisible size-4 group-hover:visible"})]})}),n.featureRef&&s.jsx("div",{className:"text-xs text-muted-foreground",children:PM.getFeatureById(l,n.featureRef)?.name})]}),s.jsx("div",{className:"flex gap-8",children:s.jsxs(IM,{variant:"outline",size:"icon",disabled:c,onClick:()=>{f({title:"Confirm delete",content:`Are you sure you want to delete ${n.name}?`,buttonConfirmText:"Delete",buttonConfirmVariant:"destructive",onConfirm:()=>{p(n.id)}})},children:[s.jsx(ys,{className:"text-destructive"}),s.jsx("div",{className:"sr-only",children:"Delete Model"})]})})]})}const{modelEntityType:YM,ModelUtils:XM}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:QM}=await C("@baseplate-dev/project-builder-lib/web"),{NavigationTabs:KM,NavigationTabsItem:wh}=await C("@baseplate-dev/ui-components");function ZM(){const{key:a}=Ki(),{definition:n}=QM(),l=YM.idFromKey(a),o=XM.byId(n,l??"");return o?s.jsxs("div",{className:"relative flex h-full flex-1 flex-col overflow-hidden",children:[s.jsxs("div",{className:"max-w-7xl space-y-4 px-4 pb-4",children:[s.jsx(GM,{model:o}),s.jsxs(KM,{children:[s.jsx(wh,{asChild:!0,children:s.jsx(Ht,{to:"",end:!0,children:"Fields"})}),s.jsx(wh,{asChild:!0,children:s.jsx(Ht,{to:"service",children:"Service"})}),s.jsx(wh,{asChild:!0,children:s.jsx(Ht,{to:"graphql",children:"GraphQL"})})]})]}),s.jsx("div",{className:"mb-(--action-bar-height) flex flex-1 overflow-y-auto",style:{"--action-bar-height":"52px"},children:s.jsx(bi,{})})]},l):s.jsx(zc,{})}const{useRef:WM}=await C("react");function JM(a){const n=WM(void 0);return l=>{const o=a(l);return n4(n.current,o)?n.current:(n.current=o,o)}}const{ModelUtils:eA}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:tA}=await C("@baseplate-dev/project-builder-lib/web"),{createContext:nA,useContext:aA,useEffect:iA,useMemo:lA}=await C("react"),bS=nA(void 0);function np({children:a,watch:n,initialModel:l,getValues:o}){const{definition:c}=tA(),d=eA.byIdOrThrow(c,l.id),f=lA(()=>Uw(p=>({model:{...d,...l},setModel:m=>{p({model:{...d,...m}})},getValues:o})),[l,o,d]);return iA(()=>{const{unsubscribe:p}=n(m=>{f.getState().setModel(m)});return p},[n,f]),s.jsx(bS.Provider,{value:f,children:a})}function lt(a){const n=aA(bS);if(!n)throw new Error("useEditedModelConfig must be used within a EditedModelContextProvider");return Ow(n,JM(l=>a(l.model)))}const{authConfigSpec:rA}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:sA}=await C("@baseplate-dev/project-builder-lib/web"),{Alert:oA,AlertDescription:cA,AlertTitle:uA,MultiSwitchField:Ch,SectionListSection:dA,SectionListSectionContent:fA,SectionListSectionDescription:hA,SectionListSectionHeader:mA,SectionListSectionTitle:pA,SwitchFieldController:Eh}=await C("@baseplate-dev/ui-components");function gA({control:a}){const{definition:n,pluginContainer:l}=sA(),o=l.getPluginSpecOptional(rA)?.getAuthRoles(n).map(x=>({label:x.name,value:x.id})),c=it({control:a,name:"graphql.objectType.enabled"}),d=lt(x=>x.service??{}),f=it({control:a,name:"graphql.mutations.create.enabled"}),p=d.create?.enabled,m=it({control:a,name:"graphql.mutations.update.enabled"}),g=d.update?.enabled,v=it({control:a,name:"graphql.mutations.delete.enabled"}),b=d.delete?.enabled;return s.jsxs(dA,{children:[s.jsx("div",{children:s.jsxs(mA,{className:"sticky top-2",children:[s.jsx(pA,{children:"Mutations"}),s.jsx(hA,{children:"Configure the GraphQL mutations that can be performed on this model."})]})}),s.jsxs(fA,{className:"space-y-8",children:[(!p||!g||!b)&&s.jsxs(oA,{className:"max-w-md",children:[s.jsx(Tm,{}),s.jsxs(uA,{children:["Service methods disabled (",[!p&&"Create",!g&&"Update",!b&&"Delete"].filter(Boolean).join(", "),")"]}),s.jsxs(cA,{children:["Enable the appropriate methods on the"," ",s.jsx(Sn,{to:"../service",className:"font-semibold",children:"the service tab"})," ","to expose mutations"]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx(Eh,{control:a,name:"graphql.mutations.create.enabled",disabled:!c||!p,label:"Create Mutation",description:"Expose the create method in the GraphQL schema, e.g. createUser(input: $input)."}),f&&o&&s.jsx(Ch.Controller,{control:a,name:"graphql.mutations.create.roles",label:"Allowed Roles",options:o,className:"ml-[52px]"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx(Eh,{control:a,name:"graphql.mutations.update.enabled",label:"Update Mutation",disabled:!c||!g,description:"Expose the update method in the GraphQL schema, e.g. updateUser(id: $id, input: $input)."}),m&&o&&s.jsx(Ch.Controller,{control:a,name:"graphql.mutations.update.roles",label:"Allowed Roles",options:o,className:"ml-[52px]"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Eh,{control:a,name:"graphql.mutations.delete.enabled",label:"Delete Mutation",disabled:!c||!b,description:"Expose the delete method in the GraphQL schema, e.g. deleteUser(id: $id)."}),v&&o&&s.jsx(Ch.Controller,{control:a,name:"graphql.mutations.delete.roles",label:"Allowed Roles",options:o,className:"ml-[52px]"})]})]})]})}function Dh(a){return Yi({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"},child:[]}]})(a)}function Th(a){return Yi({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z",clipRule:"evenodd"},child:[]}]})(a)}const{modelTransformerEntityType:vA,ModelTransformerUtils:bA,ModelUtils:yS}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:yA}=await C("@baseplate-dev/project-builder-lib/web"),{MultiComboboxFieldController:Hy,SelectFieldController:xA}=await C("@baseplate-dev/ui-components"),{useEffect:jA}=await C("react");function SA({formProps:a,name:n}){const l=n,o=a,{control:c,setValue:d}=o,{definition:f,definitionContainer:p,pluginContainer:m}=yA(),g=it({control:c,name:l}),v=lt(E=>{const A=yS.getRelationsToModel(f,E.id),B=E.service?.transformers?.filter(H=>H.type==="embeddedRelation"&&H.id!==g.id);return A.filter(({relation:H})=>!B?.some(V=>V.foreignRelationRef===H.foreignId))}),b=v.map(E=>({label:`${E.relation.foreignRelationName} (${E.model.name})`,value:E.relation.foreignId})),x=g.type==="embeddedRelation"?g:null,j=v.find(E=>E.relation.foreignId===x?.foreignRelationRef),D=zm(x?.foreignRelationRef);jA(()=>{D!==void 0&&D!==x?.foreignRelationRef&&(d(`${l}.embeddedFieldNames`,[]),j?.model.id&&d(`${l}.modelRef`,j.model.id))},[l,d,j,x?.foreignRelationRef,D,v]);const S=j?.model.model.fields.filter(E=>!j.relation.references.some(A=>A.localRef===E.id)).map(E=>({label:E.name,value:E.id}))??[],R=j?.model.service.transformers.map(E=>({label:bA.getTransformName(p,E,m),value:E.id}))??[];return s.jsxs("div",{className:"space-y-4",children:[s.jsx(xA,{control:c,name:`${l}.foreignRelationRef`,options:b,label:"Relation",placeholder:"Select relation"}),s.jsx(Hy,{control:c,disabled:S.length===0,options:S,name:`${l}.embeddedFieldNames`,label:"Embedded Field Names"}),R.length>0&&s.jsx(Hy,{control:c,options:R,name:`${l}.embeddedTransformerNames`,label:"Embedded Transformers"})]})}const wA={name:"embeddedRelation",label:"Embedded Relation",description:"Upsert records to a related model table",instructions:`This transformer allows you to upsert related records to a related model's table
|
|
67
|
+
e.g. UserRole records for a User. It will create, update, delete related records to fit the provided
|
|
68
|
+
input.`,getSummary(a,n){return[{label:"Embedded Relation",description:n.nameFromId(a.foreignRelationRef)}]},allowNewTransformer(a,n){const{definition:l}=a,o=yS.getRelationsToModel(l,n.id),c=n.service?.transformers?.filter(d=>d.type==="embeddedRelation");return o.some(({relation:d})=>!c?.some(f=>f.foreignRelationRef===d.foreignId))},getNewTransformer:()=>({id:vA.generateNewId(),foreignRelationRef:"",type:"embeddedRelation",embeddedFieldNames:[],modelRef:""}),Form:SA,pluginId:void 0},{modelTransformerEntityType:CA}=await C("@baseplate-dev/project-builder-lib"),{createNewModelTransformerWebConfig:EA}=await C("@baseplate-dev/project-builder-lib/web"),ap=[wA,EA({name:"password",label:"Password",description:"Hashes the input value of value 'password' using Argon2id",getNewTransformer:()=>({id:CA.generateNewId(),type:"password"}),allowNewTransformer(a,n){return!n.service?.transformers?.some(l=>l.type==="password")&&n.model.fields.some(l=>l.name==="passwordHash")},getSummary:()=>[],pluginId:void 0})],ip={string:{label:"String",value:"string",description:"Variable length text"},int:{label:"Integer",value:"int",description:"Whole number"},float:{label:"Float",value:"float",description:"Decimal number"},decimal:{label:"Decimal",value:"decimal",description:"Precise decimal number"},boolean:{label:"Boolean",value:"boolean",description:"True or false value"},json:{label:"JSON",value:"json",description:"JSON data"},uuid:{label:"UUID",value:"uuid",description:"Unique identifier"},dateTime:{label:"DateTime",value:"dateTime",description:"Date and time"},date:{label:"Date",value:"date",description:"Calendar date"},enum:{label:"Enum",value:"enum",description:"List of values"}};function DA(a){const n=/([_\s-]*[A-Z]+(?![^\s\-_A-Z])|[_\s-]*[A-Z]*[^\s\-_A-Z]+)/g;return a.match(n)??[]}function Py(a,n){return a.length<=n?a:`${a.slice(0,Math.max(0,n-3))}...`}function TA(a,n=20){if(a.length<=n)return a;if(a.length<=3)return"...";const l=DA(a);if(l.length===1)return Py(a,n);const o=l[0],c=(l.at(-1)??"").replace(/^[_\s-]+/,""),d=c.length;if(o.length+d+3>n)return Py(a,n);let f=o;for(let p=1;p<l.length-1;p++){const m=l[p].length;if(f.length+m+d+3>n)break;f+=l[p]}return`${f}...${c}`}const{Badge:RA}=await C("@baseplate-dev/ui-components");function ss({className:a,children:n,type:l}){return s.jsxs("div",{className:Te("flex h-8 w-full items-center justify-between gap-4 rounded-md border bg-muted px-3 text-sm",a),children:[s.jsx("div",{children:n}),s.jsx(RA,{variant:"outline",className:"text-muted-foreground",children:TA(l,20)})]})}const{ModelUtils:NA}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:MA}=await C("@baseplate-dev/project-builder-lib/web"),{Badge:Rh,Button:Nh,Label:Mh,SectionListSection:AA,SectionListSectionContent:$A,SectionListSectionDescription:LA,SectionListSectionHeader:OA,SectionListSectionTitle:UA,Switch:Ah,SwitchFieldController:zA}=await C("@baseplate-dev/ui-components"),{useState:$h}=await C("react"),BA="border-collapse text-left [&_td]:py-1 [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-10 [&_th]:py-2";function Lh(a,n,l,o){return l?a.filter(c=>n.includes(c.id)||c.id===o).map(c=>c.id):n.filter(c=>c!==o)}function _A({control:a}){const{definitionContainer:n,definition:l}=MA(),o=lt(T=>T.id),c=it({control:a,name:"graphql.objectType.enabled"}),d=lt(T=>T.model.fields),{field:{value:f=[],onChange:p}}=fa({control:a,name:"graphql.objectType.fields"}),m=d.length>10,[g,v]=$h(m),b=lt(T=>T.model.relations)??[],{field:{value:x=[],onChange:j}}=fa({control:a,name:"graphql.objectType.localRelations"}),D=b.length>4,[S,R]=$h(D),E=NA.getRelationsToModel(l,o),{field:{value:A=[],onChange:B}}=fa({control:a,name:"graphql.objectType.foreignRelations"}),H=E.length>4,[V,K]=$h(H);return s.jsxs(AA,{children:[s.jsx("div",{children:s.jsxs(OA,{className:"sticky top-2",children:[s.jsx(UA,{children:"Object Type"}),s.jsx(LA,{children:"Configure the object type that will be exposed in the GraphQL schema for this model."})]})}),s.jsxs($A,{className:"space-y-4",children:[s.jsx(zA,{control:a,name:"graphql.objectType.enabled",label:"Enable Object Type",description:"Must be enabled for queries, mutations, and any relations to this model"}),s.jsxs("table",{className:BA,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:s.jsxs("div",{className:"flex w-80 items-center gap-1",children:[s.jsx(Mh,{children:"Exposed Fields"}),s.jsxs(Rh,{variant:"outline",className:"mr-5 font-medium text-muted-foreground",children:[f.length,"/",d.length," active"]}),m?s.jsx(Nh,{onClick:()=>{v(!g)},className:"flex items-center gap-4",title:g?"Expand fields":"Collapse fields",type:"button",variant:"ghost",size:"icon",children:g?s.jsx(Dh,{}):s.jsx(Th,{})}):null]})}),s.jsx("th",{className:"pl-8"})]})}),s.jsxs("tbody",{children:[!g&&d.map(T=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ss,{type:T.type==="enum"&&T.options?.enumRef?n.nameFromId(T.options.enumRef):ip[T.type].label,children:T.name})}),s.jsx("td",{className:"pl-8",children:s.jsx(Ah,{"aria-label":`Expose ${T.name} field`,disabled:!c,checked:f.includes(T.id),onCheckedChange:O=>{p(Lh(d,f,O,T.id))}})})]},T.id)),b.length>0?s.jsxs("tr",{children:[s.jsx("th",{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Mh,{children:"Exposed Local Relations"}),s.jsxs(Rh,{variant:"outline",className:"mr-5 font-medium text-muted-foreground",children:[x.length,"/",b.length," ","active"]}),D?s.jsx(Nh,{onClick:()=>{R(!S)},className:"flex items-center gap-4",title:S?"Expand fields":"Collapse fields",type:"button",variant:"ghost",size:"icon",children:S?s.jsx(Dh,{}):s.jsx(Th,{})}):null]})}),s.jsx("th",{})]}):null,!S&&b.map(T=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ss,{type:n.nameFromId(T.modelRef),children:T.name})}),s.jsx("td",{className:"pl-8",children:s.jsx(Ah,{"aria-label":`Expose ${T.name} relation`,disabled:!c,checked:x.includes(T.id),onCheckedChange:O=>{j(Lh(b,x,O,T.id))}})})]},T.id)),E.length>0?s.jsxs("tr",{children:[s.jsx("th",{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Mh,{children:"Exposed Foreign Relations"}),s.jsxs(Rh,{variant:"outline",className:"mr-5 font-medium text-muted-foreground",children:[A.length,"/",E.length," ","active"]}),H?s.jsx(Nh,{onClick:()=>{K(!V)},className:"flex items-center gap-4",title:V?"Expand fields":"Collapse fields",type:"button",variant:"ghost",size:"icon",children:V?s.jsx(Dh,{}):s.jsx(Th,{})}):null]})}),s.jsx("th",{})]}):null,!V&&E.map(({model:T,relation:O})=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ss,{type:T.name,children:O.foreignRelationName})}),s.jsx("td",{className:"pl-8",children:s.jsx(Ah,{"aria-label":`Expose ${O.foreignRelationName} relation`,disabled:!c,checked:A.includes(O.foreignId),onCheckedChange:Q=>{B(Lh(E.map(({relation:te})=>({id:te.foreignId})),A,Q,O.foreignId))}})})]},O.id))]})]})]})]})}const{authConfigSpec:FA}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:qA}=await C("@baseplate-dev/project-builder-lib/web"),{Alert:HA,AlertDescription:PA,AlertTitle:kA,MultiSwitchField:ky,SectionListSection:IA,SectionListSectionContent:VA,SectionListSectionDescription:GA,SectionListSectionHeader:YA,SectionListSectionTitle:XA,SwitchFieldController:Iy}=await C("@baseplate-dev/ui-components");function QA({control:a}){const{definition:n,pluginContainer:l}=qA(),o=it({control:a,name:"graphql.objectType.enabled"}),c=l.getPluginSpecOptional(FA)?.getAuthRoles(n).map(p=>({label:p.name,value:p.id})),d=it({control:a,name:"graphql.queries.get.enabled"}),f=it({control:a,name:"graphql.queries.list.enabled"});return s.jsxs(IA,{children:[s.jsx("div",{children:s.jsxs(YA,{className:"sticky top-2",children:[s.jsx(XA,{children:"Queries"}),s.jsx(GA,{children:"Configure the GraphQL queries that can be performed on this model."})]})}),s.jsxs(VA,{className:"space-y-8",children:[!o&&s.jsxs(HA,{className:"max-w-md",children:[s.jsx(Tm,{}),s.jsx(kA,{children:"Object type missing"}),s.jsx(PA,{children:"Enable the object type to expose queries and mutations"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx(Iy,{control:a,name:"graphql.queries.get.enabled",label:"Get By ID Query",disabled:!o,description:"Expose method for querying a single instance of this model by its ID, e.g. user(id: $id)."}),d&&c&&s.jsx(ky.Controller,{control:a,name:"graphql.queries.get.roles",label:"Allowed Roles",options:c,className:"ml-[52px]"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx(Iy,{control:a,name:"graphql.queries.list.enabled",disabled:!o,label:"List Query",description:"Expose method for querying a list of instances of this model, e.g. users."}),f&&c&&s.jsx(ky.Controller,{control:a,name:"graphql.queries.list.roles",label:"Allowed Roles",options:c,className:"ml-[52px]"})]})]})]})}const{useBlockUnsavedChangesNavigate:KA}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:ZA,SectionList:WA}=await C("@baseplate-dev/ui-components");function JA(){const{form:a,onSubmit:n,defaultValues:l}=Ns({omit:["name","featureRef"]}),{control:o,watch:c,getValues:d,reset:f}=a;return KA({control:o,reset:f,onSubmit:n}),s.jsx(np,{initialModel:l,getValues:d,watch:c,children:s.jsx("form",{onSubmit:n,className:"space-y-4 p-4",children:s.jsxs(WA,{children:[s.jsx(_A,{control:o}),s.jsx(QA,{control:o}),s.jsx(gA,{control:o}),s.jsx(ZA,{form:a})]})})})}const{modelScalarFieldEntityType:Vy}=await C("@baseplate-dev/project-builder-lib"),{Button:Gy,ButtonGroup:e$,DropdownMenu:t$,DropdownMenuContent:n$,DropdownMenuItem:a$,DropdownMenuTrigger:i$}=await C("@baseplate-dev/ui-components"),{useMemo:l$}=await C("react");function r$({className:a,appendField:n,setValue:l}){const o=lt(p=>p.model.fields.map(m=>m.name)),c=lt(p=>p.model.primaryKeyFieldRefs.length),d=l$(()=>{const p=[];c||p.push({name:"ID (uuid)",fields:[{name:"id",type:"uuid",options:{genUuid:!0},isPrimaryKey:!0}]});const m=o.includes("createdAt"),g=o.includes("updatedAt");return(!m||!g)&&p.push({name:"Timestamps",fields:[{name:"createdAt",type:"dateTime",options:{defaultToNow:!0}},{name:"updatedAt",type:"dateTime",options:{updatedAt:!0,defaultToNow:!0}}]}),p},[o,c]),f=p=>{for(const{isPrimaryKey:m,...g}of p.fields){const v=Vy.generateNewId();o.includes(g.name)||n({id:v,...g}),m&&l("model.primaryKeyFieldRefs",[v],{shouldDirty:!0})}};return s.jsxs(e$,{className:a,children:[s.jsx(Gy,{variant:"secondary",onClick:()=>{n({id:Vy.generateNewId(),name:"",type:"string",isOptional:!0,options:{default:""}})},size:"sm",children:"Add Field"}),s.jsxs(t$,{children:[s.jsx(i$,{disabled:d.length===0,asChild:!0,children:s.jsx(Gy,{variant:"secondary",size:"sm",children:s.jsx(Iw,{})})}),s.jsx(n$,{children:d.map(p=>s.jsx(a$,{onClick:()=>{f(p)},children:p.name},p.name))})]})]})}const{Button:Yy,DialogClose:s$,DialogFooter:o$,MultiComboboxFieldController:c$}=await C("@baseplate-dev/ui-components"),{useId:u$}=await C("react"),{z:Oh}=await C("zod"),d$=Oh.object({fields:Oh.array(Oh.string()).min(1,"At least one primary key is required")});function f$({className:a,control:n,onSubmitSuccess:l}){const o=lt(v=>v.model.fields),{field:{value:c=[],onChange:d}}=fa({name:"model.primaryKeyFieldRefs",control:n}),{control:f,handleSubmit:p}=gi({resolver:kt(d$),values:{fields:c}}),m=p(v=>{d(v.fields),l?.()}),g=u$();return s.jsxs("form",{className:Te("space-y-4",a),onSubmit:v=>(v.stopPropagation(),m(v)),id:g,children:[s.jsx(c$,{control:f,name:"fields",options:o.map(v=>({value:v.id,label:v.name})),placeholder:"Select fields to use as primary keys"}),s.jsxs(o$,{children:[s.jsx(s$,{asChild:!0,children:s.jsx(Yy,{variant:"secondary",children:"Cancel"})}),s.jsx(Yy,{type:"submit",form:g,children:"Save"})]})]})}const{Dialog:h$,DialogContent:m$,DialogDescription:p$,DialogHeader:g$,DialogTitle:v$,DialogTrigger:b$,useControlledState:y$}=await C("@baseplate-dev/ui-components");function xS({control:a,children:n,asChild:l,open:o,onOpenChange:c}){const[d,f]=y$(o,c,!1);return s.jsxs(h$,{open:d,onOpenChange:f,children:[n&&s.jsx(b$,{asChild:l,children:n}),s.jsxs(m$,{children:[s.jsxs(g$,{children:[s.jsx(v$,{children:"Primary Keys"}),s.jsx(p$,{children:"Select the fields that will be used as the primary key for this model"})]}),s.jsx(f$,{control:a,onSubmitSuccess:()=>{f(!1)}})]})]})}const{BadgeWithIcon:x$}=await C("@baseplate-dev/ui-components"),{useState:j$}=await C("react");function S$({className:a,control:n,autoCollapse:l}){const[o,c]=j$(!1),d=!l||o;return s.jsx(xS,{control:n,children:s.jsx(x$,{icon:Vw,variant:"secondary",className:a,onMouseEnter:()=>{c(!0)},onMouseLeave:()=>{c(!1)},"aria-label":"Primary Key",title:"Primary Key",children:d&&"Primary"})})}const{createModelRelationFieldSchema:w$,ModelFieldUtils:C$,modelForeignRelationEntityType:E$,modelLocalRelationEntityType:D$,ModelUtils:Xy}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:T$}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Uh,ComboboxField:R$,ComboboxFieldController:zh,DialogClose:N$,DialogFooter:M$,InputFieldController:Qy,SelectFieldController:A$,toast:Ky}=await C("@baseplate-dev/ui-components"),jS=await C("react"),{useId:$$,useMemo:L$}=jS;function O$(a,n,l){if(!l)return;const o=l.replace(/Id$/,""),c=m=>a.models.find(g=>g.id!==n.id&&m(g))?.id,d=c(m=>m.name.toLowerCase()===o.toLowerCase());if(d)return d;const f=c(m=>m.featureRef===m.featureRef&&m.name.toLowerCase().includes(o.toLowerCase()));return f||c(m=>m.name.toLowerCase().includes(o.toLowerCase()))}function Zy(a,n,l,o){const c=(()=>{if(l.name)return l.name;if(l.modelRef){const p=Xy.byIdOrThrow(a,l.modelRef);return Fl(p.name)}})(),d=(()=>{if(!l.modelRef)return;const{model:{fields:p,primaryKeyFieldRefs:m},name:g}=Xy.byIdOrThrow(a,l.modelRef),v=p.filter(x=>m.includes(x.id)),b=l.references??[];return v.map((x,j)=>{const D=j===0&&o?o:v.length===1?`${Fl(g)}Id`:x.name;return{localRef:b[j]?.localRef??n.model.fields.find(R=>R.name===D)?.id,foreignRef:x.id}})})(),f=(()=>{if(!d)return;if(l.foreignRelationName)return l.foreignRelationName;const p=d.every(m=>m.localRef)&&C$.areScalarsUnique(n,d.map(m=>m.localRef));return Fl(p?n.name:Ux.pluralize(n.name))})();return{name:c??"",foreignRelationName:f??"",references:d??[]}}function U$({className:a,control:n,onSubmitSuccess:l,relationId:o,defaultFieldName:c}){const{definition:d}=T$(),f=lt(G=>G),p=f.name,{fields:m}=f.model,{field:{value:g=[],onChange:v}}=fa({name:"model.relations",control:n}),b=d.models.map(G=>({label:G.name,value:G.id})),x=o===void 0?void 0:g.find(G=>G.id===o),j=L$(()=>{if(x)return x;const G=O$(d,f,c);return{id:D$.generateNewId(),foreignId:E$.generateNewId(),modelRef:G??"",onDelete:"Restrict",onUpdate:"Restrict",...Zy(d,f,{modelRef:G},c)}},[x,c,d,f]),D=qn(w$),{control:S,handleSubmit:R,setError:E,watch:A,setValue:B}=gi({resolver:kt(D),defaultValues:j}),H=A(),V=H.modelRef?d.models.find(G=>G.id===H.modelRef):void 0,K=V?.model.fields,T=m.map(G=>({label:G.name,value:G.id})),O=K?.map(G=>({label:G.name,value:G.id}))??[],Q=H.references.some(G=>m.find(W=>W.id===G.localRef)?.isOptional),te=()=>{v(g.filter(G=>G.id!==o)),l?.()},ae=R(G=>{const{id:W}=G;if(m.some(Y=>Y.name===G.name)||g.some(Y=>Y.name===G.name&&Y.id!==G.id)){E("name",{message:"The relation name cannot be the same as a field/relation name"});return}const U=G.references.map(Y=>Y.localRef);if(new Set(U).size!==U.length){Ky.error("Local fields must be unique");return}const k=G.references.map(Y=>Y.foreignRef);if(new Set(k).size!==k.length){Ky.error("Foreign fields must be unique");return}g.some(Y=>Y.id===W)?v(g.map(Y=>Y.id===W?G:Y)):v([...g,G]),l?.()}),se=$$(),Ee=!!V;return s.jsxs("form",{className:Te("space-y-4",a),onSubmit:G=>(G.stopPropagation(),ae(G)),id:se,children:[s.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2",children:[s.jsx(R$,{options:[{label:p,value:p}],value:p,disabled:!0,label:"Local Model"}),s.jsx(zh,{control:S,name:"modelRef",options:b,label:"Foreign Model",onChange:G=>{if(!G)return;const{foreignRelationName:W,name:U,references:k}=Zy(d,f,{...H,modelRef:G},c);W&&B("foreignRelationName",W),U&&B("name",U),B("references",k)}})]}),s.jsxs("div",{className:Te("grid grid-cols-2 gap-x-8 gap-y-2",!Ee&&"pointer-events-none opacity-50"),children:[s.jsx(Qy,{control:S,disabled:!Ee,name:"name",label:"Local Relation Name",description:s.jsxs("span",{children:["Name of the relation, e.g. ",Fl(p),".",s.jsx("strong",{children:V?.name?Fl(V.name):"user"})]})}),s.jsx(Qy,{control:S,disabled:!Ee,name:"foreignRelationName",label:"Foreign Relation Name",description:s.jsxs("span",{children:["Name of the relation on the foreign model, e.g."," ",Fl(V?.name??"post"),".",s.jsx("strong",{children:j.foreignRelationName||"user"})]})}),s.jsx("div",{className:"text-sm font-medium",children:"Local Field"}),s.jsx("div",{className:"text-sm font-medium",children:"Foreign Field"}),H.references.map((G,W)=>s.jsxs(jS.Fragment,{children:[s.jsx(zh,{disabled:!Ee,control:S,name:`references.${W}.localRef`,options:T}),s.jsx(zh,{control:S,name:`references.${W}.foreignRef`,options:O,disabled:!0})]},W))]}),s.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 border-t pt-4",children:s.jsx(A$,{label:"On Delete",control:S,options:[{label:"Cascade (delete entire local row)",value:"Cascade"},{label:"Restrict (throw error)",value:"Restrict"},...Q?[{label:"Set Null (set local field to null)",value:"SetNull"}]:[]],name:"onDelete",description:"What to do when the foreign row is deleted"})}),s.jsx(M$,{children:s.jsxs("div",{className:"flex w-full justify-between",children:[o&&s.jsx(Uh,{variant:"secondary",onClick:G=>{G.preventDefault(),te()},children:"Delete"}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(N$,{asChild:!0,children:s.jsx(Uh,{variant:"secondary",children:"Cancel"})}),s.jsx(Uh,{type:"submit",form:se,disabled:!Ee,children:"Save"})]})]})})]})}const{Dialog:z$,DialogContent:B$,DialogDescription:_$,DialogHeader:F$,DialogTitle:q$,DialogTrigger:H$,useControlledState:P$}=await C("@baseplate-dev/ui-components");function Nc({control:a,children:n,asChild:l,open:o,onOpenChange:c,relationId:d,defaultFieldName:f}){const[p,m]=P$(o,c,!1);return s.jsxs(z$,{open:p,onOpenChange:m,children:[n&&s.jsx(H$,{asChild:l,children:n}),s.jsxs(B$,{width:"lg",children:[s.jsxs(F$,{children:[s.jsx(q$,{children:d?"Edit Relation":"Create Relation"}),s.jsx(_$,{children:"Set up the relation between this model and another model"})]}),s.jsx(U$,{control:a,onSubmitSuccess:()=>{m(!1)},relationId:d,defaultFieldName:f})]})]})}const{useProjectDefinition:k$}=await C("@baseplate-dev/project-builder-lib/web"),{BadgeWithIcon:I$}=await C("@baseplate-dev/ui-components"),{useState:V$}=await C("react");function G$({className:a,control:n,relation:l,autoCollapse:o}){const{definitionContainer:c}=k$(),[d,f]=V$(!1),p=!o||d;return s.jsx(Nc,{control:n,relationId:l.id,children:s.jsx(I$,{icon:Gw,variant:"secondary",className:Te("max-w-[100px]",a),onMouseEnter:()=>{f(!0)},onMouseLeave:()=>{f(!1)},"aria-label":"Relation",title:"Relation",children:p&&`${c.nameFromId(l.modelRef)} ${l.references.length>1?`(${l.references.length})`:""}`})})}const{modelUniqueConstraintEntityType:Y$}=await C("@baseplate-dev/project-builder-lib"),{Button:Bh,DialogClose:X$,DialogFooter:Q$,MultiComboboxFieldController:K$}=await C("@baseplate-dev/ui-components"),{useId:Z$}=await C("react"),{z:lc}=await C("zod"),W$=lc.object({id:lc.string().optional(),fields:lc.array(lc.string()).min(1,"At least one field is required")});function J$({className:a,control:n,onSubmitSuccess:l,constraintId:o}){const c=lt(j=>j.model.fields),{field:{value:d=[],onChange:f}}=fa({name:"model.uniqueConstraints",control:n}),p=o===void 0?void 0:d.find(j=>j.id===o),{control:m,handleSubmit:g}=gi({resolver:kt(W$),values:p?{id:p.id,fields:p.fields.map(j=>j.fieldRef)}:{fields:[]}}),v=()=>{f(d.filter(j=>j.id!==o)),l?.()},b=g(j=>{const D={id:j.id??Y$.generateNewId(),fields:j.fields.map(R=>({fieldRef:R}))},{id:S}=D;d.some(R=>R.id===S)?f(d.map(R=>R.id===S?D:R)):f([...d,D]),l?.()}),x=Z$();return s.jsxs("form",{className:Te("space-y-4",a),onSubmit:j=>(j.stopPropagation(),b(j)),id:x,children:[s.jsx(K$,{control:m,name:"fields",options:c.map(j=>({value:j.id,label:j.name})),placeholder:"Select fields to use as primary keys"}),s.jsx(Q$,{children:s.jsxs("div",{className:"flex w-full justify-between",children:[o&&s.jsx(Bh,{variant:"secondary",onClick:j=>{j.preventDefault(),v()},children:"Delete"}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(X$,{asChild:!0,children:s.jsx(Bh,{variant:"secondary",children:"Cancel"})}),s.jsx(Bh,{type:"submit",form:x,children:"Save"})]})]})})]})}const{Dialog:eL,DialogContent:tL,DialogDescription:nL,DialogHeader:aL,DialogTitle:iL,DialogTrigger:lL,useControlledState:rL}=await C("@baseplate-dev/ui-components");function Mc({control:a,children:n,asChild:l,open:o,onOpenChange:c,constraintId:d}){const[f,p]=rL(o,c,!1);return s.jsxs(eL,{open:f,onOpenChange:p,children:[n&&s.jsx(lL,{asChild:l,children:n}),s.jsxs(tL,{children:[s.jsxs(aL,{children:[s.jsx(iL,{children:"Unique Constraint"}),s.jsx(nL,{children:"Select the fields that will be part of this unique constraint."})]}),s.jsx(J$,{control:a,onSubmitSuccess:()=>{p(!1)},constraintId:d})]})]})}const{BadgeWithIcon:sL}=await C("@baseplate-dev/ui-components"),{useState:oL}=await C("react");function cL({className:a,control:n,constraintId:l,autoCollapse:o}){const[c,d]=oL(!1),f=!o||c,p=lt(m=>m.model.uniqueConstraints?.find(g=>g.id===l)?.fields.length??0);return s.jsx(Mc,{control:n,constraintId:l,children:s.jsx(sL,{variant:"secondary",icon:Yw,className:Te("",a),onMouseEnter:()=>{d(!0)},onMouseLeave:()=>{d(!1)},"aria-label":"Unique Constraint",title:"Unique Constraint",children:f&&`Unique ${p>1?`(${p})`:""}`})})}function uL({className:a,control:n,idx:l}){const o=lt(v=>v.model.fields[l]),c=lt(v=>v.model.primaryKeyFieldRefs.includes(o.id)),d=lt(v=>v.model.uniqueConstraints?.filter(b=>b.fields.some(x=>x.fieldRef===o.id)).map(b=>b.id)??[]),f=lt(({model:v})=>{const b=v.fields[l];return v.relations?.filter(x=>x.references.some(j=>j.localRef===b.id))??[]}),m=(c?1:0)+d.length+f.length>2,g=[c&&s.jsx(S$,{control:n,autoCollapse:m},"primary"),...d.map(v=>s.jsx(cL,{control:n,constraintId:v,autoCollapse:m},v)),...f.map(v=>s.jsx(G$,{control:n,relation:v,autoCollapse:m},v.id))];return s.jsx("div",{className:Te("flex gap-4",a),children:g})}const{EnumUtils:dL}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:fL}=await C("@baseplate-dev/project-builder-lib/web"),{Button:qi,ComboboxField:hL,DropdownMenu:Wy,DropdownMenuContent:Jy,DropdownMenuGroup:ex,DropdownMenuItem:_h,DropdownMenuTrigger:tx,InputField:nx,InputFieldController:Fh,SelectFieldController:mL}=await C("@baseplate-dev/ui-components");function pL({control:a,idx:n,setValue:l}){const{definition:o}=fL(),c=it({control:a,name:`model.fields.${n}.type`}),{field:{value:d,onChange:f}}=fa({name:`model.fields.${n}.options`,control:a}),p=it({control:a,name:`model.fields.${n}.options.default`});if(c==="boolean")return s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(mL,{control:a,className:"flex-1",name:`model.fields.${n}.options.default`,options:[{label:"True",value:"true"},{label:"False",value:"false"}],placeholder:"NULL"}),p&&s.jsx(qi,{title:"Reset",onClick:()=>{l(`model.fields.${n}.options.default`,"",{shouldDirty:!0})},variant:"ghost",size:"icon",children:s.jsx(Wr,{})})]});if(["string","int","float"].includes(c))return s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Fh,{control:a,placeholder:"NULL",name:`model.fields.${n}.options.default`,className:"flex-1"}),p&&s.jsx(qi,{title:"Reset",onClick:()=>{l(`model.fields.${n}.options.default`,void 0,{shouldDirty:!0})},variant:"ghost",size:"icon",children:s.jsx(Wr,{})})]});if(c==="uuid")return d?.genUuid?s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(nx,{disabled:!0,value:"Random UUID v4",className:"flex-1"}),s.jsx(qi,{title:"Reset",onClick:()=>{f({...d,genUuid:!1})},variant:"ghost",size:"icon",children:s.jsx(Wr,{})})]}):s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Fh,{control:a,placeholder:"NULL",name:`model.fields.${n}.options.default`,className:"flex-1"}),s.jsxs(Wy,{children:[s.jsx(tx,{asChild:!0,children:s.jsx(qi,{title:"Options",variant:"ghost",size:"icon",children:s.jsx(Rc,{})})}),s.jsx(Jy,{children:s.jsx(ex,{children:s.jsx(_h,{onSelect:()=>{f({...d,genUuid:!0})},children:"Random UUID v4"})})})]})]});if(c==="dateTime"||c==="date"){const{defaultToNow:m,updatedAt:g}=d??{};return m??g?s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(nx,{disabled:!0,value:g?"Last Updated":"Now",className:"flex-1"}),s.jsx(qi,{title:"Reset",onClick:()=>{f({...d,defaultToNow:!1,updatedAt:!1})},variant:"ghost",size:"icon",children:s.jsx(Wr,{})})]}):s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx(Fh,{placeholder:"NULL",control:a,name:`model.fields.${n}.options.default`,className:"flex-1"}),s.jsxs(Wy,{children:[s.jsx(tx,{asChild:!0,children:s.jsx(qi,{title:"Options",variant:"ghost",size:"icon",children:s.jsx(Rc,{})})}),s.jsx(Jy,{children:s.jsxs(ex,{children:[s.jsx(_h,{onSelect:()=>{f({...d,defaultToNow:!0,updatedAt:!1})},children:"Now"}),s.jsx(_h,{onSelect:()=>{f({...d,defaultToNow:!0,updatedAt:!0})},children:"Last Updated At"})]})})]})]})}if(c==="enum"&&d?.enumRef){const g=dL.byIdOrThrow(o,d.enumRef).values.map(v=>({label:v.friendlyName,value:v.id}));return s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx(hL,{placeholder:"NULL",value:d.defaultEnumValueRef??null,onChange:v=>{f({...d,defaultEnumValueRef:v||void 0})},options:g,className:"flex-1"}),d.defaultEnumValueRef&&s.jsx(qi,{title:"Reset",onClick:()=>{f({...d,defaultEnumValueRef:""})},variant:"ghost",size:"icon",children:s.jsx(Wr,{})})]})}return s.jsx("div",{})}const{SCALAR_FIELD_TYPES:gL}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:vL}=await C("@baseplate-dev/project-builder-lib/web"),{ComboboxField:bL}=await C("@baseplate-dev/ui-components");function yL({control:a,idx:n}){const{definition:l}=vL(),o=(l.enums??[]).map(b=>({label:b.name,value:`enum-${b.id}`,description:"Enum type"})),c=[...gL.filter(b=>b!=="enum").map(b=>ip[b]),...o],{field:{value:d,onChange:f}}=fa({name:`model.fields.${n}.type`,control:a}),{field:{value:p,onChange:m}}=fa({name:`model.fields.${n}.options`,control:a}),g=b=>{if(b?.startsWith("enum-")){const x=b.replace("enum-","");m({enumRef:x}),f("enum")}else f(b)},v=p?.enumRef;return s.jsx("div",{className:"space-y-2",children:s.jsx(bL,{value:d==="enum"&&v?`enum-${v}`:d,onChange:g,options:c,renderItemLabel:b=>s.jsxs("div",{className:"flex flex-col",children:[s.jsx("div",{children:b.label}),s.jsx("div",{className:"text-xs text-muted-foreground",children:b.description})]})})})}const{modelUniqueConstraintEntityType:xL}=await C("@baseplate-dev/project-builder-lib"),{Button:ax,DropdownMenu:jL,DropdownMenuContent:SL,DropdownMenuGroup:wL,DropdownMenuItem:Ul,DropdownMenuTrigger:CL,InputFieldController:EL,SwitchFieldController:DL,toast:TL}=await C("@baseplate-dev/ui-components"),{useState:es}=await C("react");function RL({className:a,control:n,idx:l,setValue:o,onRemove:c}){const d=lt(Q=>Q.model.fields[l]),f=lt(Q=>Q.model.relations),p=lt(Q=>Q.model),m=p.primaryKeyFieldRefs.includes(d.id),g=p.primaryKeyFieldRefs.length>1,v=p.uniqueConstraints??[],b=v.filter(Q=>Q.fields.some(te=>te.fieldRef===d.id)),x=f?.filter(Q=>Q.references.some(te=>te.localRef===d.id))??[],j=(()=>{if(x.length>0)return`Unable to remove field as it is being used in relations ${x.map(Q=>Q.name).join(", ")}`;if(m&&g)return"Unable to remove field as it is being used in in the primary key";if(p.uniqueConstraints?.some(Q=>Q.fields.some(te=>te.fieldRef===d.id)))return"Unable to remove field as it is being used in in a unique constraint"})();function D(){if(j){TL.error(j);return}c(l),m&&!g&&o("model.primaryKeyFieldRefs",[],{shouldDirty:!0})}const[S,R]=es(!1),[E,A]=es(!1),[B,H]=es(),[V,K]=es(!1),[T,O]=es();return s.jsxs("div",{className:Te("items-start",a),children:[s.jsx("div",{children:s.jsx(EL,{control:n,name:`model.fields.${l}.name`})}),s.jsx("div",{children:s.jsx(yL,{control:n,idx:l})}),s.jsx("div",{children:s.jsx(DL,{control:n,name:`model.fields.${l}.isOptional`})}),s.jsx("div",{className:"mr-4",children:s.jsx(pL,{control:n,idx:l,setValue:o})}),s.jsx("div",{children:s.jsx(uL,{control:n,idx:l})}),s.jsx("div",{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(jL,{children:[s.jsx(CL,{asChild:!0,children:s.jsx(ax,{variant:"ghost",size:"icon",children:s.jsx(Rc,{})})}),s.jsx(SL,{children:s.jsxs(wL,{children:[x.length===0&&s.jsx(Ul,{onSelect:()=>{K(!0),O(void 0)},children:"Add Relation"}),x.length>0&&x.map(Q=>s.jsxs(Ul,{onSelect:()=>{K(!0),O(Q.id)},children:["Edit Relation ",x.length>1&&Q.name]},Q.id)),!g&&!m&&s.jsx(Ul,{onSelect:()=>{o("model.primaryKeyFieldRefs",[d.id],{shouldDirty:!0})},children:"Set as Primary Key"}),m&&s.jsx(Ul,{onSelect:()=>{R(!0)},children:"Edit Primary Key"}),b.length===0&&(g||!m)&&s.jsx(Ul,{onSelect:()=>{o("model.uniqueConstraints",[...v,{id:xL.generateNewId(),fields:[{fieldRef:d.id}]}],{shouldDirty:!0})},children:"Make Unique"}),b.length>0&&b.map((Q,te)=>s.jsxs(Ul,{onSelect:()=>{H(Q.id),A(!0)},children:["Edit Unique Constraint"," ",b.length>1&&te+1]},Q.id))]})})]}),s.jsx(xS,{control:n,open:S,onOpenChange:R}),s.jsx(Mc,{control:n,open:E,onOpenChange:A,constraintId:B}),s.jsx(Nc,{control:n,open:V,onOpenChange:K,relationId:T,defaultFieldName:d.name}),s.jsx(ax,{variant:"ghost",onClick:()=>{D()},size:"icon",children:s.jsx(Ox,{})})]})})]})}function NL({className:a,control:n,setValue:l}){const{fields:o,remove:c,append:d,move:f}=bs({control:n,name:"model.fields"}),p="grid grid-cols-[repeat(2,minmax(130px,1fr))_60px_minmax(130px,1fr)_minmax(100px,1fr)_80px] gap-3",m=o.map((g,v)=>({id:g.id,element:s.jsx(RL,{className:p,control:n,setValue:l,idx:v,onRemove:c},g.id)}));return s.jsxs("div",{className:Te("space-y-4",a),children:[o.length===0?s.jsx("p",{className:"pt-4 text-style-muted",children:"Add some fields to get started"}):s.jsxs("div",{className:"flex w-full flex-col gap-2 bg-white",children:[s.jsxs("div",{className:Te(p,"sticky -top-0 z-10 bg-white py-2 text-sm font-semibold","pl-12"),children:[s.jsx("div",{children:"Name"}),s.jsx("div",{children:"Type"}),s.jsx("div",{children:"Optional"}),s.jsx("div",{children:"Default Value"}),s.jsx("div",{className:"sr-only",children:"Badges"}),s.jsx("div",{className:"sr-only",children:"Actions"})]}),s.jsx(Yj,{listItems:m,sortItems:f})]}),s.jsx(r$,{appendField:d,setValue:l})]})}const{useProjectDefinition:ML}=await C("@baseplate-dev/project-builder-lib/web"),{Button:qh,RecordView:AL,RecordViewActions:$L,RecordViewItem:rc,RecordViewItemList:LL,SectionListSection:OL,SectionListSectionContent:UL,SectionListSectionDescription:zL,SectionListSectionHeader:BL,SectionListSectionTitle:_L,useConfirmDialog:FL}=await C("@baseplate-dev/ui-components");function qL({control:a,setValue:n}){const{requestConfirm:l}=FL(),{definitionContainer:o}=ML(),c=lt(({model:p})=>p.relations??[]),d=lt(({model:p})=>Object.fromEntries(p.fields.map(m=>[m.id,m.name])));function f(p){const m=c.find(g=>g.id===p);l({title:"Delete Relation",content:`Are you sure you want to delete the relation "${m?.name??"<invalid>"}"?`,onConfirm:()=>{n("model.relations",c.filter(g=>g.id!==p))}})}return s.jsxs(OL,{children:[s.jsxs(BL,{children:[s.jsx(_L,{children:"Relations"}),s.jsx(zL,{children:"Define relations to enforce uniqueness on one or more fields."})]}),s.jsxs(UL,{className:"space-y-4",children:[c.map(p=>s.jsxs(AL,{children:[s.jsxs(LL,{children:[s.jsx(rc,{title:"Name",children:p.name}),s.jsx(rc,{title:"Local Field",children:p.references.map(m=>d[m.localRef]).join(", ")}),s.jsx(rc,{title:"Foreign Model",children:o.nameFromId(p.modelRef)}),s.jsx(rc,{title:"On Delete",children:p.onDelete})]}),s.jsxs($L,{children:[s.jsx(Nc,{relationId:p.id,control:a,asChild:!0,children:s.jsx(qh,{variant:"ghost",size:"icon",title:"Edit",children:s.jsx(Vl,{})})}),s.jsx(qh,{variant:"ghostDestructive",size:"icon",title:"Delete",onClick:()=>{f(p.id)},children:s.jsx(ys,{})})]})]},p.id)),s.jsx(Nc,{control:a,asChild:!0,children:s.jsxs(qh,{variant:"secondary",size:"sm",children:[s.jsx(vi,{}),"Add Relation"]})})]})]})}const{Button:Hh,RecordView:HL,RecordViewActions:PL,RecordViewItem:kL,RecordViewItemList:IL,SectionListSection:VL,SectionListSectionContent:GL,SectionListSectionDescription:YL,SectionListSectionHeader:XL,SectionListSectionTitle:QL,useConfirmDialog:KL}=await C("@baseplate-dev/ui-components");function ZL({control:a,setValue:n}){const{requestConfirm:l}=KL(),o=lt(({model:f})=>f.uniqueConstraints??[]),c=lt(({model:f})=>Object.fromEntries(f.fields.map(p=>[p.id,p.name])));function d(f){l({title:"Delete Unique Constraint",content:"Are you sure you want to delete this unique constraint?",onConfirm:()=>{n("model.uniqueConstraints",o.filter(p=>p.id!==f))}})}return s.jsxs(VL,{children:[s.jsxs(XL,{children:[s.jsx(QL,{children:"Unique Constraints"}),s.jsx(YL,{children:"Define unique constraints to enforce uniqueness on one or more fields."})]}),s.jsxs(GL,{className:"space-y-4",children:[o.map(f=>s.jsxs(HL,{children:[s.jsx(IL,{children:s.jsx(kL,{title:"Fields",children:f.fields.map(p=>c[p.fieldRef]??"<invalid>").join(", ")})}),s.jsxs(PL,{children:[s.jsx(Mc,{constraintId:f.id,control:a,asChild:!0,children:s.jsx(Hh,{variant:"ghost",size:"icon",title:"Edit",children:s.jsx(Vl,{})})}),s.jsx(Hh,{variant:"ghostDestructive",size:"icon",title:"Delete",onClick:()=>{d(f.id)},children:s.jsx(ys,{})})]})]},f.id)),s.jsx(Mc,{control:a,asChild:!0,children:s.jsxs(Hh,{variant:"secondary",size:"sm",children:[s.jsx(vi,{}),"Add Unique Constraint"]})})]})]})}const{modelEntityType:WL,modelLocalRelationEntityType:JL,modelScalarFieldEntityType:eO}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:tO}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:nO,SectionList:aO}=await C("@baseplate-dev/ui-components");js(WL,"/data/models/edit/{key}");js(eO,"/data/models/edit/{parentKey}");js(JL,"/data/models/edit/{parentKey}");function iO(){const{form:a,onSubmit:n,defaultValues:l}=Ns({omit:["name","featureRef"]}),{control:o,watch:c,getValues:d,setValue:f,reset:p}=a;return tO({control:o,reset:p,onSubmit:n}),s.jsx(Yl,{children:s.jsx(np,{initialModel:l,getValues:d,watch:c,children:s.jsxs("form",{onSubmit:n,className:"max-w-7xl min-w-[700px] flex-1 space-y-4 px-4 pb-4",children:[s.jsx(NL,{control:o,setValue:f}),s.jsxs(aO,{children:[s.jsx(qL,{control:o,setValue:f}),s.jsx(ZL,{control:o,setValue:f})]}),s.jsx(nO,{form:a})]})})})}const{ModelTransformerUtils:lO}=await C("@baseplate-dev/project-builder-lib"),{modelTransformerWebSpec:rO,useProjectDefinition:sO}=await C("@baseplate-dev/project-builder-lib/web"),{Label:ix,SectionListSection:oO,SectionListSectionContent:cO,SectionListSectionDescription:uO,SectionListSectionHeader:dO,SectionListSectionTitle:fO,SwitchField:sc}=await C("@baseplate-dev/ui-components");function hO({className:a,control:n,setValue:l}){const o=lt(E=>E.model.fields),c=it({control:n,name:"service.create"}),d=it({control:n,name:"service.update"}),f=c?.enabled,p=d?.enabled,m=it({control:n,name:"service.transformers"})??[],{definitionContainer:g,pluginContainer:v}=sO();if(!f&&!p)return null;const b=c?.fields??[],x=d?.fields??[],j=c?.transformerNames??[],D=d?.transformerNames??[],S="w-full border-collapse text-left [&_td]:py-1 [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-10 [&_th]:py-2",R=v.getPluginSpec(rO);return s.jsxs(oO,{className:a,children:[s.jsxs(dO,{children:[s.jsx(fO,{children:"Create / Update Fields"}),s.jsx(uO,{children:"Configure the fields that can be created or updated by the service method"})]}),s.jsx(cO,{className:"max-w-xl space-y-4",children:s.jsxs("table",{className:S,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-full",children:s.jsx(ix,{children:"Fields"})}),f&&s.jsx("th",{className:"pl-8",children:"Create"}),p&&s.jsx("th",{className:"pl-8",children:"Update"})]})}),s.jsxs("tbody",{children:[o.map(E=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ss,{type:E.type==="enum"&&E.options?.enumRef?g.nameFromId(E.options.enumRef):ip[E.type].label,children:E.name})}),f&&s.jsx("td",{className:"pl-8",children:s.jsx(sc,{value:b.includes(E.id),onChange:A=>{l("service.create.fields",A?[...b,E.id]:b.filter(B=>B!==E.id),{shouldDirty:!0})}})}),p&&s.jsx("td",{className:"pl-8",children:s.jsx(sc,{value:x.includes(E.id),onChange:A=>{l("service.update.fields",A?[...x,E.id]:x.filter(B=>B!==E.id),{shouldDirty:!0})}})})]},E.id)),m.length>0&&s.jsx("tr",{children:s.jsx("th",{children:s.jsx(ix,{children:"Transformers"})})}),m.map(E=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ss,{type:R.getTransformerWebConfig(E.type,ap).label,children:lO.getTransformName(g,E,v)})}),f&&s.jsx("td",{className:"pl-8",children:s.jsx(sc,{value:j.includes(E.id),onChange:A=>{l("service.create.transformerNames",A?[...j,E.id]:j.filter(B=>B!==E.id),{shouldDirty:!0})}})}),p&&s.jsx("td",{className:"pl-8",children:s.jsx(sc,{value:D.includes(E.id),onChange:A=>{l("service.update.transformerNames",A?[...D,E.id]:D.filter(B=>B!==E.id),{shouldDirty:!0})}})})]},E.id))]})]})})]})}const{createTransformerSchema:mO,modelTransformerEntityType:pO}=await C("@baseplate-dev/project-builder-lib"),{usePluginEnhancedSchema:gO}=await C("@baseplate-dev/project-builder-lib/web"),{Button:lx,DialogClose:vO,DialogFooter:bO}=await C("@baseplate-dev/ui-components"),{useId:yO}=await C("react"),{z:xO}=await C("zod");function jO({className:a,webConfig:{Form:n,pluginId:l},transformer:o,onUpdate:c,isCreate:d}){const f=lt(D=>D),p=qn(mO),m=gO(xO.object({transformer:p})),g=gi({resolver:kt(m),defaultValues:{transformer:o}}),{handleSubmit:v,formState:{isDirty:b}}=g,x=v(D=>{c({...D.transformer,id:D.transformer.id?D.transformer.id:pO.generateNewId()})}),j=yO();return n?s.jsxs("form",{className:Te("space-y-4",a),id:j,onSubmit:D=>(D.stopPropagation(),x(D)),children:[s.jsx(n,{formProps:g,name:"transformer",originalModel:f,pluginId:l}),s.jsxs(bO,{children:[s.jsx(vO,{asChild:!0,children:s.jsx(lx,{variant:"secondary",children:"Cancel"})}),s.jsx(lx,{type:"submit",disabled:!d&&!b,form:j,children:"Save"})]})]}):null}const{Dialog:SO,DialogContent:wO,DialogDescription:CO,DialogHeader:EO,DialogTitle:DO,DialogTrigger:TO,useControlledState:RO}=await C("@baseplate-dev/ui-components");function SS({children:a,transformer:n,asChild:l,webConfig:o,open:c,onOpenChange:d,onUpdate:f,isCreate:p}){const[m,g]=RO(c,d,!1);return s.jsxs(SO,{open:m,onOpenChange:g,children:[a&&s.jsx(TO,{asChild:l,children:a}),s.jsxs(wO,{children:[s.jsxs(EO,{children:[s.jsxs(DO,{children:[p?"Create":"Edit"," ",o?.label," Transformer"]}),s.jsx(CO,{children:o?.instructions??"Manage the transformer for the service"})]}),o&&s.jsx(jO,{transformer:n,onUpdate:v=>{g(!1),f(v)},webConfig:o,isCreate:p})]})]})}const{modelTransformerWebSpec:wS,useProjectDefinition:CS}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Sm,DropdownMenu:NO,DropdownMenuContent:MO,DropdownMenuGroup:AO,DropdownMenuItem:$O,DropdownMenuTrigger:LO,RecordView:OO,RecordViewActions:UO,RecordViewItem:rx,RecordViewItemList:zO,SectionListSection:BO,SectionListSectionContent:_O,SectionListSectionDescription:FO,SectionListSectionHeader:qO,SectionListSectionTitle:HO,useConfirmDialog:PO}=await C("@baseplate-dev/ui-components"),{useState:sx}=await C("react");function kO({formProps:a,idx:n,onRemove:l,onUpdate:o}){const{pluginContainer:c,definitionContainer:d}=CS(),{control:f}=a,p=it({control:f,name:`service.transformers.${n}`}),g=c.getPluginSpec(wS).getTransformerWebConfig(p.type,ap),v=g.getSummary(p,d);return s.jsxs(OO,{children:[s.jsxs(zO,{children:[s.jsx(rx,{title:"Type",children:g.label}),v.map(b=>s.jsx(rx,{title:b.label,children:b.description},b.label))]}),s.jsxs(UO,{children:[g.Form&&s.jsx(SS,{webConfig:g,transformer:p,onUpdate:b=>{o(b,n)},asChild:!0,isCreate:!1,children:s.jsx(Sm,{variant:"ghost",size:"icon",title:"Edit",children:s.jsx(Vl,{})})}),s.jsx(Sm,{variant:"ghost",size:"icon",onClick:()=>{l(n)},title:"Remove",className:"text-destructive hover:text-destructive-hover",children:s.jsx(Ox,{})})]})]})}function IO({className:a,formProps:n}){const{control:l}=n,{fields:o,remove:c,append:d,update:f}=bs({control:l,name:"service.transformers"}),{pluginContainer:p,definitionContainer:m}=CS(),{requestConfirm:g}=PO(),v=p.getPluginSpec(wS),b=lt(E=>E),x=v.getTransformerWebConfigs(ap).filter(E=>E.allowNewTransformer?E.allowNewTransformer(m,b):!0),[j,D]=sx(!1),[S,R]=sx(0);return s.jsxs(BO,{className:a,children:[s.jsxs(qO,{children:[s.jsx(HO,{children:"Transformers"}),s.jsx(FO,{children:"Transformers are used to operate on the data from the client into the shape that the database ORM expects."})]}),s.jsxs(_O,{className:"max-w-xl space-y-4",children:[o.map((E,A)=>s.jsx(kO,{formProps:n,idx:A,onUpdate:(B,H)=>{f(H,B)},onRemove:B=>{g({title:"Confirm delete",content:"Are you sure you want to delete this transformer?",buttonConfirmText:"Delete",buttonConfirmVariant:"destructive",onConfirm:()=>{c(B)}})}},E.id)),x.length>0&&s.jsxs(NO,{children:[s.jsx(LO,{asChild:!0,children:s.jsxs(Sm,{variant:"secondary",size:"sm",children:[s.jsx(vi,{}),"Add Transformer"]})}),s.jsx(MO,{children:s.jsx(AO,{children:x.map((E,A)=>s.jsx($O,{onSelect:()=>{E.Form?(R(A),D(!0)):d(E.getNewTransformer(m,b))},children:s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{children:E.label}),s.jsx("div",{className:"text-style-muted",children:E.description})]})},E.name))})})]}),s.jsx(SS,{webConfig:x[S],transformer:x[S]?.getNewTransformer(m,b),onUpdate:E=>{d(E)},open:j,onOpenChange:D,isCreate:!0})]})]})}const{modelTransformerEntityType:VO}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:GO}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:YO,SectionList:XO,SectionListSection:QO,SectionListSectionContent:KO,SectionListSectionDescription:ZO,SectionListSectionHeader:WO,SectionListSectionTitle:JO,SwitchFieldController:Ph}=await C("@baseplate-dev/ui-components");js(VO,"/data/models/edit/{parentKey}");function eU(){const{form:a,onSubmit:n,defaultValues:l}=Ns({omit:["name","featureRef"]}),{control:o,watch:c,getValues:d,setValue:f,reset:p}=a;return GO({control:o,reset:p,onSubmit:n}),s.jsx(np,{initialModel:l,getValues:d,watch:c,children:s.jsxs("form",{onSubmit:n,className:"w-full max-w-7xl space-y-4 p-4",children:[s.jsxs(XO,{children:[s.jsxs(QO,{children:[s.jsxs(WO,{children:[s.jsx(JO,{children:"Methods"}),s.jsx(ZO,{children:"Enable or disable which service methods will be generated"})]}),s.jsxs(KO,{className:"flex gap-8",children:[s.jsx(Ph,{label:"Create",name:"service.create.enabled",control:o}),s.jsx(Ph,{label:"Update",name:"service.update.enabled",control:o}),s.jsx(Ph,{label:"Delete",name:"service.delete.enabled",control:o})]})]}),s.jsx(hO,{control:o,setValue:f}),s.jsx(IO,{formProps:a})]}),s.jsx(YO,{form:a})]})})}const{modelEntityType:tU}=await C("@baseplate-dev/project-builder-lib"),nU={path:"edit",children:[{index:!0,element:s.jsx(Om,{to:"../",replace:!0})},{path:":key",element:s.jsx(ZM,{}),handle:{crumb:Uc(tU,"Edit Model","/data/models/edit/:key")},children:[{index:!0,element:s.jsx(iO,{})},{path:"service",element:s.jsx(eU,{}),handle:{crumb:"Service"}},{path:"graphql",element:s.jsx(JA,{}),handle:{crumb:"GraphQL"}},Rs]}]},{useProjectDefinition:aU}=await C("@baseplate-dev/project-builder-lib/web"),{Button:ox,EmptyDisplay:iU}=await C("@baseplate-dev/ui-components");function lU(){const{definition:a}=aU();return a.models.length===0?s.jsx(iU,{icon:Xm,header:"No Models",subtitle:"Create a model to get started",actions:s.jsx(jm,{children:s.jsx(ox,{children:"New Model"})})}):s.jsxs("div",{className:"max-w-4xl space-y-4 p-4 text-style-prose",children:[s.jsx("h1",{children:"Models"}),s.jsx("p",{children:"Models are the building blocks of your app. They define the data structure of your app."}),s.jsxs("p",{children:["Choose a model to edit from the sidebar or"," ",s.jsx(jm,{children:s.jsx(ox,{variant:"link",size:"none",children:"create a new model"})}),"."]})]})}const rU={path:"models/*",handle:{crumb:{label:"Models",url:"/data/models"}},children:[{index:!0,element:s.jsx(lU,{})},nU,Rs]},sU={element:s.jsx(IN,{}),path:"/data",children:[{index:!0,element:s.jsx(Om,{to:"./models"})},rU,$M]},{Button:kh,Card:Ih,CardDescription:Vh,CardFooter:Gh,CardHeader:Yh,CardTitle:Xh}=await C("@baseplate-dev/ui-components");function oU(){return s.jsx("div",{className:"flex-1 bg-white",children:s.jsxs("div",{className:"mx-auto w-160 space-y-4 p-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("h1",{children:"Baseplate Project Builder"}),s.jsxs("p",{children:["When you've set everything up, just click the"," ",s.jsx("strong",{children:"Sync"})," button and Baseplate will sync the project configuration to your codebase."]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-1",children:[s.jsxs(Ih,{children:[s.jsxs(Yh,{children:[s.jsx(Xh,{children:"Models"}),s.jsx(Vh,{children:"Models are the core of your app. They define the data that your app will store and manipulate."})]}),s.jsx(Gh,{children:s.jsx(Sn,{to:"/models",children:s.jsx(kh,{children:"Configure Models"})})})]}),s.jsxs(Ih,{children:[s.jsxs(Yh,{children:[s.jsx(Xh,{children:"Plugins"}),s.jsx(Vh,{children:"Baseplate comes with a number of plugins that you can enable or disable, such as email and authentication."})]}),s.jsx(Gh,{children:s.jsx(Sn,{to:"/plugins",children:s.jsx(kh,{children:"Configure Plugins"})})})]}),s.jsxs(Ih,{children:[s.jsxs(Yh,{children:[s.jsx(Xh,{children:"Apps & Repositories"}),s.jsx(Vh,{children:"Each app represents a separate application that can be run, e.g. backend, frontend, mobile app, etc. You can also configure how the apps are organized into repositories, e.g. monorepos."})]}),s.jsx(Gh,{children:s.jsx(Sn,{className:"inline-block",to:"/apps",children:s.jsx(kh,{children:"Configure Apps"})})})]})]})]})})}function cU(a,n,l){return`/api/plugins/${a}/${n}/static/${l}`}const{createPluginImplementationStore:uU}=await C("@baseplate-dev/project-builder-lib");function ES(a,n,l){const o={...l,plugins:[...l.plugins??[],{id:n.id,version:n.version,name:n.name,packageName:n.packageName}]};return uU(a,o)}const{pluginEntityType:cx,webConfigSpec:ux}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:dU}=await C("@baseplate-dev/project-builder-lib/web"),{Button:Qh,Card:fU,CardContent:hU,CardDescription:mU,CardHeader:pU,CardTitle:gU}=await C("@baseplate-dev/ui-components");function dx({className:a,plugin:n,isActive:l}){const{currentProjectId:o}=Cn(),{saveDefinitionWithFeedbackSync:c,schemaParserContext:d,definitionContainer:f,pluginContainer:p,isSavingDefinition:m}=dU(),g=on();function v(){if(ES(d.pluginStore,n,f.definition).getPluginSpec(ux).getWebConfigComponent(n.id)){g(`/plugins/edit/${n.id}`);return}c(E=>{E.plugins=[...(E.plugins??[]).filter(A=>A.packageName!==n.packageName||A.name!==n.name),{id:cx.idFromKey(n.id),packageName:n.packageName,name:n.name,version:n.version,config:{}}]},{successMessage:`Enabled ${n.displayName}!`})}function b(){c(D=>{D.plugins=(D.plugins??[]).filter(S=>S.id!==cx.idFromKey(n.id))},{successMessage:`Disabled ${n.displayName}!`})}const j=p.getPluginSpec(ux).getWebConfigComponent(n.id);return s.jsxs(fU,{className:a,children:[s.jsx(pU,{children:s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsx("div",{className:"rounded-xl border",children:n.icon&&o?s.jsx("img",{src:cU(o,n.id,n.icon),className:"size-12 rounded-xl bg-muted",alt:`${n.displayName} logo`}):s.jsx(Xw,{className:"size-12 bg-muted p-2"})}),s.jsxs("div",{children:[s.jsx(gU,{children:n.displayName}),s.jsx(mU,{children:n.packageName})]})]}),s.jsx("div",{children:l?j?s.jsx(Sn,{to:`/plugins/edit/${n.id}`,children:s.jsx(Qh,{variant:"secondary",children:"Configure"})}):s.jsx(Qh,{variant:"secondary",onClick:b,disabled:m,children:"Disable"}):s.jsx(Qh,{variant:"secondary",onClick:v,disabled:m,children:"Enable"})})]})}),s.jsx(hU,{children:s.jsx("div",{className:"text-sm",children:s.jsx("p",{children:n.description})})})]})}const{useProjectDefinition:vU}=await C("@baseplate-dev/project-builder-lib/web"),{EmptyDisplay:bU,ErrorableLoader:yU}=await C("@baseplate-dev/ui-components"),{useEffect:xU,useState:fx}=await C("react");function jU(){const{currentProjectId:a}=Cn(),[n,l]=fx(null),{definition:o}=vU(),[c,d]=fx(null);if(xU(()=>{if(l(null),!!a){if(Fn){l([]);return}Lt.plugins.getAvailablePlugins.mutate({projectId:a}).then(l).catch(d)}},[a]),!n)return s.jsx(yU,{error:c});if(n.length===0)return s.jsx(bU,{header:"No plugins available.",subtitle:"Please install plugins via package.json."});const f=o.plugins??[],p=n.filter(g=>f.some(v=>v.packageName===g.packageName&&v.name===g.name)),m=n.filter(g=>!f.some(v=>v.packageName===g.packageName&&v.name===g.name));return s.jsxs("div",{className:"max-w-2xl space-y-4 p-4",children:[s.jsx("h1",{children:"Manage Plugins"}),s.jsx("p",{children:"Plugins are a way to extend the functionality of your project, such as adding authentication. You can enable, disable, and manage plugins from this page."}),s.jsxs("p",{children:["To add additional plugins, you can install them to your root package with ",s.jsx("strong",{children:"pnpm"}),"."]}),p.length===0?null:s.jsxs(s.Fragment,{children:[s.jsxs("h3",{children:["Active Plugins (",p.length,")"]}),p.map(g=>s.jsx(dx,{plugin:g,isActive:!0},g.id))]}),m.length===0?null:s.jsxs(s.Fragment,{children:[s.jsxs("h3",{children:["Available Plugins (",m.length,")"]}),m.map(g=>s.jsx(dx,{plugin:g,isActive:!1},g.id))]})]})}const{pluginEntityType:SU,PluginUtils:wU,webConfigSpec:hx}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:CU}=await C("@baseplate-dev/project-builder-lib/web"),{Button:EU,DropdownMenu:DU,DropdownMenuContent:TU,DropdownMenuGroup:RU,DropdownMenuItem:NU,DropdownMenuTrigger:MU,useConfirmDialog:AU}=await C("@baseplate-dev/ui-components"),{useMemo:$U}=await C("react");function LU(){const{definitionContainer:a,pluginContainer:n,schemaParserContext:l,saveDefinitionWithFeedbackSync:o,isSavingDefinition:c}=CU(),{id:d}=Ki(),{requestConfirm:f}=AU(),p=on(),m=wU.byId(a.definition,d??""),g=$U(()=>{if(!d)return;const S=n.getPluginSpec(hx).getWebConfigComponent(d);if(S)return S;const R=l.pluginStore.availablePlugins.find(A=>A.metadata.id===d);return R?ES(l.pluginStore,R.metadata,a.definition).getPluginSpec(hx).getWebConfigComponent(d):void 0},[d,l,a,n]),v=l.pluginStore.availablePlugins.find(D=>D.metadata.id===d);if(!g||!v)return s.jsx(Ts,{});const{metadata:b}=v;function x(){o(D=>{D.plugins=(D.plugins??[]).filter(S=>S.id!==SU.idFromKey(b.id))},{successMessage:`Disabled ${b.displayName}!`,onSuccess:()=>{p("/plugins")}})}function j(){m||p("/plugins")}return s.jsx("div",{className:"relative flex h-full flex-1 flex-col gap-4 overflow-hidden",children:s.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto p-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("h1",{children:[b.displayName," Plugin"]}),m&&s.jsxs(DU,{children:[s.jsx(MU,{asChild:!0,children:s.jsx(EU,{variant:"ghost",size:"icon",children:s.jsx(Rc,{"aria-label":"More Actions"})})}),s.jsx(TU,{children:s.jsx(RU,{children:s.jsx(NU,{disabled:c,onSelect:()=>{f({title:"Disable Plugin",content:`Are you sure you want to disable the ${b.displayName} plugin?`,onConfirm:x})},children:"Disable Plugin"})})})]})]}),s.jsx(g,{definition:m,metadata:b,onSave:j})]})})}const{pluginEntityType:OU}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:UU}=await C("@baseplate-dev/project-builder-lib/web"),{Button:zU,NavigationMenu:BU,NavigationMenuItem:_U,NavigationMenuLink:FU,NavigationMenuList:qU,SidebarLayout:HU,SidebarLayoutContent:PU,SidebarLayoutSidebar:kU}=await C("@baseplate-dev/ui-components");function IU(){const{definition:a,schemaParserContext:n}=UU(),{availablePlugins:l}=n.pluginStore,o=(a.plugins??[]).map(c=>l.find(f=>f.metadata.id===OU.keyFromId(c.id))?.metadata).filter(Mx);return s.jsxs(HU,{className:"flex-1",children:[s.jsxs(kU,{className:"flex flex-col gap-4",width:"sm",children:[s.jsx(Sn,{to:"/plugins",children:s.jsxs(zU,{variant:"secondary",className:"w-full",size:"sm",children:[s.jsx(vi,{}),"Add new plugin"]})}),s.jsx(BU,{orientation:"vertical",children:s.jsxs(qU,{children:[o.map(c=>s.jsx(FU,{asChild:!0,children:s.jsx(Ht,{to:`/plugins/edit/${c.id}`,children:c.displayName})},c.id)),o.length===0&&s.jsx(_U,{className:"mt-4 w-full text-center opacity-80",children:"No plugins enabled"})]})})]}),s.jsx(PU,{className:"h-[calc(100vh-var(--topbar-height)-1px)]",children:s.jsx(Yl,{children:s.jsx(bi,{})})})]})}const{pluginEntityType:VU}=await C("@baseplate-dev/project-builder-lib"),GU=[{element:s.jsx(IU,{}),children:[{index:!0,element:s.jsx(jU,{})},{path:"edit/:id",element:s.jsx(LU,{}),handle:{crumb:Uc(VU,"Edit Plugin")}},{path:"*",element:s.jsx(Ts,{})}]}],{NavigationMenu:YU,NavigationMenuLink:oc,NavigationMenuList:XU,SidebarLayout:QU,SidebarLayoutContent:KU,SidebarLayoutSidebar:ZU}=await C("@baseplate-dev/ui-components");function WU(){return s.jsxs(QU,{className:"h-full flex-1",children:[s.jsx(ZU,{className:"space-y-4",width:"sm",children:s.jsx(YU,{orientation:"vertical",children:s.jsxs(XU,{children:[s.jsx(oc,{asChild:!0,children:s.jsx(Ht,{to:"/settings/project-settings",children:"Project settings"})}),s.jsx(oc,{asChild:!0,children:s.jsx(Ht,{to:"/settings/hierarchy",children:"Hierarchy"})}),s.jsx(oc,{asChild:!0,children:s.jsx(Ht,{to:"/settings/theme-builder",children:"Theme builder"})}),bj&&s.jsx(oc,{asChild:!0,children:s.jsx(Ht,{to:"/settings/template-extractor",children:"Template extractor"})})]})})}),s.jsx(KU,{className:"h-full",children:s.jsx(bi,{})})]})}function JU(a){return Yi({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 10 20 15 15 20"},child:[]},{tag:"path",attr:{d:"M4 4v7a4 4 0 0 0 4 4h12"},child:[]}]})(a)}const{useProjectDefinition:ez}=await C("@baseplate-dev/project-builder-lib/web"),{Button:mx,ComboboxFieldController:tz,Dialog:nz,DialogContent:az,DialogFooter:iz,DialogHeader:lz,DialogTitle:rz,InputFieldController:sz}=await C("@baseplate-dev/ui-components"),{useEffect:oz,useMemo:cz}=await C("react"),{z:cc}=await C("zod"),uz=cc.object({id:cc.string(),childName:cc.string().min(1).regex(/^[a-z0-9-]+$/,"Must be lowercase, numbers, and dashes only"),parentRef:cc.string().nullish()});function dz({feature:a,open:n,onClose:l}){const{definitionContainer:{definition:o},saveDefinitionWithFeedback:c}=ez(),d=cz(()=>({id:a?.id??"",childName:a?.name.split("/").pop()??"",parentRef:a?.parentRef??null}),[a]),{control:f,handleSubmit:p,reset:m,formState:{isSubmitting:g}}=gi({resolver:kt(uz),values:d});oz(()=>{n&&m(d)},[n,d,m]);const v=p(x=>c(j=>{const D=j.features.find(A=>A.id===x.parentRef)?.name,S=x.parentRef?`${D}/${x.childName}`:x.childName;if(j.features.some(A=>A.id!==x.id&&A.name===S))throw new da("Feature with this name already exists");const R=[...j.features.filter(A=>A.id!==x.id),{id:x.id,name:S,parentRef:x.parentRef}];function E(A){const B=R.filter(H=>A?new RegExp(`^${A.name}/[^/]+$`).exec(H.name):!H.name.includes("/"));for(const H of B){const V=H.name.split("/").pop();if(!V)throw new Error("Invalid feature name");H.name=A?`${A.name}/${V}`:V,E(H)}}E(),j.features=Zn(R,[A=>A.name])},{onSuccess:()=>{l?.()}})),b=[{label:"None",value:null},...o.features.filter(x=>x.id!==a?.id).map(x=>({label:x.name,value:x.id}))];return s.jsx(nz,{open:n,onOpenChange:x=>{x||l?.()},children:s.jsx(az,{children:s.jsxs("form",{className:"space-y-4",onSubmit:v,children:[s.jsx(lz,{children:s.jsxs(rz,{children:[a?.name?"Edit":"Add"," Feature"]})}),s.jsx(sz,{control:f,name:"childName",label:"Name",autoComplete:"off","data-1p-ignore":!0}),s.jsx(tz,{control:f,name:"parentRef",label:"Parent Feature",options:b}),s.jsxs(iz,{children:[s.jsx(mx,{onClick:l,variant:"secondary",children:"Cancel"}),s.jsx(mx,{type:"submit",disabled:g,children:"Save"})]})]})})})}const{featureEntityType:DS}=await C("@baseplate-dev/project-builder-lib"),{useProjectDefinition:fz}=await C("@baseplate-dev/project-builder-lib/web"),{Button:wm,buttonVariants:hz,cn:mz,useConfirmDialog:pz}=await C("@baseplate-dev/ui-components"),{useState:px}=await C("react");function gz(){const{definitionContainer:a,saveDefinitionWithFeedbackSync:n}=fz(),{requestConfirm:l}=pz(),{showRefIssues:o}=Sj(),[c,d]=px(),[f,p]=px(!1),{features:m}=a.definition,g=v=>{function b(j){const D=j.features.findIndex(S=>S.id===v.id);if(D===-1)throw new Error("Feature not found");j.features.splice(D,1)}const x=a.fixRefDeletions(b);if(x.type==="failure"){o({issues:x.issues});return}l({title:"Delete Feature",content:`Are you sure you want to delete ${v.name}?`,onConfirm:()=>{n(b,{successMessage:`Feature ${v.name} removed`})}})};return s.jsx("div",{className:"relative h-full max-h-full pb-(--action-bar-height)",children:s.jsxs("div",{className:"flex h-full max-h-full flex-1 flex-col overflow-y-auto px-6",children:[s.jsxs("div",{className:"sticky top-0 space-y-2 border-b bg-background py-6",children:[s.jsx("h1",{children:"Hierarchy"}),s.jsx("p",{className:"max-w-3xl text-muted-foreground",children:"All business logic and features are organized in a hierarchy. The structure of the features in the list below is the way the folder structure will be created in your backend/admin applications."})]}),s.jsxs("div",{className:"py-6",children:[s.jsx("div",{className:"mb-4 flex max-w-md flex-col gap-1",children:m.map(v=>s.jsx(vz,{feature:v,setFeatureToEdit:d,setShowFeatureForm:p,handleRemoveFeature:g},v.id))}),s.jsx(wm,{onClick:()=>{d({id:DS.generateNewId(),name:"",parentRef:null}),p(!0)},variant:"secondary",size:"sm",children:"Add Feature"}),s.jsx(dz,{feature:c,open:f,onClose:()=>{p(!1)}})]})]})})}function vz({feature:a,setFeatureToEdit:n,setShowFeatureForm:l,handleRemoveFeature:o}){const c=a.name.split("/").pop()??"";return s.jsxs("div",{className:"flex space-x-1",children:[s.jsx("button",{className:"mr-1 flex w-full flex-row items-center space-x-3",onClick:()=>{n(a),l(!0)},children:s.jsxs("div",{className:"flex w-full items-center space-x-1 truncate",title:c,children:[a.name.includes("/")&&s.jsxs(s.Fragment,{children:[a.name.split("/").slice(0,-2).map(d=>s.jsx("div",{className:"w-8 shrink-0"},d)),s.jsx(JU,{className:"size-8 shrink-0 p-2"})]}),s.jsxs("div",{className:mz(hz({variant:"secondary",size:"sm"}),"group w-full"),style:{justifyContent:"flex-start"},children:[c,s.jsx("div",{className:"flex-1"}),s.jsx(Vl,{className:"opacity-0 transition-opacity group-hover:opacity-100"})]})]})}),s.jsx(wm,{className:"shrink-0",variant:"ghost",onClick:()=>{n({id:DS.generateNewId(),name:"",parentRef:a.id}),l(!0)},size:"icon",title:`Add Sub-Feature to ${a.name}`,children:s.jsx(vi,{})}),s.jsx(wm,{className:"shrink-0",variant:"ghost",onClick:()=>{o(a)},size:"icon",title:`Delete ${a.name}`,children:s.jsx(Qw,{})})]})}const{generalSettingsSchema:bz}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:yz,useProjectDefinition:xz,useResettableForm:jz}=await C("@baseplate-dev/project-builder-lib/web"),{FormActionBar:Sz,InputFieldController:Kh,SectionList:wz,SectionListSection:Cz,SectionListSectionContent:Ez,SectionListSectionHeader:Dz,SectionListSectionTitle:Tz}=await C("@baseplate-dev/ui-components");function Rz(){const{definition:a,saveDefinitionWithFeedback:n}=xz(),l=jz({resolver:kt(bz),defaultValues:a.settings.general}),{handleSubmit:o,control:c,reset:d}=l,f=o(p=>n(m=>{m.settings.general=p}));return yz({control:c,reset:d,onSubmit:f}),s.jsxs("form",{className:"relative h-full max-h-full pb-(--action-bar-height)",onSubmit:f,children:[s.jsxs("div",{className:"flex h-full max-h-full flex-1 flex-col overflow-y-auto px-6",children:[s.jsx("div",{className:"sticky top-0 border-b bg-background py-6",children:s.jsx("h1",{children:"Project settings"})}),s.jsx(wz,{children:s.jsxs(Cz,{children:[s.jsx(Dz,{children:s.jsx(Tz,{children:"Settings"})}),s.jsxs(Ez,{className:"flex max-w-80 flex-col gap-4",children:[s.jsx(Kh,{name:"name",label:"Project Name",description:"Lowercase letters and dashes, e.g. my-project",control:c,placeholder:"e.g. my-project"}),s.jsx(Kh,{name:"portOffset",label:"Port Offset",description:"Multiple of 1000, e.g. 4000. This will offset the ports used by the project, e.g. API at 4001, database at 4432, to avoid conflicts with other projects.",control:c,registerOptions:{valueAsNumber:!0}}),s.jsx(Kh,{label:"Package Scope",name:"packageScope",description:"The scope for packages in this project, e.g. my-project will result in @my-project/app-name",control:c})]})]})})]}),s.jsx(Sz,{form:l})]})}const{createTemplateExtractorSchema:Nz}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:Mz,useProjectDefinition:Az,useResettableForm:$z}=await C("@baseplate-dev/project-builder-lib/web"),{Alert:Lz,AlertDescription:Oz,AlertTitle:Uz,CheckboxFieldController:zz,FormActionBar:Bz,SectionList:_z,SectionListSection:Fz,SectionListSectionContent:qz,SectionListSectionHeader:Hz,SectionListSectionTitle:Pz,TextareaFieldController:kz}=await C("@baseplate-dev/ui-components");function Iz(){const{definition:a,saveDefinitionWithFeedback:n}=Az(),l=a.settings.templateExtractor,o=qn(Nz),c=$z({resolver:kt(o),defaultValues:l}),{handleSubmit:d,control:f,reset:p}=c,m=d(g=>n(v=>{v.settings.templateExtractor=g}));return Mz({control:f,reset:p,onSubmit:m}),bj?s.jsxs("form",{className:"relative h-full max-h-full pb-(--action-bar-height)",onSubmit:m,children:[s.jsxs("div",{className:"flex h-full max-h-full flex-1 flex-col overflow-y-auto px-6",children:[s.jsx("div",{className:"sticky top-0 border-b bg-background py-6",children:s.jsx("h1",{children:"Template Extractor"})}),s.jsx(_z,{children:s.jsxs(Fz,{children:[s.jsx(Hz,{children:s.jsx(Pz,{children:"Settings"})}),s.jsxs(qz,{className:"flex max-w-md flex-col gap-4",children:[s.jsx(zz,{name:"writeMetadata",label:"Write Metadata",description:"Write metadata to the project to enable template extraction",control:f}),s.jsx(kz,{name:"fileIdRegexWhitelist",label:"File ID Regex Whitelist",description:"A list of file IDs to include in the template extractor metadata for generators that have a manually assigned file IDs, e.g. files generated by generators that have multiple instances. The list is delimited by a newline and must be a valid regex.",control:f})]})]})})]}),s.jsx(Bz,{form:c})]}):s.jsxs(Lz,{variant:"error",className:"mx-auto my-16 max-w-2xl",children:[s.jsx(Uz,{children:"Template Extractor is disabled"}),s.jsxs(Oz,{children:["Template extractor is disabled in the environment. Please enable it with ",s.jsx("code",{children:"VITE_ENABLE_TEMPLATE_EXTRACTOR=true"})," to use it."]})]})}const{generateCssFromThemeConfig:gx}=await C("@baseplate-dev/project-builder-lib"),{TextareaField:Vz}=await C("@baseplate-dev/ui-components"),{useMemo:Gz}=await C("react");function vx(a){return Object.entries(a).map(([n,l])=>` ${n}: ${l};`).join(`
|
|
69
|
+
`)}function Yz({className:a,control:n}){const l=it({control:n,name:"colors"}),o=Gz(()=>`
|
|
70
|
+
:root {
|
|
71
|
+
${vx(gx(l.light))}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.dark, html[data-theme='dark'] {
|
|
75
|
+
${vx(gx(l.dark))}
|
|
76
|
+
}
|
|
77
|
+
`.trim(),[l]);return s.jsx("div",{className:Te("",a),children:s.jsx(Vz,{className:"h-60",readOnly:!0,value:o})})}const{convertHexToOklch:Xz,convertOklchToColorName:Qz,convertOklchToHex:Kz,getDefaultThemeColorFromShade:Zz,THEME_COLORS:Wz}=await C("@baseplate-dev/project-builder-lib"),{Button:bx,ColorPickerFieldController:Jz,Tooltip:eB,TooltipContent:tB,TooltipTrigger:nB}=await C("@baseplate-dev/ui-components");function yx({className:a,control:n,mode:l,setValue:o}){const c=Object.entries(Wz),d=it({control:n,name:"palettes"}),f=it({control:n,name:`colors.${l}`});return s.jsx("div",{className:Te("flex w-full max-w-xl gap-4",a),children:s.jsx("div",{className:"grid flex-1 grid-cols-1 gap-4 sm:grid-cols-2",children:c.map(([p,m],g)=>{const v=p,x=(g>0?c[g-1][1].groupKey:void 0)!==m.groupKey,j=f[v],D=Zz(d,l,v);return s.jsxs("div",{className:Te(x?"col-start-1":void 0,"relative"),children:[s.jsx(Jz,{control:n,className:"w-full",wrapperClassName:"flex-col items-start",label:s.jsxs("div",{className:"flex h-6 w-full items-center gap-1",children:[s.jsx("div",{children:m.name}),s.jsxs(eB,{delayDuration:500,children:[s.jsx(nB,{asChild:!0,children:s.jsx(bx,{variant:"ghost",size:"icon","aria-label":"Color Info",className:"opacity-30",children:s.jsx(Tm,{})})}),s.jsx(tB,{align:"start",side:"bottom",className:"max-w-[400px]",children:s.jsx("div",{className:"font-normal",children:m.description})})]})]}),parseColor:Kz,serializeColor:Xz,formatColorName:S=>{const R=Object.entries(d.base.shades).find(([,A])=>A===S)?.[0];if(R)return`base-${R}`;const E=Object.entries(d.primary.shades).find(([,A])=>A===S)?.[0];return E?`primary-${E}`:Qz(S)},name:`colors.${l}.${v}`}),j!==D&&s.jsx(bx,{className:"absolute right-2 bottom-1",onClick:()=>{o(`colors.${l}.${v}`,D)},size:"icon",variant:"ghost","aria-label":"Reset Color",children:s.jsx(Kw,{})})]},p)})})})}const{generateCssFromThemeConfig:aB}=await C("@baseplate-dev/project-builder-lib"),{Badge:uc,Button:zl,Card:iB,CardContent:lB,CardDescription:rB,CardHeader:sB,CardTitle:oB,Combobox:cB,ComboboxContent:uB,ComboboxEmpty:dB,ComboboxInput:fB,ComboboxItem:Zh}=await C("@baseplate-dev/ui-components");function hB({className:a,control:n,mode:l}){const o=it({control:n,name:`colors.${l}`}),c=aB(o);return s.jsx("div",{className:Te("size-full rounded-xl border border-border bg-background p-4",a),style:c,children:s.jsxs(iB,{children:[s.jsxs(sB,{children:[s.jsx(oB,{children:"Color Preview"}),s.jsx(rB,{children:"This is a preview of how your theme colors will be applied on various elements"})]}),s.jsxs(lB,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(dc,{children:"Paragraph Text"}),s.jsx("p",{className:"text-base",children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin faucibus."})]}),s.jsxs("div",{children:[s.jsx(dc,{children:"Combobox"}),s.jsxs(cB,{children:[s.jsx(fB,{placeholder:"Select an option"}),s.jsxs(uB,{style:c,children:[s.jsx(Zh,{value:"opt1",label:"Option 1",children:"Option 1"}),s.jsx(Zh,{value:"green",label:"Option 2",children:"Option 2"}),s.jsx(Zh,{value:"blue",label:"Option 3",children:"Option 3"}),s.jsx(dB,{children:"No results found"})]})]})]}),s.jsxs("div",{children:[s.jsx(dc,{children:"Badges"}),s.jsxs("div",{className:"flex flex-wrap gap-1",children:[s.jsx(uc,{variant:"default",children:"Default"}),s.jsx(uc,{variant:"destructive",children:"Destructive"}),s.jsx(uc,{variant:"secondary",children:"Secondary"}),s.jsx(uc,{variant:"outline",children:"Outline"})]})]}),s.jsxs("div",{children:[s.jsx(dc,{children:"Buttons"}),s.jsxs("div",{className:"flex flex-wrap gap-2 rounded-lg border border-border p-1",children:[s.jsx(zl,{type:"button",children:"Primary"}),s.jsx(zl,{variant:"destructive",type:"button",children:"Destructive"}),s.jsx(zl,{variant:"ghost",type:"button",children:"Ghost"}),s.jsx(zl,{variant:"link",type:"button",children:"Link"}),s.jsx(zl,{variant:"secondary",type:"button",children:"Secondary"}),s.jsx(zl,{variant:"outline",type:"button",children:"Outline"})]})]})]})]})})}function dc({children:a}){return s.jsx("h4",{className:"text-lg font-semibold",children:a})}function mB(a){const n=new Float32Array([a.r,a.g,a.b]);return{"50-r":1/(1+1/Math.exp(1.8661608695983887+1.969373345375061*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.4601062536239624*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.7962396740913391*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"50-g":1/(1+1/Math.exp(1.9256014823913574+1.231925129890442*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.3603883981704712*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.8378368616104126*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"50-b":1/(1+1/Math.exp(1.5751663446426392+.6084778904914856*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.0512851476669312*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+1.9236465692520142*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"100-r":1/(1+1/Math.exp(1.6104178428649902+2.411083698272705*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.4946855306625366*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.5684743523597717*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"100-g":1/(1+1/Math.exp(1.6873022317886353+.7176924347877502*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.6131407022476196*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.15697577595710754*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"100-b":1/(1+1/Math.exp(1.0808522701263428-.09388591349124908*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.5177313685417175*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+2.6253278255462646*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"200-r":1/(1+1/Math.exp(1.3480290174484253+2.2088170051574707*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-1.1226733922958374*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.41870957612991333*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"200-g":1/(1+1/Math.exp(1.3919278383255005+.2666841745376587*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.5987523794174194*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.23637670278549194*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"200-b":1/(1+1/Math.exp(.6176453232765198-.6029531359672546*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.21029342710971832*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+2.906541109085083*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"300-r":1/(1+1/Math.exp(.9194338321685791+2.3936944007873535*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-1.68363356590271*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.36374539136886597*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"300-g":1/(1+1/Math.exp(1.1811708211898804-.08378893882036209*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.4275716543197632*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.6511568427085876*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"300-b":1/(1+1/Math.exp(-.04160493612289429-1.0422184467315674*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.1739543229341507*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+3.306165933609009*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"400-r":1/(1+1/Math.exp(.5908379554748535+2.6282155513763428*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-2.483553886413574*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+.16029347479343414*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"400-g":1/(1+1/Math.exp(.9054368138313293-.38720616698265076*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.231947422027588*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.0837976932525635*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"400-b":1/(1+1/Math.exp(-.6404189467430115-1.6898466348648071*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.029696132987737656*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+3.7177767753601074*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"500-r":1/(1+1/Math.exp(.3420727550983429+2.987776756286621*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-3.3403704166412354*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.07194828987121582*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"500-g":1/(1+1/Math.exp(.5289734601974487-.5567987561225891*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.3352314233779907*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.4835448265075684*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"500-b":1/(1+1/Math.exp(-1.2478309869766235-2.2976744174957275*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.30013492703437805*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+4.339084625244141*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"600-r":1/(1+1/Math.exp(.18572008609771729+2.5128233432769775*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-3.407212495803833*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.20814435184001923*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"600-g":1/(1+1/Math.exp(.15741883218288422-.7273809909820557*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.2500137090682983*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.6501106023788452*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"600-b":1/(1+1/Math.exp(-1.3073996305465698-2.5112154483795166*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.7157139182090759*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+4.086366176605225*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"700-r":1/(1+1/Math.exp(-.25121745467185974+1.7795124053955078*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-2.7557551860809326*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.0411522202193737*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"700-g":1/(1+1/Math.exp(-.43503373861312866-.6766132712364197*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+1.150789737701416*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.3406033515930176*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"700-b":1/(1+1/Math.exp(-1.1124053001403809-2.359389305114746*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.943118691444397*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+3.267453908920288*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"800-r":1/(1+1/Math.exp(-.42729225754737854+1.2738885879516602*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-2.573699474334717*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.11818580329418182*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"800-g":1/(1+1/Math.exp(-.6730203628540039-.770199716091156*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.9060920476913452*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.2600882053375244*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"800-b":1/(1+1/Math.exp(-1.32567298412323-1.9301948547363281*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.8552113175392151*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+2.6513888835906982*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"900-r":1/(1+1/Math.exp(-.6309270858764648+1.0235852003097534*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-2.4659388065338135*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.15058130025863647*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"900-g":1/(1+1/Math.exp(-.9010928273200989-.7559532523155212*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.7665435075759888*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.1884112358093262*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"900-b":1/(1+1/Math.exp(-1.5088001489639282-1.5986618995666504*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.7353832125663757*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+2.180158853530884*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"950-r":1/(1+1/Math.exp(-1.166185975074768+.5363732576370239*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-2.587523937225342*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-.061746854335069656*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"950-g":1/(1+1/Math.exp(-1.2907893657684326-1.3924223184585571*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))+.5465696454048157*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))-1.2647709846496582*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0))))),"950-b":1/(1+1/Math.exp(-1.8633685111999512-1.8034374713897705*1/(1+1/Math.exp(.5648569464683533+8.592248916625977*(n[0]||0)-2.0615885257720947*(n[1]||0)-7.465658187866211*(n[2]||0)))-.8856748938560486*1/(1+1/Math.exp(.6313956379890442-7.673094272613525*(n[0]||0)+8.008654594421387*(n[1]||0)-1.6121777296066284*(n[2]||0)))+1.8510282039642334*1/(1+1/Math.exp(.08400232344865799-.9345706105232239*(n[0]||0)-7.6551032066345215*(n[1]||0)+8.717894554138184*(n[2]||0)))))}}const{PALETTE_SHADES:pB}=await C("@baseplate-dev/project-builder-lib");function Wh(a,n){return`${a}-${n}`}function gB(a){const l=e4("rgb")(a);if(!l)throw new Error(`Invalid color: ${a}`);const o=mB(l);return Object.fromEntries(pB.map(c=>{const d={mode:"rgb",r:o[Wh(c,"r")],g:o[Wh(c,"g")],b:o[Wh(c,"b")]};return[c,t4(d)]}))}const{COLOR_PALETTES:Jh,convertHexToOklch:xx,convertOklchToHex:jx,PALETTE_SHADES:vB}=await C("@baseplate-dev/project-builder-lib"),{Button:bB,ColorPickerFieldController:Sx,ComboboxFieldController:yB}=await C("@baseplate-dev/ui-components"),{useCallback:xB}=await C("react");function wx({control:a,getValues:n,setValue:l,onShadesChange:o,type:c}){const d=[{value:"custom",label:"Custom Base"},...Object.keys(Jh).map(g=>({value:g,label:Ux.capitalize(g)}))],f=it({control:a,name:`palettes.${c}.paletteName`}),p=xB(g=>{if(!g||!Object.prototype.hasOwnProperty.call(Jh,g))return;const v=Jh[g];l(`palettes.${c}.shades`,v),o?.(v)},[l,o,c]),m=()=>{const g=n(`palettes.${c}.customBase`);if(!g)return;const v=gB(g);l(`palettes.${c}.shades`,v),o?.(v)};return s.jsxs("div",{className:"flex max-w-fit flex-col gap-4",children:[s.jsx(yB,{name:`palettes.${c}.paletteName`,control:a,options:d,placeholder:"Choose a base palette",onChange:p}),f==="custom"&&s.jsxs("div",{className:"flex max-w-xl items-center justify-between",children:[s.jsx(Sx,{className:"flex-1 space-x-1",wrapperClassName:"items-center",control:a,name:`palettes.${c}.customBase`,label:"Custom Base Color",placeholder:"Choose a color",parseColor:jx,serializeColor:xx}),s.jsx(bB,{variant:"secondary",onClick:m,size:"sm",children:"Generate"})]}),s.jsx("div",{className:"flex gap-3",children:vB.map(g=>s.jsx(Sx,{wrapperClassName:"flex flex-col items-center",hideText:!0,control:a,name:`palettes.${c}.shades.${g}`,label:g,parseColor:jx,serializeColor:xx,onChange:()=>o?.(n(`palettes.${c}.shades`))},g))})]})}const{createThemeSchema:jB,generateDefaultTheme:SB,generateThemeColorsFromShade:Cx}=await C("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:wB,useProjectDefinition:CB,useResettableForm:EB}=await C("@baseplate-dev/project-builder-lib/web"),{Alert:DB,AlertDescription:TB,AlertTitle:RB,Button:NB,FormActionBar:MB,SectionList:AB,SectionListSection:em,SectionListSectionContent:tm,SectionListSectionDescription:nm,SectionListSectionHeader:am,SectionListSectionTitle:im,Tabs:Ex,TabsContent:fc,TabsList:Dx,TabsTrigger:hc}=await C("@baseplate-dev/ui-components"),{useCallback:Tx,useMemo:$B,useState:LB}=await C("react");function OB(){const{definition:a,saveDefinitionWithFeedback:n}=CB(),l=qn(jB),o=$B(()=>a.settings.theme??SB(),[a.settings.theme]),c=EB({resolver:kt(l),values:o}),{control:d,handleSubmit:f,setValue:p,getValues:m,reset:g}=c,v=f(S=>n(R=>{R.settings.theme=S}));wB({control:d,reset:g,onSubmit:v});const b=Tx(S=>{const R=m("palettes");p("colors",{light:Cx(R,"light",S?void 0:{palettes:o.palettes,config:o.colors.light}),dark:Cx(R,"dark",S?void 0:{palettes:o.palettes,config:o.colors.dark})})},[m,p,o]),x=Tx(()=>{b()},[b]),[j,D]=LB("light");return s.jsxs("form",{className:"relative h-full max-h-full pb-(--action-bar-height)",onSubmit:v,children:[s.jsxs("div",{className:"flex h-full max-h-full flex-1 flex-col overflow-y-auto px-6",children:[s.jsxs("div",{className:"sticky top-0 z-10 space-y-2 border-b bg-background py-6",children:[s.jsx("h1",{children:"Theme Builder"}),s.jsxs("p",{className:"max-w-3xl text-muted-foreground",children:["The theme of the UI is based off color variables used with"," ",s.jsx("a",{href:"https://ui.shadcn.com/docs/theming",target:"_blank",rel:"noreferrer",className:"underline",children:"the Shadn UI component library"}),". We generate the color variables based off the Tailwind color palette structure but you can customize them as you wish."]})]}),s.jsxs("div",{className:"pt-4",children:[s.jsxs(DB,{className:"max-w-fit",children:[s.jsx(Zw,{}),s.jsx(RB,{children:"Work in Progress"}),s.jsx(TB,{children:"This page is still a work in progress. It is not being used for generation at the moment."})]}),s.jsxs(AB,{children:[s.jsxs(em,{children:[s.jsxs(am,{children:[s.jsx(im,{children:"Theme Palettes"}),s.jsx(nm,{children:"Pick the colors for your theme"})]}),s.jsx(tm,{className:"max-w-3xl",children:s.jsxs(Ex,{defaultValue:"base",children:[s.jsxs(Dx,{children:[s.jsx(hc,{value:"base",children:"Base"}),s.jsx(hc,{value:"primary",children:"Primary"})]}),s.jsx(fc,{value:"base",children:s.jsx(wx,{control:d,getValues:m,setValue:p,type:"base",onShadesChange:x})}),s.jsx(fc,{value:"primary",children:s.jsx(wx,{control:d,getValues:m,setValue:p,type:"primary",onShadesChange:x})})]})})]}),s.jsxs(em,{children:[s.jsxs(am,{children:[s.jsx(im,{children:"Theme Colors"}),s.jsx(nm,{children:"Pick the colors for your theme"}),s.jsx("div",{className:"sticky top-44",children:s.jsx(hB,{control:d,mode:j},j)})]}),s.jsxs(tm,{className:"flex flex-col gap-4",children:[s.jsxs(Ex,{value:j,onValueChange:D,children:[s.jsxs(Dx,{children:[s.jsx(hc,{value:"light",children:"Light"}),s.jsx(hc,{value:"dark",children:"Dark"})]}),s.jsx(fc,{value:"light",children:s.jsx(yx,{control:d,setValue:p,mode:"light"})}),s.jsx(fc,{value:"dark",children:s.jsx(yx,{control:d,setValue:p,mode:"dark"})})]}),s.jsx(NB,{onClick:()=>{b(!0)},variant:"outline",size:"sm",type:"button",className:"w-fit",children:"Reset Colors"})]})]}),s.jsxs(em,{children:[s.jsxs(am,{children:[s.jsx(im,{children:"CSS Preview"}),s.jsx(nm,{children:"Preview the CSS for your theme"})]}),s.jsx(tm,{className:"flex flex-col gap-4",children:s.jsx(Yz,{control:d})})]})]})]})]}),s.jsx(MB,{form:c})]})}const UB={element:s.jsx(WU,{}),path:"/settings",handle:{crumb:"Settings"},children:[{index:!0,element:s.jsx(Om,{to:"./project-settings"})},{path:"project-settings",element:s.jsx(Rz,{}),handle:{crumb:"Project settings"}},{path:"hierarchy",element:s.jsx(gz,{}),handle:{crumb:"Hierarchy"}},{path:"theme-builder",element:s.jsx(OB,{}),handle:{crumb:"Theme builder"}},{path:"template-extractor",element:s.jsx(Iz,{}),handle:{crumb:"Template extractor"}},{path:"*",element:s.jsx(Ts,{})}]},zB=$C([{element:s.jsx(rT,{}),children:[{element:s.jsx(m8,{}),children:[{path:"/",element:s.jsx(oU,{}),handle:{crumb:{label:"Home",url:"/"}}},{path:"/apps/*",children:U9,handle:{crumb:{label:"Apps",url:"/apps"}}},sU,{path:"/plugins/*",children:GU,handle:{crumb:{label:"Plugins",url:"/plugins"}}},UB,Rs]}]}]),BB=await C("react"),TS=document.querySelector("#root");if(!TS)throw new Error("Failed to find root element");const _B=o4.createRoot(TS);_B.render(s.jsx(BB.StrictMode,{children:s.jsx(HC,{router:zB})}));
|
|
78
|
+
//# sourceMappingURL=index-C6NlRicZ.js.map
|