@umudik/task-bridge 0.0.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/LICENSE +21 -0
- package/README.md +75 -0
- package/apps/backend/dist/config.js +26 -0
- package/apps/backend/dist/db/epic-workflow-db.js +125 -0
- package/apps/backend/dist/db/library-db.js +123 -0
- package/apps/backend/dist/db/projects-db.js +110 -0
- package/apps/backend/dist/db/tasks-db.js +282 -0
- package/apps/backend/dist/db/users-db.js +117 -0
- package/apps/backend/dist/db/workflow-db.js +186 -0
- package/apps/backend/dist/db/workflow-template-db.js +715 -0
- package/apps/backend/dist/domain/project-member.js +15 -0
- package/apps/backend/dist/domain/task-template-graph.js +63 -0
- package/apps/backend/dist/domain/task.js +93 -0
- package/apps/backend/dist/domain/work-status.js +30 -0
- package/apps/backend/dist/domain/workflow-stage.js +186 -0
- package/apps/backend/dist/domain/workflow-state.js +73 -0
- package/apps/backend/dist/domain/workflow-template-id.js +6 -0
- package/apps/backend/dist/errors/app-error.js +24 -0
- package/apps/backend/dist/index.js +67 -0
- package/apps/backend/dist/lib/bridge-project.js +24 -0
- package/apps/backend/dist/lib/inbox-cursor.js +34 -0
- package/apps/backend/dist/lib/strings.js +15 -0
- package/apps/backend/dist/logger.js +29 -0
- package/apps/backend/dist/mappers/task-response.js +261 -0
- package/apps/backend/dist/middleware/auth.js +29 -0
- package/apps/backend/dist/openapi.js +716 -0
- package/apps/backend/dist/routes/admin-users.js +79 -0
- package/apps/backend/dist/routes/auth.js +81 -0
- package/apps/backend/dist/routes/connect.js +1 -0
- package/apps/backend/dist/routes/docs.js +13 -0
- package/apps/backend/dist/routes/health.js +6 -0
- package/apps/backend/dist/routes/library.js +139 -0
- package/apps/backend/dist/routes/projects.js +95 -0
- package/apps/backend/dist/routes/tasks.js +522 -0
- package/apps/backend/dist/routes/web.js +79 -0
- package/apps/backend/dist/routes/workflow-templates.js +152 -0
- package/apps/backend/dist/routes/workflow.js +165 -0
- package/apps/backend/dist/services/connect-target.js +4 -0
- package/apps/backend/dist/services/epic-service.js +269 -0
- package/apps/backend/dist/services/library-service.js +222 -0
- package/apps/backend/dist/services/project-registry.js +122 -0
- package/apps/backend/dist/services/task-assignee-service.js +42 -0
- package/apps/backend/dist/services/task-claim-policy.js +310 -0
- package/apps/backend/dist/services/task-queue.js +105 -0
- package/apps/backend/dist/services/task-service.js +198 -0
- package/apps/backend/dist/services/workflow-rules.js +18 -0
- package/apps/backend/dist/services/workflow-service.js +418 -0
- package/apps/backend/dist/services/workflow-spawn-service.js +179 -0
- package/apps/backend/dist/services/workflow-state-service.js +157 -0
- package/apps/backend/dist/services/workflow-template-service.js +204 -0
- package/apps/backend/public/assets/index-Bl1ciVpY.js +409 -0
- package/apps/backend/public/assets/index-ByKECv-I.css +1 -0
- package/apps/backend/public/index.html +13 -0
- package/bin/task-bridge.mjs +86 -0
- package/package.json +41 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
var Kx=Object.defineProperty;var Qx=(e,t,n)=>t in e?Kx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ge=(e,t,n)=>Qx(e,typeof t!="symbol"?t+"":t,n);function Xx(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function Lp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mp={exports:{}},si={},Op={exports:{}},ae={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var fo=Symbol.for("react.element"),Zx=Symbol.for("react.portal"),qx=Symbol.for("react.fragment"),Jx=Symbol.for("react.strict_mode"),ey=Symbol.for("react.profiler"),ty=Symbol.for("react.provider"),ny=Symbol.for("react.context"),ry=Symbol.for("react.forward_ref"),sy=Symbol.for("react.suspense"),oy=Symbol.for("react.memo"),ly=Symbol.for("react.lazy"),Sd=Symbol.iterator;function iy(e){return e===null||typeof e!="object"?null:(e=Sd&&e[Sd]||e["@@iterator"],typeof e=="function"?e:null)}var Ap={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dp=Object.assign,zp={};function is(e,t,n){this.props=e,this.context=t,this.refs=zp,this.updater=n||Ap}is.prototype.isReactComponent={};is.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};is.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $p(){}$p.prototype=is.prototype;function Uc(e,t,n){this.props=e,this.context=t,this.refs=zp,this.updater=n||Ap}var Wc=Uc.prototype=new $p;Wc.constructor=Uc;Dp(Wc,is.prototype);Wc.isPureReactComponent=!0;var Nd=Array.isArray,Fp=Object.prototype.hasOwnProperty,Vc={current:null},Bp={key:!0,ref:!0,__self:!0,__source:!0};function Up(e,t,n){var r,s={},o=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(o=""+t.key),t)Fp.call(t,r)&&!Bp.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:fo,type:e,key:o,ref:l,props:s,_owner:Vc.current}}function ay(e,t){return{$$typeof:fo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Hc(e){return typeof e=="object"&&e!==null&&e.$$typeof===fo}function cy(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var jd=/\/+/g;function Di(e,t){return typeof e=="object"&&e!==null&&e.key!=null?cy(""+e.key):t.toString(36)}function tl(e,t,n,r,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case fo:case Zx:l=!0}}if(l)return l=e,s=s(l),e=r===""?"."+Di(l,0):r,Nd(s)?(n="",e!=null&&(n=e.replace(jd,"$&/")+"/"),tl(s,t,n,"",function(u){return u})):s!=null&&(Hc(s)&&(s=ay(s,n+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(jd,"$&/")+"/")+e)),t.push(s)),1;if(l=0,r=r===""?".":r+":",Nd(e))for(var a=0;a<e.length;a++){o=e[a];var c=r+Di(o,a);l+=tl(o,t,n,c,s)}else if(c=iy(e),typeof c=="function")for(e=c.call(e),a=0;!(o=e.next()).done;)o=o.value,c=r+Di(o,a++),l+=tl(o,t,n,c,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function Ro(e,t,n){if(e==null)return e;var r=[],s=0;return tl(e,r,"","",function(o){return t.call(n,o,s++)}),r}function uy(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var rt={current:null},nl={transition:null},dy={ReactCurrentDispatcher:rt,ReactCurrentBatchConfig:nl,ReactCurrentOwner:Vc};function Wp(){throw Error("act(...) is not supported in production builds of React.")}ae.Children={map:Ro,forEach:function(e,t,n){Ro(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ro(e,function(){t++}),t},toArray:function(e){return Ro(e,function(t){return t})||[]},only:function(e){if(!Hc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ae.Component=is;ae.Fragment=qx;ae.Profiler=ey;ae.PureComponent=Uc;ae.StrictMode=Jx;ae.Suspense=sy;ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dy;ae.act=Wp;ae.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Dp({},e.props),s=e.key,o=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,l=Vc.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)Fp.call(t,c)&&!Bp.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:fo,type:e.type,key:s,ref:o,props:r,_owner:l}};ae.createContext=function(e){return e={$$typeof:ny,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:ty,_context:e},e.Consumer=e};ae.createElement=Up;ae.createFactory=function(e){var t=Up.bind(null,e);return t.type=e,t};ae.createRef=function(){return{current:null}};ae.forwardRef=function(e){return{$$typeof:ry,render:e}};ae.isValidElement=Hc;ae.lazy=function(e){return{$$typeof:ly,_payload:{_status:-1,_result:e},_init:uy}};ae.memo=function(e,t){return{$$typeof:oy,type:e,compare:t===void 0?null:t}};ae.startTransition=function(e){var t=nl.transition;nl.transition={};try{e()}finally{nl.transition=t}};ae.unstable_act=Wp;ae.useCallback=function(e,t){return rt.current.useCallback(e,t)};ae.useContext=function(e){return rt.current.useContext(e)};ae.useDebugValue=function(){};ae.useDeferredValue=function(e){return rt.current.useDeferredValue(e)};ae.useEffect=function(e,t){return rt.current.useEffect(e,t)};ae.useId=function(){return rt.current.useId()};ae.useImperativeHandle=function(e,t,n){return rt.current.useImperativeHandle(e,t,n)};ae.useInsertionEffect=function(e,t){return rt.current.useInsertionEffect(e,t)};ae.useLayoutEffect=function(e,t){return rt.current.useLayoutEffect(e,t)};ae.useMemo=function(e,t){return rt.current.useMemo(e,t)};ae.useReducer=function(e,t,n){return rt.current.useReducer(e,t,n)};ae.useRef=function(e){return rt.current.useRef(e)};ae.useState=function(e){return rt.current.useState(e)};ae.useSyncExternalStore=function(e,t,n){return rt.current.useSyncExternalStore(e,t,n)};ae.useTransition=function(){return rt.current.useTransition()};ae.version="18.3.1";Op.exports=ae;var p=Op.exports;const L=Lp(p),oi=Xx({__proto__:null,default:L},[p]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var fy=p,py=Symbol.for("react.element"),hy=Symbol.for("react.fragment"),my=Object.prototype.hasOwnProperty,gy=fy.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,vy={key:!0,ref:!0,__self:!0,__source:!0};function Vp(e,t,n){var r,s={},o=null,l=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)my.call(t,r)&&!vy.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:py,type:e,key:o,ref:l,props:s,_owner:gy.current}}si.Fragment=hy;si.jsx=Vp;si.jsxs=Vp;Mp.exports=si;var i=Mp.exports,Ea={},Hp={exports:{}},vt={},Gp={exports:{}},Yp={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(R,$){var F=R.length;R.push($);e:for(;0<F;){var X=F-1>>>1,ee=R[X];if(0<s(ee,$))R[X]=$,R[F]=ee,F=X;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var $=R[0],F=R.pop();if(F!==$){R[0]=F;e:for(var X=0,ee=R.length,G=ee>>>1;X<G;){var ne=2*(X+1)-1,oe=R[ne],le=ne+1,we=R[le];if(0>s(oe,F))le<ee&&0>s(we,oe)?(R[X]=we,R[le]=F,X=le):(R[X]=oe,R[ne]=F,X=ne);else if(le<ee&&0>s(we,F))R[X]=we,R[le]=F,X=le;else break e}}return $}function s(R,$){var F=R.sortIndex-$.sortIndex;return F!==0?F:R.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var c=[],u=[],d=1,f=null,h=3,y=!1,x=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(R){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=R)r(u),$.sortIndex=$.expirationTime,t(c,$);else break;$=n(u)}}function k(R){if(w=!1,g(R),!x)if(n(c)!==null)x=!0,A(j);else{var $=n(u);$!==null&&W(k,$.startTime-R)}}function j(R,$){x=!1,w&&(w=!1,m(C),C=-1),y=!0;var F=h;try{for(g($),f=n(c);f!==null&&(!(f.expirationTime>$)||R&&!V());){var X=f.callback;if(typeof X=="function"){f.callback=null,h=f.priorityLevel;var ee=X(f.expirationTime<=$);$=e.unstable_now(),typeof ee=="function"?f.callback=ee:f===n(c)&&r(c),g($)}else r(c);f=n(c)}if(f!==null)var G=!0;else{var ne=n(u);ne!==null&&W(k,ne.startTime-$),G=!1}return G}finally{f=null,h=F,y=!1}}var E=!1,S=null,C=-1,U=5,T=-1;function V(){return!(e.unstable_now()-T<U)}function _(){if(S!==null){var R=e.unstable_now();T=R;var $=!0;try{$=S(!0,R)}finally{$?K():(E=!1,S=null)}}else E=!1}var K;if(typeof v=="function")K=function(){v(_)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,O=J.port2;J.port1.onmessage=_,K=function(){O.postMessage(null)}}else K=function(){b(_,0)};function A(R){S=R,E||(E=!0,K())}function W(R,$){C=b(function(){R(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){x||y||(x=!0,A(j))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(R){switch(h){case 1:case 2:case 3:var $=3;break;default:$=h}var F=h;h=$;try{return R()}finally{h=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,$){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var F=h;h=R;try{return $()}finally{h=F}},e.unstable_scheduleCallback=function(R,$,F){var X=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?X+F:X):F=X,R){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=F+ee,R={id:d++,callback:$,priorityLevel:R,startTime:F,expirationTime:ee,sortIndex:-1},F>X?(R.sortIndex=F,t(u,R),n(c)===null&&R===n(u)&&(w?(m(C),C=-1):w=!0,W(k,F-X))):(R.sortIndex=ee,t(c,R),x||y||(x=!0,A(j))),R},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(R){var $=h;return function(){var F=h;h=$;try{return R.apply(this,arguments)}finally{h=F}}}})(Yp);Gp.exports=Yp;var xy=Gp.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var yy=p,gt=xy;function z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Kp=new Set,Us={};function xr(e,t){qr(e,t),qr(e+"Capture",t)}function qr(e,t){for(Us[e]=t,e=0;e<t.length;e++)Kp.add(t[e])}var fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ta=Object.prototype.hasOwnProperty,wy=/^[: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]*$/,Cd={},Ed={};function by(e){return Ta.call(Ed,e)?!0:Ta.call(Cd,e)?!1:wy.test(e)?Ed[e]=!0:(Cd[e]=!0,!1)}function ky(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Sy(e,t,n,r){if(t===null||typeof t>"u"||ky(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function st(e,t,n,r,s,o,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=l}var Ge={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ge[e]=new st(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ge[t]=new st(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ge[e]=new st(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ge[e]=new st(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ge[e]=new st(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ge[e]=new st(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ge[e]=new st(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ge[e]=new st(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ge[e]=new st(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gc=/[\-:]([a-z])/g;function Yc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Gc,Yc);Ge[t]=new st(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Gc,Yc);Ge[t]=new st(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Gc,Yc);Ge[t]=new st(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ge[e]=new st(e,1,!1,e.toLowerCase(),null,!1,!1)});Ge.xlinkHref=new st("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ge[e]=new st(e,1,!1,e.toLowerCase(),null,!0,!0)});function Kc(e,t,n,r){var s=Ge.hasOwnProperty(t)?Ge[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Sy(t,n,s,r)&&(n=null),r||s===null?by(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var vn=yy.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Io=Symbol.for("react.element"),Pr=Symbol.for("react.portal"),_r=Symbol.for("react.fragment"),Qc=Symbol.for("react.strict_mode"),Ra=Symbol.for("react.profiler"),Qp=Symbol.for("react.provider"),Xp=Symbol.for("react.context"),Xc=Symbol.for("react.forward_ref"),Ia=Symbol.for("react.suspense"),Pa=Symbol.for("react.suspense_list"),Zc=Symbol.for("react.memo"),En=Symbol.for("react.lazy"),Zp=Symbol.for("react.offscreen"),Td=Symbol.iterator;function ms(e){return e===null||typeof e!="object"?null:(e=Td&&e[Td]||e["@@iterator"],typeof e=="function"?e:null)}var Ie=Object.assign,zi;function Es(e){if(zi===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zi=t&&t[1]||""}return`
|
|
34
|
+
`+zi+e}var $i=!1;function Fi(e,t){if(!e||$i)return"";$i=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(`
|
|
35
|
+
`),o=r.stack.split(`
|
|
36
|
+
`),l=s.length-1,a=o.length-1;1<=l&&0<=a&&s[l]!==o[a];)a--;for(;1<=l&&0<=a;l--,a--)if(s[l]!==o[a]){if(l!==1||a!==1)do if(l--,a--,0>a||s[l]!==o[a]){var c=`
|
|
37
|
+
`+s[l].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=l&&0<=a);break}}}finally{$i=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Es(e):""}function Ny(e){switch(e.tag){case 5:return Es(e.type);case 16:return Es("Lazy");case 13:return Es("Suspense");case 19:return Es("SuspenseList");case 0:case 2:case 15:return e=Fi(e.type,!1),e;case 11:return e=Fi(e.type.render,!1),e;case 1:return e=Fi(e.type,!0),e;default:return""}}function _a(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _r:return"Fragment";case Pr:return"Portal";case Ra:return"Profiler";case Qc:return"StrictMode";case Ia:return"Suspense";case Pa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xp:return(e.displayName||"Context")+".Consumer";case Qp:return(e._context.displayName||"Context")+".Provider";case Xc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Zc:return t=e.displayName||null,t!==null?t:_a(e.type)||"Memo";case En:t=e._payload,e=e._init;try{return _a(e(t))}catch{}}return null}function jy(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _a(t);case 8:return t===Qc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Gn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Cy(e){var t=qp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Po(e){e._valueTracker||(e._valueTracker=Cy(e))}function Jp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=qp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function yl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function La(e,t){var n=t.checked;return Ie({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Rd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Gn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function eh(e,t){t=t.checked,t!=null&&Kc(e,"checked",t,!1)}function Ma(e,t){eh(e,t);var n=Gn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Oa(e,t.type,n):t.hasOwnProperty("defaultValue")&&Oa(e,t.type,Gn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Id(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Oa(e,t,n){(t!=="number"||yl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ts=Array.isArray;function Vr(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Gn(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Aa(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(z(91));return Ie({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Pd(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(z(92));if(Ts(n)){if(1<n.length)throw Error(z(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Gn(n)}}function th(e,t){var n=Gn(t.value),r=Gn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function _d(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function nh(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Da(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?nh(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var _o,rh=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(_o=_o||document.createElement("div"),_o.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=_o.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ws(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ps={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ey=["Webkit","ms","Moz","O"];Object.keys(Ps).forEach(function(e){Ey.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ps[t]=Ps[e]})});function sh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ps.hasOwnProperty(e)&&Ps[e]?(""+t).trim():t+"px"}function oh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=sh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var Ty=Ie({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function za(e,t){if(t){if(Ty[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function $a(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fa=null;function qc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ba=null,Hr=null,Gr=null;function Ld(e){if(e=mo(e)){if(typeof Ba!="function")throw Error(z(280));var t=e.stateNode;t&&(t=ui(t),Ba(e.stateNode,e.type,t))}}function lh(e){Hr?Gr?Gr.push(e):Gr=[e]:Hr=e}function ih(){if(Hr){var e=Hr,t=Gr;if(Gr=Hr=null,Ld(e),t)for(e=0;e<t.length;e++)Ld(t[e])}}function ah(e,t){return e(t)}function ch(){}var Bi=!1;function uh(e,t,n){if(Bi)return e(t,n);Bi=!0;try{return ah(e,t,n)}finally{Bi=!1,(Hr!==null||Gr!==null)&&(ch(),ih())}}function Vs(e,t){var n=e.stateNode;if(n===null)return null;var r=ui(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(z(231,t,typeof n));return n}var Ua=!1;if(fn)try{var gs={};Object.defineProperty(gs,"passive",{get:function(){Ua=!0}}),window.addEventListener("test",gs,gs),window.removeEventListener("test",gs,gs)}catch{Ua=!1}function Ry(e,t,n,r,s,o,l,a,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var _s=!1,wl=null,bl=!1,Wa=null,Iy={onError:function(e){_s=!0,wl=e}};function Py(e,t,n,r,s,o,l,a,c){_s=!1,wl=null,Ry.apply(Iy,arguments)}function _y(e,t,n,r,s,o,l,a,c){if(Py.apply(this,arguments),_s){if(_s){var u=wl;_s=!1,wl=null}else throw Error(z(198));bl||(bl=!0,Wa=u)}}function yr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function dh(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 Md(e){if(yr(e)!==e)throw Error(z(188))}function Ly(e){var t=e.alternate;if(!t){if(t=yr(e),t===null)throw Error(z(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return Md(s),e;if(o===r)return Md(s),t;o=o.sibling}throw Error(z(188))}if(n.return!==r.return)n=s,r=o;else{for(var l=!1,a=s.child;a;){if(a===n){l=!0,n=s,r=o;break}if(a===r){l=!0,r=s,n=o;break}a=a.sibling}if(!l){for(a=o.child;a;){if(a===n){l=!0,n=o,r=s;break}if(a===r){l=!0,r=o,n=s;break}a=a.sibling}if(!l)throw Error(z(189))}}if(n.alternate!==r)throw Error(z(190))}if(n.tag!==3)throw Error(z(188));return n.stateNode.current===n?e:t}function fh(e){return e=Ly(e),e!==null?ph(e):null}function ph(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ph(e);if(t!==null)return t;e=e.sibling}return null}var hh=gt.unstable_scheduleCallback,Od=gt.unstable_cancelCallback,My=gt.unstable_shouldYield,Oy=gt.unstable_requestPaint,Le=gt.unstable_now,Ay=gt.unstable_getCurrentPriorityLevel,Jc=gt.unstable_ImmediatePriority,mh=gt.unstable_UserBlockingPriority,kl=gt.unstable_NormalPriority,Dy=gt.unstable_LowPriority,gh=gt.unstable_IdlePriority,li=null,Gt=null;function zy(e){if(Gt&&typeof Gt.onCommitFiberRoot=="function")try{Gt.onCommitFiberRoot(li,e,void 0,(e.current.flags&128)===128)}catch{}}var Mt=Math.clz32?Math.clz32:By,$y=Math.log,Fy=Math.LN2;function By(e){return e>>>=0,e===0?32:31-($y(e)/Fy|0)|0}var Lo=64,Mo=4194304;function Rs(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,l=n&268435455;if(l!==0){var a=l&~s;a!==0?r=Rs(a):(o&=l,o!==0&&(r=Rs(o)))}else l=n&~s,l!==0?r=Rs(l):o!==0&&(r=Rs(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Mt(t),s=1<<n,r|=e[n],t&=~s;return r}function Uy(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wy(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var l=31-Mt(o),a=1<<l,c=s[l];c===-1?(!(a&n)||a&r)&&(s[l]=Uy(a,t)):c<=t&&(e.expiredLanes|=a),o&=~a}}function Va(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function vh(){var e=Lo;return Lo<<=1,!(Lo&4194240)&&(Lo=64),e}function Ui(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function po(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mt(t),e[t]=n}function Vy(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Mt(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function eu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Mt(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var me=0;function xh(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var yh,tu,wh,bh,kh,Ha=!1,Oo=[],Mn=null,On=null,An=null,Hs=new Map,Gs=new Map,Rn=[],Hy="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ad(e,t){switch(e){case"focusin":case"focusout":Mn=null;break;case"dragenter":case"dragleave":On=null;break;case"mouseover":case"mouseout":An=null;break;case"pointerover":case"pointerout":Hs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gs.delete(t.pointerId)}}function vs(e,t,n,r,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[s]},t!==null&&(t=mo(t),t!==null&&tu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Gy(e,t,n,r,s){switch(t){case"focusin":return Mn=vs(Mn,e,t,n,r,s),!0;case"dragenter":return On=vs(On,e,t,n,r,s),!0;case"mouseover":return An=vs(An,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return Hs.set(o,vs(Hs.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,Gs.set(o,vs(Gs.get(o)||null,e,t,n,r,s)),!0}return!1}function Sh(e){var t=or(e.target);if(t!==null){var n=yr(t);if(n!==null){if(t=n.tag,t===13){if(t=dh(n),t!==null){e.blockedOn=t,kh(e.priority,function(){wh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function rl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ga(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Fa=r,n.target.dispatchEvent(r),Fa=null}else return t=mo(n),t!==null&&tu(t),e.blockedOn=n,!1;t.shift()}return!0}function Dd(e,t,n){rl(e)&&n.delete(t)}function Yy(){Ha=!1,Mn!==null&&rl(Mn)&&(Mn=null),On!==null&&rl(On)&&(On=null),An!==null&&rl(An)&&(An=null),Hs.forEach(Dd),Gs.forEach(Dd)}function xs(e,t){e.blockedOn===t&&(e.blockedOn=null,Ha||(Ha=!0,gt.unstable_scheduleCallback(gt.unstable_NormalPriority,Yy)))}function Ys(e){function t(s){return xs(s,e)}if(0<Oo.length){xs(Oo[0],e);for(var n=1;n<Oo.length;n++){var r=Oo[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Mn!==null&&xs(Mn,e),On!==null&&xs(On,e),An!==null&&xs(An,e),Hs.forEach(t),Gs.forEach(t),n=0;n<Rn.length;n++)r=Rn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Rn.length&&(n=Rn[0],n.blockedOn===null);)Sh(n),n.blockedOn===null&&Rn.shift()}var Yr=vn.ReactCurrentBatchConfig,Nl=!0;function Ky(e,t,n,r){var s=me,o=Yr.transition;Yr.transition=null;try{me=1,nu(e,t,n,r)}finally{me=s,Yr.transition=o}}function Qy(e,t,n,r){var s=me,o=Yr.transition;Yr.transition=null;try{me=4,nu(e,t,n,r)}finally{me=s,Yr.transition=o}}function nu(e,t,n,r){if(Nl){var s=Ga(e,t,n,r);if(s===null)qi(e,t,r,jl,n),Ad(e,r);else if(Gy(s,e,t,n,r))r.stopPropagation();else if(Ad(e,r),t&4&&-1<Hy.indexOf(e)){for(;s!==null;){var o=mo(s);if(o!==null&&yh(o),o=Ga(e,t,n,r),o===null&&qi(e,t,r,jl,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else qi(e,t,r,null,n)}}var jl=null;function Ga(e,t,n,r){if(jl=null,e=qc(r),e=or(e),e!==null)if(t=yr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=dh(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return jl=e,null}function Nh(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ay()){case Jc:return 1;case mh:return 4;case kl:case Dy:return 16;case gh:return 536870912;default:return 16}default:return 16}}var Pn=null,ru=null,sl=null;function jh(){if(sl)return sl;var e,t=ru,n=t.length,r,s="value"in Pn?Pn.value:Pn.textContent,o=s.length;for(e=0;e<n&&t[e]===s[e];e++);var l=n-e;for(r=1;r<=l&&t[n-r]===s[o-r];r++);return sl=s.slice(e,1<r?1-r:void 0)}function ol(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 Ao(){return!0}function zd(){return!1}function xt(e){function t(n,r,s,o,l){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=l,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Ao:zd,this.isPropagationStopped=zd,this}return Ie(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ao)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ao)},persist:function(){},isPersistent:Ao}),t}var as={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},su=xt(as),ho=Ie({},as,{view:0,detail:0}),Xy=xt(ho),Wi,Vi,ys,ii=Ie({},ho,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ou,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!==ys&&(ys&&e.type==="mousemove"?(Wi=e.screenX-ys.screenX,Vi=e.screenY-ys.screenY):Vi=Wi=0,ys=e),Wi)},movementY:function(e){return"movementY"in e?e.movementY:Vi}}),$d=xt(ii),Zy=Ie({},ii,{dataTransfer:0}),qy=xt(Zy),Jy=Ie({},ho,{relatedTarget:0}),Hi=xt(Jy),e0=Ie({},as,{animationName:0,elapsedTime:0,pseudoElement:0}),t0=xt(e0),n0=Ie({},as,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),r0=xt(n0),s0=Ie({},as,{data:0}),Fd=xt(s0),o0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},l0={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"},i0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function a0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=i0[e])?!!t[e]:!1}function ou(){return a0}var c0=Ie({},ho,{key:function(e){if(e.key){var t=o0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ol(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?l0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ou,charCode:function(e){return e.type==="keypress"?ol(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ol(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),u0=xt(c0),d0=Ie({},ii,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bd=xt(d0),f0=Ie({},ho,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ou}),p0=xt(f0),h0=Ie({},as,{propertyName:0,elapsedTime:0,pseudoElement:0}),m0=xt(h0),g0=Ie({},ii,{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}),v0=xt(g0),x0=[9,13,27,32],lu=fn&&"CompositionEvent"in window,Ls=null;fn&&"documentMode"in document&&(Ls=document.documentMode);var y0=fn&&"TextEvent"in window&&!Ls,Ch=fn&&(!lu||Ls&&8<Ls&&11>=Ls),Ud=" ",Wd=!1;function Eh(e,t){switch(e){case"keyup":return x0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Th(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Lr=!1;function w0(e,t){switch(e){case"compositionend":return Th(t);case"keypress":return t.which!==32?null:(Wd=!0,Ud);case"textInput":return e=t.data,e===Ud&&Wd?null:e;default:return null}}function b0(e,t){if(Lr)return e==="compositionend"||!lu&&Eh(e,t)?(e=jh(),sl=ru=Pn=null,Lr=!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 Ch&&t.locale!=="ko"?null:t.data;default:return null}}var k0={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 Vd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!k0[e.type]:t==="textarea"}function Rh(e,t,n,r){lh(r),t=Cl(t,"onChange"),0<t.length&&(n=new su("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ms=null,Ks=null;function S0(e){Fh(e,0)}function ai(e){var t=Ar(e);if(Jp(t))return e}function N0(e,t){if(e==="change")return t}var Ih=!1;if(fn){var Gi;if(fn){var Yi="oninput"in document;if(!Yi){var Hd=document.createElement("div");Hd.setAttribute("oninput","return;"),Yi=typeof Hd.oninput=="function"}Gi=Yi}else Gi=!1;Ih=Gi&&(!document.documentMode||9<document.documentMode)}function Gd(){Ms&&(Ms.detachEvent("onpropertychange",Ph),Ks=Ms=null)}function Ph(e){if(e.propertyName==="value"&&ai(Ks)){var t=[];Rh(t,Ks,e,qc(e)),uh(S0,t)}}function j0(e,t,n){e==="focusin"?(Gd(),Ms=t,Ks=n,Ms.attachEvent("onpropertychange",Ph)):e==="focusout"&&Gd()}function C0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ai(Ks)}function E0(e,t){if(e==="click")return ai(t)}function T0(e,t){if(e==="input"||e==="change")return ai(t)}function R0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var At=typeof Object.is=="function"?Object.is:R0;function Qs(e,t){if(At(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Ta.call(t,s)||!At(e[s],t[s]))return!1}return!0}function Yd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kd(e,t){var n=Yd(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Yd(n)}}function _h(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_h(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lh(){for(var e=window,t=yl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=yl(e.document)}return t}function iu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function I0(e){var t=Lh(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&_h(n.ownerDocument.documentElement,n)){if(r!==null&&iu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=Kd(n,o);var l=Kd(n,r);s&&l&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var P0=fn&&"documentMode"in document&&11>=document.documentMode,Mr=null,Ya=null,Os=null,Ka=!1;function Qd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ka||Mr==null||Mr!==yl(r)||(r=Mr,"selectionStart"in r&&iu(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}),Os&&Qs(Os,r)||(Os=r,r=Cl(Ya,"onSelect"),0<r.length&&(t=new su("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Mr)))}function Do(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Or={animationend:Do("Animation","AnimationEnd"),animationiteration:Do("Animation","AnimationIteration"),animationstart:Do("Animation","AnimationStart"),transitionend:Do("Transition","TransitionEnd")},Ki={},Mh={};fn&&(Mh=document.createElement("div").style,"AnimationEvent"in window||(delete Or.animationend.animation,delete Or.animationiteration.animation,delete Or.animationstart.animation),"TransitionEvent"in window||delete Or.transitionend.transition);function ci(e){if(Ki[e])return Ki[e];if(!Or[e])return e;var t=Or[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mh)return Ki[e]=t[n];return e}var Oh=ci("animationend"),Ah=ci("animationiteration"),Dh=ci("animationstart"),zh=ci("transitionend"),$h=new Map,Xd="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function qn(e,t){$h.set(e,t),xr(t,[e])}for(var Qi=0;Qi<Xd.length;Qi++){var Xi=Xd[Qi],_0=Xi.toLowerCase(),L0=Xi[0].toUpperCase()+Xi.slice(1);qn(_0,"on"+L0)}qn(Oh,"onAnimationEnd");qn(Ah,"onAnimationIteration");qn(Dh,"onAnimationStart");qn("dblclick","onDoubleClick");qn("focusin","onFocus");qn("focusout","onBlur");qn(zh,"onTransitionEnd");qr("onMouseEnter",["mouseout","mouseover"]);qr("onMouseLeave",["mouseout","mouseover"]);qr("onPointerEnter",["pointerout","pointerover"]);qr("onPointerLeave",["pointerout","pointerover"]);xr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xr("onBeforeInput",["compositionend","keypress","textInput","paste"]);xr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Is="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(" "),M0=new Set("cancel close invalid load scroll toggle".split(" ").concat(Is));function Zd(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,_y(r,t,void 0,e),e.currentTarget=null}function Fh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var l=r.length-1;0<=l;l--){var a=r[l],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==o&&s.isPropagationStopped())break e;Zd(s,a,u),o=c}else for(l=0;l<r.length;l++){if(a=r[l],c=a.instance,u=a.currentTarget,a=a.listener,c!==o&&s.isPropagationStopped())break e;Zd(s,a,u),o=c}}}if(bl)throw e=Wa,bl=!1,Wa=null,e}function ke(e,t){var n=t[Ja];n===void 0&&(n=t[Ja]=new Set);var r=e+"__bubble";n.has(r)||(Bh(t,e,2,!1),n.add(r))}function Zi(e,t,n){var r=0;t&&(r|=4),Bh(n,e,r,t)}var zo="_reactListening"+Math.random().toString(36).slice(2);function Xs(e){if(!e[zo]){e[zo]=!0,Kp.forEach(function(n){n!=="selectionchange"&&(M0.has(n)||Zi(n,!1,e),Zi(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[zo]||(t[zo]=!0,Zi("selectionchange",!1,t))}}function Bh(e,t,n,r){switch(Nh(t)){case 1:var s=Ky;break;case 4:s=Qy;break;default:s=nu}n=s.bind(null,t,n,e),s=void 0,!Ua||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function qi(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(l===4)for(l=r.return;l!==null;){var c=l.tag;if((c===3||c===4)&&(c=l.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;l=l.return}for(;a!==null;){if(l=or(a),l===null)return;if(c=l.tag,c===5||c===6){r=o=l;continue e}a=a.parentNode}}r=r.return}uh(function(){var u=o,d=qc(n),f=[];e:{var h=$h.get(e);if(h!==void 0){var y=su,x=e;switch(e){case"keypress":if(ol(n)===0)break e;case"keydown":case"keyup":y=u0;break;case"focusin":x="focus",y=Hi;break;case"focusout":x="blur",y=Hi;break;case"beforeblur":case"afterblur":y=Hi;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=$d;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=qy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=p0;break;case Oh:case Ah:case Dh:y=t0;break;case zh:y=m0;break;case"scroll":y=Xy;break;case"wheel":y=v0;break;case"copy":case"cut":case"paste":y=r0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=Bd}var w=(t&4)!==0,b=!w&&e==="scroll",m=w?h!==null?h+"Capture":null:h;w=[];for(var v=u,g;v!==null;){g=v;var k=g.stateNode;if(g.tag===5&&k!==null&&(g=k,m!==null&&(k=Vs(v,m),k!=null&&w.push(Zs(v,k,g)))),b)break;v=v.return}0<w.length&&(h=new y(h,x,null,n,d),f.push({event:h,listeners:w}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",h&&n!==Fa&&(x=n.relatedTarget||n.fromElement)&&(or(x)||x[pn]))break e;if((y||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,y?(x=n.relatedTarget||n.toElement,y=u,x=x?or(x):null,x!==null&&(b=yr(x),x!==b||x.tag!==5&&x.tag!==6)&&(x=null)):(y=null,x=u),y!==x)){if(w=$d,k="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(w=Bd,k="onPointerLeave",m="onPointerEnter",v="pointer"),b=y==null?h:Ar(y),g=x==null?h:Ar(x),h=new w(k,v+"leave",y,n,d),h.target=b,h.relatedTarget=g,k=null,or(d)===u&&(w=new w(m,v+"enter",x,n,d),w.target=g,w.relatedTarget=b,k=w),b=k,y&&x)t:{for(w=y,m=x,v=0,g=w;g;g=Er(g))v++;for(g=0,k=m;k;k=Er(k))g++;for(;0<v-g;)w=Er(w),v--;for(;0<g-v;)m=Er(m),g--;for(;v--;){if(w===m||m!==null&&w===m.alternate)break t;w=Er(w),m=Er(m)}w=null}else w=null;y!==null&&qd(f,h,y,w,!1),x!==null&&b!==null&&qd(f,b,x,w,!0)}}e:{if(h=u?Ar(u):window,y=h.nodeName&&h.nodeName.toLowerCase(),y==="select"||y==="input"&&h.type==="file")var j=N0;else if(Vd(h))if(Ih)j=T0;else{j=C0;var E=j0}else(y=h.nodeName)&&y.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=E0);if(j&&(j=j(e,u))){Rh(f,j,n,d);break e}E&&E(e,h,u),e==="focusout"&&(E=h._wrapperState)&&E.controlled&&h.type==="number"&&Oa(h,"number",h.value)}switch(E=u?Ar(u):window,e){case"focusin":(Vd(E)||E.contentEditable==="true")&&(Mr=E,Ya=u,Os=null);break;case"focusout":Os=Ya=Mr=null;break;case"mousedown":Ka=!0;break;case"contextmenu":case"mouseup":case"dragend":Ka=!1,Qd(f,n,d);break;case"selectionchange":if(P0)break;case"keydown":case"keyup":Qd(f,n,d)}var S;if(lu)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Lr?Eh(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Ch&&n.locale!=="ko"&&(Lr||C!=="onCompositionStart"?C==="onCompositionEnd"&&Lr&&(S=jh()):(Pn=d,ru="value"in Pn?Pn.value:Pn.textContent,Lr=!0)),E=Cl(u,C),0<E.length&&(C=new Fd(C,e,null,n,d),f.push({event:C,listeners:E}),S?C.data=S:(S=Th(n),S!==null&&(C.data=S)))),(S=y0?w0(e,n):b0(e,n))&&(u=Cl(u,"onBeforeInput"),0<u.length&&(d=new Fd("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=S))}Fh(f,t)})}function Zs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Cl(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Vs(e,n),o!=null&&r.unshift(Zs(e,o,s)),o=Vs(e,t),o!=null&&r.push(Zs(e,o,s))),e=e.return}return r}function Er(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function qd(e,t,n,r,s){for(var o=t._reactName,l=[];n!==null&&n!==r;){var a=n,c=a.alternate,u=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&u!==null&&(a=u,s?(c=Vs(n,o),c!=null&&l.unshift(Zs(n,c,a))):s||(c=Vs(n,o),c!=null&&l.push(Zs(n,c,a)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var O0=/\r\n?/g,A0=/\u0000|\uFFFD/g;function Jd(e){return(typeof e=="string"?e:""+e).replace(O0,`
|
|
38
|
+
`).replace(A0,"")}function $o(e,t,n){if(t=Jd(t),Jd(e)!==t&&n)throw Error(z(425))}function El(){}var Qa=null,Xa=null;function Za(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qa=typeof setTimeout=="function"?setTimeout:void 0,D0=typeof clearTimeout=="function"?clearTimeout:void 0,ef=typeof Promise=="function"?Promise:void 0,z0=typeof queueMicrotask=="function"?queueMicrotask:typeof ef<"u"?function(e){return ef.resolve(null).then(e).catch($0)}:qa;function $0(e){setTimeout(function(){throw e})}function Ji(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Ys(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Ys(t)}function Dn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function tf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var cs=Math.random().toString(36).slice(2),Wt="__reactFiber$"+cs,qs="__reactProps$"+cs,pn="__reactContainer$"+cs,Ja="__reactEvents$"+cs,F0="__reactListeners$"+cs,B0="__reactHandles$"+cs;function or(e){var t=e[Wt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pn]||n[Wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=tf(e);e!==null;){if(n=e[Wt])return n;e=tf(e)}return t}e=n,n=e.parentNode}return null}function mo(e){return e=e[Wt]||e[pn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ar(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(z(33))}function ui(e){return e[qs]||null}var ec=[],Dr=-1;function Jn(e){return{current:e}}function Se(e){0>Dr||(e.current=ec[Dr],ec[Dr]=null,Dr--)}function ye(e,t){Dr++,ec[Dr]=e.current,e.current=t}var Yn={},Je=Jn(Yn),at=Jn(!1),ur=Yn;function Jr(e,t){var n=e.type.contextTypes;if(!n)return Yn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function ct(e){return e=e.childContextTypes,e!=null}function Tl(){Se(at),Se(Je)}function nf(e,t,n){if(Je.current!==Yn)throw Error(z(168));ye(Je,t),ye(at,n)}function Uh(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(z(108,jy(e)||"Unknown",s));return Ie({},n,r)}function Rl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yn,ur=Je.current,ye(Je,e),ye(at,at.current),!0}function rf(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=Uh(e,t,ur),r.__reactInternalMemoizedMergedChildContext=e,Se(at),Se(Je),ye(Je,e)):Se(at),ye(at,n)}var sn=null,di=!1,ea=!1;function Wh(e){sn===null?sn=[e]:sn.push(e)}function U0(e){di=!0,Wh(e)}function er(){if(!ea&&sn!==null){ea=!0;var e=0,t=me;try{var n=sn;for(me=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}sn=null,di=!1}catch(s){throw sn!==null&&(sn=sn.slice(e+1)),hh(Jc,er),s}finally{me=t,ea=!1}}return null}var zr=[],$r=0,Il=null,Pl=0,wt=[],bt=0,dr=null,on=1,ln="";function rr(e,t){zr[$r++]=Pl,zr[$r++]=Il,Il=e,Pl=t}function Vh(e,t,n){wt[bt++]=on,wt[bt++]=ln,wt[bt++]=dr,dr=e;var r=on;e=ln;var s=32-Mt(r)-1;r&=~(1<<s),n+=1;var o=32-Mt(t)+s;if(30<o){var l=s-s%5;o=(r&(1<<l)-1).toString(32),r>>=l,s-=l,on=1<<32-Mt(t)+s|n<<s|r,ln=o+e}else on=1<<o|n<<s|r,ln=e}function au(e){e.return!==null&&(rr(e,1),Vh(e,1,0))}function cu(e){for(;e===Il;)Il=zr[--$r],zr[$r]=null,Pl=zr[--$r],zr[$r]=null;for(;e===dr;)dr=wt[--bt],wt[bt]=null,ln=wt[--bt],wt[bt]=null,on=wt[--bt],wt[bt]=null}var mt=null,ht=null,je=!1,Lt=null;function Hh(e,t){var n=kt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function sf(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,mt=e,ht=Dn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,mt=e,ht=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=dr!==null?{id:on,overflow:ln}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=kt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,mt=e,ht=null,!0):!1;default:return!1}}function tc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function nc(e){if(je){var t=ht;if(t){var n=t;if(!sf(e,t)){if(tc(e))throw Error(z(418));t=Dn(n.nextSibling);var r=mt;t&&sf(e,t)?Hh(r,n):(e.flags=e.flags&-4097|2,je=!1,mt=e)}}else{if(tc(e))throw Error(z(418));e.flags=e.flags&-4097|2,je=!1,mt=e}}}function of(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;mt=e}function Fo(e){if(e!==mt)return!1;if(!je)return of(e),je=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Za(e.type,e.memoizedProps)),t&&(t=ht)){if(tc(e))throw Gh(),Error(z(418));for(;t;)Hh(e,t),t=Dn(t.nextSibling)}if(of(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ht=Dn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ht=null}}else ht=mt?Dn(e.stateNode.nextSibling):null;return!0}function Gh(){for(var e=ht;e;)e=Dn(e.nextSibling)}function es(){ht=mt=null,je=!1}function uu(e){Lt===null?Lt=[e]:Lt.push(e)}var W0=vn.ReactCurrentBatchConfig;function ws(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(z(309));var r=n.stateNode}if(!r)throw Error(z(147,e));var s=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(l){var a=s.refs;l===null?delete a[o]:a[o]=l},t._stringRef=o,t)}if(typeof e!="string")throw Error(z(284));if(!n._owner)throw Error(z(290,e))}return e}function Bo(e,t){throw e=Object.prototype.toString.call(t),Error(z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function lf(e){var t=e._init;return t(e._payload)}function Yh(e){function t(m,v){if(e){var g=m.deletions;g===null?(m.deletions=[v],m.flags|=16):g.push(v)}}function n(m,v){if(!e)return null;for(;v!==null;)t(m,v),v=v.sibling;return null}function r(m,v){for(m=new Map;v!==null;)v.key!==null?m.set(v.key,v):m.set(v.index,v),v=v.sibling;return m}function s(m,v){return m=Bn(m,v),m.index=0,m.sibling=null,m}function o(m,v,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<v?(m.flags|=2,v):g):(m.flags|=2,v)):(m.flags|=1048576,v)}function l(m){return e&&m.alternate===null&&(m.flags|=2),m}function a(m,v,g,k){return v===null||v.tag!==6?(v=ia(g,m.mode,k),v.return=m,v):(v=s(v,g),v.return=m,v)}function c(m,v,g,k){var j=g.type;return j===_r?d(m,v,g.props.children,k,g.key):v!==null&&(v.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===En&&lf(j)===v.type)?(k=s(v,g.props),k.ref=ws(m,v,g),k.return=m,k):(k=fl(g.type,g.key,g.props,null,m.mode,k),k.ref=ws(m,v,g),k.return=m,k)}function u(m,v,g,k){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=aa(g,m.mode,k),v.return=m,v):(v=s(v,g.children||[]),v.return=m,v)}function d(m,v,g,k,j){return v===null||v.tag!==7?(v=cr(g,m.mode,k,j),v.return=m,v):(v=s(v,g),v.return=m,v)}function f(m,v,g){if(typeof v=="string"&&v!==""||typeof v=="number")return v=ia(""+v,m.mode,g),v.return=m,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Io:return g=fl(v.type,v.key,v.props,null,m.mode,g),g.ref=ws(m,null,v),g.return=m,g;case Pr:return v=aa(v,m.mode,g),v.return=m,v;case En:var k=v._init;return f(m,k(v._payload),g)}if(Ts(v)||ms(v))return v=cr(v,m.mode,g,null),v.return=m,v;Bo(m,v)}return null}function h(m,v,g,k){var j=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return j!==null?null:a(m,v,""+g,k);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Io:return g.key===j?c(m,v,g,k):null;case Pr:return g.key===j?u(m,v,g,k):null;case En:return j=g._init,h(m,v,j(g._payload),k)}if(Ts(g)||ms(g))return j!==null?null:d(m,v,g,k,null);Bo(m,g)}return null}function y(m,v,g,k,j){if(typeof k=="string"&&k!==""||typeof k=="number")return m=m.get(g)||null,a(v,m,""+k,j);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Io:return m=m.get(k.key===null?g:k.key)||null,c(v,m,k,j);case Pr:return m=m.get(k.key===null?g:k.key)||null,u(v,m,k,j);case En:var E=k._init;return y(m,v,g,E(k._payload),j)}if(Ts(k)||ms(k))return m=m.get(g)||null,d(v,m,k,j,null);Bo(v,k)}return null}function x(m,v,g,k){for(var j=null,E=null,S=v,C=v=0,U=null;S!==null&&C<g.length;C++){S.index>C?(U=S,S=null):U=S.sibling;var T=h(m,S,g[C],k);if(T===null){S===null&&(S=U);break}e&&S&&T.alternate===null&&t(m,S),v=o(T,v,C),E===null?j=T:E.sibling=T,E=T,S=U}if(C===g.length)return n(m,S),je&&rr(m,C),j;if(S===null){for(;C<g.length;C++)S=f(m,g[C],k),S!==null&&(v=o(S,v,C),E===null?j=S:E.sibling=S,E=S);return je&&rr(m,C),j}for(S=r(m,S);C<g.length;C++)U=y(S,m,C,g[C],k),U!==null&&(e&&U.alternate!==null&&S.delete(U.key===null?C:U.key),v=o(U,v,C),E===null?j=U:E.sibling=U,E=U);return e&&S.forEach(function(V){return t(m,V)}),je&&rr(m,C),j}function w(m,v,g,k){var j=ms(g);if(typeof j!="function")throw Error(z(150));if(g=j.call(g),g==null)throw Error(z(151));for(var E=j=null,S=v,C=v=0,U=null,T=g.next();S!==null&&!T.done;C++,T=g.next()){S.index>C?(U=S,S=null):U=S.sibling;var V=h(m,S,T.value,k);if(V===null){S===null&&(S=U);break}e&&S&&V.alternate===null&&t(m,S),v=o(V,v,C),E===null?j=V:E.sibling=V,E=V,S=U}if(T.done)return n(m,S),je&&rr(m,C),j;if(S===null){for(;!T.done;C++,T=g.next())T=f(m,T.value,k),T!==null&&(v=o(T,v,C),E===null?j=T:E.sibling=T,E=T);return je&&rr(m,C),j}for(S=r(m,S);!T.done;C++,T=g.next())T=y(S,m,C,T.value,k),T!==null&&(e&&T.alternate!==null&&S.delete(T.key===null?C:T.key),v=o(T,v,C),E===null?j=T:E.sibling=T,E=T);return e&&S.forEach(function(_){return t(m,_)}),je&&rr(m,C),j}function b(m,v,g,k){if(typeof g=="object"&&g!==null&&g.type===_r&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Io:e:{for(var j=g.key,E=v;E!==null;){if(E.key===j){if(j=g.type,j===_r){if(E.tag===7){n(m,E.sibling),v=s(E,g.props.children),v.return=m,m=v;break e}}else if(E.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===En&&lf(j)===E.type){n(m,E.sibling),v=s(E,g.props),v.ref=ws(m,E,g),v.return=m,m=v;break e}n(m,E);break}else t(m,E);E=E.sibling}g.type===_r?(v=cr(g.props.children,m.mode,k,g.key),v.return=m,m=v):(k=fl(g.type,g.key,g.props,null,m.mode,k),k.ref=ws(m,v,g),k.return=m,m=k)}return l(m);case Pr:e:{for(E=g.key;v!==null;){if(v.key===E)if(v.tag===4&&v.stateNode.containerInfo===g.containerInfo&&v.stateNode.implementation===g.implementation){n(m,v.sibling),v=s(v,g.children||[]),v.return=m,m=v;break e}else{n(m,v);break}else t(m,v);v=v.sibling}v=aa(g,m.mode,k),v.return=m,m=v}return l(m);case En:return E=g._init,b(m,v,E(g._payload),k)}if(Ts(g))return x(m,v,g,k);if(ms(g))return w(m,v,g,k);Bo(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,v!==null&&v.tag===6?(n(m,v.sibling),v=s(v,g),v.return=m,m=v):(n(m,v),v=ia(g,m.mode,k),v.return=m,m=v),l(m)):n(m,v)}return b}var ts=Yh(!0),Kh=Yh(!1),_l=Jn(null),Ll=null,Fr=null,du=null;function fu(){du=Fr=Ll=null}function pu(e){var t=_l.current;Se(_l),e._currentValue=t}function rc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Kr(e,t){Ll=e,du=Fr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(it=!0),e.firstContext=null)}function Nt(e){var t=e._currentValue;if(du!==e)if(e={context:e,memoizedValue:t,next:null},Fr===null){if(Ll===null)throw Error(z(308));Fr=e,Ll.dependencies={lanes:0,firstContext:e}}else Fr=Fr.next=e;return t}var lr=null;function hu(e){lr===null?lr=[e]:lr.push(e)}function Qh(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,hu(t)):(n.next=s.next,s.next=n),t.interleaved=n,hn(e,r)}function hn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Tn=!1;function mu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function un(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function zn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,hn(e,n)}return s=r.interleaved,s===null?(t.next=t,hu(r)):(t.next=s.next,s.next=t),r.interleaved=t,hn(e,n)}function ll(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,eu(e,n)}}function af(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ml(e,t,n,r){var s=e.updateQueue;Tn=!1;var o=s.firstBaseUpdate,l=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,u=c.next;c.next=null,l===null?o=u:l.next=u,l=c;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==l&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=c))}if(o!==null){var f=s.baseState;l=0,d=u=c=null,a=o;do{var h=a.lane,y=a.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:y,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,w=a;switch(h=t,y=n,w.tag){case 1:if(x=w.payload,typeof x=="function"){f=x.call(y,f,h);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,h=typeof x=="function"?x.call(y,f,h):x,h==null)break e;f=Ie({},f,h);break e;case 2:Tn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else y={eventTime:y,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=y,c=f):d=d.next=y,l|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(c=f),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do l|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);pr|=l,e.lanes=l,e.memoizedState=f}}function cf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(z(191,s));s.call(r)}}}var go={},Yt=Jn(go),Js=Jn(go),eo=Jn(go);function ir(e){if(e===go)throw Error(z(174));return e}function gu(e,t){switch(ye(eo,t),ye(Js,e),ye(Yt,go),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Da(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Da(t,e)}Se(Yt),ye(Yt,t)}function ns(){Se(Yt),Se(Js),Se(eo)}function Zh(e){ir(eo.current);var t=ir(Yt.current),n=Da(t,e.type);t!==n&&(ye(Js,e),ye(Yt,n))}function vu(e){Js.current===e&&(Se(Yt),Se(Js))}var Ee=Jn(0);function Ol(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ta=[];function xu(){for(var e=0;e<ta.length;e++)ta[e]._workInProgressVersionPrimary=null;ta.length=0}var il=vn.ReactCurrentDispatcher,na=vn.ReactCurrentBatchConfig,fr=0,Te=null,Ae=null,Fe=null,Al=!1,As=!1,to=0,V0=0;function Qe(){throw Error(z(321))}function yu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!At(e[n],t[n]))return!1;return!0}function wu(e,t,n,r,s,o){if(fr=o,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,il.current=e===null||e.memoizedState===null?K0:Q0,e=n(r,s),As){o=0;do{if(As=!1,to=0,25<=o)throw Error(z(301));o+=1,Fe=Ae=null,t.updateQueue=null,il.current=X0,e=n(r,s)}while(As)}if(il.current=Dl,t=Ae!==null&&Ae.next!==null,fr=0,Fe=Ae=Te=null,Al=!1,t)throw Error(z(300));return e}function bu(){var e=to!==0;return to=0,e}function Ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fe===null?Te.memoizedState=Fe=e:Fe=Fe.next=e,Fe}function jt(){if(Ae===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Ae.next;var t=Fe===null?Te.memoizedState:Fe.next;if(t!==null)Fe=t,Ae=e;else{if(e===null)throw Error(z(310));Ae=e,e={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},Fe===null?Te.memoizedState=Fe=e:Fe=Fe.next=e}return Fe}function no(e,t){return typeof t=="function"?t(e):t}function ra(e){var t=jt(),n=t.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=e;var r=Ae,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var l=s.next;s.next=o.next,o.next=l}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var a=l=null,c=null,u=o;do{var d=u.lane;if((fr&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=f,l=r):c=c.next=f,Te.lanes|=d,pr|=d}u=u.next}while(u!==null&&u!==o);c===null?l=r:c.next=a,At(r,t.memoizedState)||(it=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,Te.lanes|=o,pr|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function sa(e){var t=jt(),n=t.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var l=s=s.next;do o=e(o,l.action),l=l.next;while(l!==s);At(o,t.memoizedState)||(it=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function qh(){}function Jh(e,t){var n=Te,r=jt(),s=t(),o=!At(r.memoizedState,s);if(o&&(r.memoizedState=s,it=!0),r=r.queue,ku(nm.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Fe!==null&&Fe.memoizedState.tag&1){if(n.flags|=2048,ro(9,tm.bind(null,n,r,s,t),void 0,null),Be===null)throw Error(z(349));fr&30||em(n,t,s)}return s}function em(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Te.updateQueue,t===null?(t={lastEffect:null,stores:null},Te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function tm(e,t,n,r){t.value=n,t.getSnapshot=r,rm(t)&&sm(e)}function nm(e,t,n){return n(function(){rm(t)&&sm(e)})}function rm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!At(e,n)}catch{return!0}}function sm(e){var t=hn(e,1);t!==null&&Ot(t,e,1,-1)}function uf(e){var t=Ut();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:no,lastRenderedState:e},t.queue=e,e=e.dispatch=Y0.bind(null,Te,e),[t.memoizedState,e]}function ro(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Te.updateQueue,t===null?(t={lastEffect:null,stores:null},Te.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function om(){return jt().memoizedState}function al(e,t,n,r){var s=Ut();Te.flags|=e,s.memoizedState=ro(1|t,n,void 0,r===void 0?null:r)}function fi(e,t,n,r){var s=jt();r=r===void 0?null:r;var o=void 0;if(Ae!==null){var l=Ae.memoizedState;if(o=l.destroy,r!==null&&yu(r,l.deps)){s.memoizedState=ro(t,n,o,r);return}}Te.flags|=e,s.memoizedState=ro(1|t,n,o,r)}function df(e,t){return al(8390656,8,e,t)}function ku(e,t){return fi(2048,8,e,t)}function lm(e,t){return fi(4,2,e,t)}function im(e,t){return fi(4,4,e,t)}function am(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cm(e,t,n){return n=n!=null?n.concat([e]):null,fi(4,4,am.bind(null,t,e),n)}function Su(){}function um(e,t){var n=jt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&yu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function dm(e,t){var n=jt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&yu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function fm(e,t,n){return fr&21?(At(n,t)||(n=vh(),Te.lanes|=n,pr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,it=!0),e.memoizedState=n)}function H0(e,t){var n=me;me=n!==0&&4>n?n:4,e(!0);var r=na.transition;na.transition={};try{e(!1),t()}finally{me=n,na.transition=r}}function pm(){return jt().memoizedState}function G0(e,t,n){var r=Fn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hm(e))mm(t,n);else if(n=Qh(e,t,n,r),n!==null){var s=nt();Ot(n,e,r,s),gm(n,t,r)}}function Y0(e,t,n){var r=Fn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hm(e))mm(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,a=o(l,n);if(s.hasEagerState=!0,s.eagerState=a,At(a,l)){var c=t.interleaved;c===null?(s.next=s,hu(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=Qh(e,t,s,r),n!==null&&(s=nt(),Ot(n,e,r,s),gm(n,t,r))}}function hm(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function mm(e,t){As=Al=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,eu(e,n)}}var Dl={readContext:Nt,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useInsertionEffect:Qe,useLayoutEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useMutableSource:Qe,useSyncExternalStore:Qe,useId:Qe,unstable_isNewReconciler:!1},K0={readContext:Nt,useCallback:function(e,t){return Ut().memoizedState=[e,t===void 0?null:t],e},useContext:Nt,useEffect:df,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,al(4194308,4,am.bind(null,t,e),n)},useLayoutEffect:function(e,t){return al(4194308,4,e,t)},useInsertionEffect:function(e,t){return al(4,2,e,t)},useMemo:function(e,t){var n=Ut();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ut();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=G0.bind(null,Te,e),[r.memoizedState,e]},useRef:function(e){var t=Ut();return e={current:e},t.memoizedState=e},useState:uf,useDebugValue:Su,useDeferredValue:function(e){return Ut().memoizedState=e},useTransition:function(){var e=uf(!1),t=e[0];return e=H0.bind(null,e[1]),Ut().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Te,s=Ut();if(je){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),Be===null)throw Error(z(349));fr&30||em(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,df(nm.bind(null,r,o,e),[e]),r.flags|=2048,ro(9,tm.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ut(),t=Be.identifierPrefix;if(je){var n=ln,r=on;n=(r&~(1<<32-Mt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=to++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=V0++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Q0={readContext:Nt,useCallback:um,useContext:Nt,useEffect:ku,useImperativeHandle:cm,useInsertionEffect:lm,useLayoutEffect:im,useMemo:dm,useReducer:ra,useRef:om,useState:function(){return ra(no)},useDebugValue:Su,useDeferredValue:function(e){var t=jt();return fm(t,Ae.memoizedState,e)},useTransition:function(){var e=ra(no)[0],t=jt().memoizedState;return[e,t]},useMutableSource:qh,useSyncExternalStore:Jh,useId:pm,unstable_isNewReconciler:!1},X0={readContext:Nt,useCallback:um,useContext:Nt,useEffect:ku,useImperativeHandle:cm,useInsertionEffect:lm,useLayoutEffect:im,useMemo:dm,useReducer:sa,useRef:om,useState:function(){return sa(no)},useDebugValue:Su,useDeferredValue:function(e){var t=jt();return Ae===null?t.memoizedState=e:fm(t,Ae.memoizedState,e)},useTransition:function(){var e=sa(no)[0],t=jt().memoizedState;return[e,t]},useMutableSource:qh,useSyncExternalStore:Jh,useId:pm,unstable_isNewReconciler:!1};function Pt(e,t){if(e&&e.defaultProps){t=Ie({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function sc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ie({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pi={isMounted:function(e){return(e=e._reactInternals)?yr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=nt(),s=Fn(e),o=un(r,s);o.payload=t,n!=null&&(o.callback=n),t=zn(e,o,s),t!==null&&(Ot(t,e,s,r),ll(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=nt(),s=Fn(e),o=un(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=zn(e,o,s),t!==null&&(Ot(t,e,s,r),ll(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=nt(),r=Fn(e),s=un(n,r);s.tag=2,t!=null&&(s.callback=t),t=zn(e,s,r),t!==null&&(Ot(t,e,r,n),ll(t,e,r))}};function ff(e,t,n,r,s,o,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,l):t.prototype&&t.prototype.isPureReactComponent?!Qs(n,r)||!Qs(s,o):!0}function vm(e,t,n){var r=!1,s=Yn,o=t.contextType;return typeof o=="object"&&o!==null?o=Nt(o):(s=ct(t)?ur:Je.current,r=t.contextTypes,o=(r=r!=null)?Jr(e,s):Yn),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=pi,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function pf(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&pi.enqueueReplaceState(t,t.state,null)}function oc(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},mu(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=Nt(o):(o=ct(t)?ur:Je.current,s.context=Jr(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(sc(e,t,o,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&pi.enqueueReplaceState(s,s.state,null),Ml(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function rs(e,t){try{var n="",r=t;do n+=Ny(r),r=r.return;while(r);var s=n}catch(o){s=`
|
|
39
|
+
Error generating stack: `+o.message+`
|
|
40
|
+
`+o.stack}return{value:e,source:t,stack:s,digest:null}}function oa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function lc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Z0=typeof WeakMap=="function"?WeakMap:Map;function xm(e,t,n){n=un(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){$l||($l=!0,gc=r),lc(e,t)},n}function ym(e,t,n){n=un(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){lc(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){lc(e,t),typeof r!="function"&&($n===null?$n=new Set([this]):$n.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function hf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Z0;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=d1.bind(null,e,t,n),t.then(e,e))}function mf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function gf(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=un(-1,1),t.tag=2,zn(n,t,1))),n.lanes|=1),e)}var q0=vn.ReactCurrentOwner,it=!1;function et(e,t,n,r){t.child=e===null?Kh(t,null,n,r):ts(t,e.child,n,r)}function vf(e,t,n,r,s){n=n.render;var o=t.ref;return Kr(t,s),r=wu(e,t,n,r,o,s),n=bu(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,mn(e,t,s)):(je&&n&&au(t),t.flags|=1,et(e,t,r,s),t.child)}function xf(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!Pu(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,wm(e,t,o,r,s)):(e=fl(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var l=o.memoizedProps;if(n=n.compare,n=n!==null?n:Qs,n(l,r)&&e.ref===t.ref)return mn(e,t,s)}return t.flags|=1,e=Bn(o,r),e.ref=t.ref,e.return=t,t.child=e}function wm(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(Qs(o,r)&&e.ref===t.ref)if(it=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(it=!0);else return t.lanes=e.lanes,mn(e,t,s)}return ic(e,t,n,r,s)}function bm(e,t,n){var r=t.pendingProps,s=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ye(Ur,pt),pt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ye(Ur,pt),pt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ye(Ur,pt),pt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ye(Ur,pt),pt|=r;return et(e,t,s,n),t.child}function km(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ic(e,t,n,r,s){var o=ct(n)?ur:Je.current;return o=Jr(t,o),Kr(t,s),n=wu(e,t,n,r,o,s),r=bu(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,mn(e,t,s)):(je&&r&&au(t),t.flags|=1,et(e,t,n,s),t.child)}function yf(e,t,n,r,s){if(ct(n)){var o=!0;Rl(t)}else o=!1;if(Kr(t,s),t.stateNode===null)cl(e,t),vm(t,n,r),oc(t,n,r,s),r=!0;else if(e===null){var l=t.stateNode,a=t.memoizedProps;l.props=a;var c=l.context,u=n.contextType;typeof u=="object"&&u!==null?u=Nt(u):(u=ct(n)?ur:Je.current,u=Jr(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof l.getSnapshotBeforeUpdate=="function";f||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==r||c!==u)&&pf(t,l,r,u),Tn=!1;var h=t.memoizedState;l.state=h,Ml(t,r,l,s),c=t.memoizedState,a!==r||h!==c||at.current||Tn?(typeof d=="function"&&(sc(t,n,d,r),c=t.memoizedState),(a=Tn||ff(t,n,a,r,h,c,u))?(f||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),l.props=r,l.state=c,l.context=u,r=a):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,Xh(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Pt(t.type,a),l.props=u,f=t.pendingProps,h=l.context,c=n.contextType,typeof c=="object"&&c!==null?c=Nt(c):(c=ct(n)?ur:Je.current,c=Jr(t,c));var y=n.getDerivedStateFromProps;(d=typeof y=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==f||h!==c)&&pf(t,l,r,c),Tn=!1,h=t.memoizedState,l.state=h,Ml(t,r,l,s);var x=t.memoizedState;a!==f||h!==x||at.current||Tn?(typeof y=="function"&&(sc(t,n,y,r),x=t.memoizedState),(u=Tn||ff(t,n,u,r,h,x,c)||!1)?(d||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,x,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,x,c)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),l.props=r,l.state=x,l.context=c,r=u):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return ac(e,t,n,r,o,s)}function ac(e,t,n,r,s,o){km(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return s&&rf(t,n,!1),mn(e,t,o);r=t.stateNode,q0.current=t;var a=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=ts(t,e.child,null,o),t.child=ts(t,null,a,o)):et(e,t,a,o),t.memoizedState=r.state,s&&rf(t,n,!0),t.child}function Sm(e){var t=e.stateNode;t.pendingContext?nf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nf(e,t.context,!1),gu(e,t.containerInfo)}function wf(e,t,n,r,s){return es(),uu(s),t.flags|=256,et(e,t,n,r),t.child}var cc={dehydrated:null,treeContext:null,retryLane:0};function uc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Nm(e,t,n){var r=t.pendingProps,s=Ee.current,o=!1,l=(t.flags&128)!==0,a;if((a=l)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),ye(Ee,s&1),e===null)return nc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,o?(r=t.mode,o=t.child,l={mode:"hidden",children:l},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=l):o=gi(l,r,0,null),e=cr(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=uc(n),t.memoizedState=cc,e):Nu(t,l));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return J0(e,t,l,r,a,s,n);if(o){o=r.fallback,l=t.mode,s=e.child,a=s.sibling;var c={mode:"hidden",children:r.children};return!(l&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Bn(s,c),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?o=Bn(a,o):(o=cr(o,l,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,l=e.child.memoizedState,l=l===null?uc(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=e.childLanes&~n,t.memoizedState=cc,r}return o=e.child,e=o.sibling,r=Bn(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Nu(e,t){return t=gi({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Uo(e,t,n,r){return r!==null&&uu(r),ts(t,e.child,null,n),e=Nu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function J0(e,t,n,r,s,o,l){if(n)return t.flags&256?(t.flags&=-257,r=oa(Error(z(422))),Uo(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=gi({mode:"visible",children:r.children},s,0,null),o=cr(o,s,l,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&ts(t,e.child,null,l),t.child.memoizedState=uc(l),t.memoizedState=cc,o);if(!(t.mode&1))return Uo(e,t,l,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(z(419)),r=oa(o,r,void 0),Uo(e,t,l,r)}if(a=(l&e.childLanes)!==0,it||a){if(r=Be,r!==null){switch(l&-l){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|l)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,hn(e,s),Ot(r,e,s,-1))}return Iu(),r=oa(Error(z(421))),Uo(e,t,l,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=f1.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,ht=Dn(s.nextSibling),mt=t,je=!0,Lt=null,e!==null&&(wt[bt++]=on,wt[bt++]=ln,wt[bt++]=dr,on=e.id,ln=e.overflow,dr=t),t=Nu(t,r.children),t.flags|=4096,t)}function bf(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),rc(e.return,t,n)}function la(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function jm(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(et(e,t,r.children,n),r=Ee.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bf(e,n,t);else if(e.tag===19)bf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ye(Ee,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Ol(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),la(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Ol(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}la(t,!0,n,null,o);break;case"together":la(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function cl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function mn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),pr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(z(153));if(t.child!==null){for(e=t.child,n=Bn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Bn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function e1(e,t,n){switch(t.tag){case 3:Sm(t),es();break;case 5:Zh(t);break;case 1:ct(t.type)&&Rl(t);break;case 4:gu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;ye(_l,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ye(Ee,Ee.current&1),t.flags|=128,null):n&t.child.childLanes?Nm(e,t,n):(ye(Ee,Ee.current&1),e=mn(e,t,n),e!==null?e.sibling:null);ye(Ee,Ee.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return jm(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ye(Ee,Ee.current),r)break;return null;case 22:case 23:return t.lanes=0,bm(e,t,n)}return mn(e,t,n)}var Cm,dc,Em,Tm;Cm=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};dc=function(){};Em=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,ir(Yt.current);var o=null;switch(n){case"input":s=La(e,s),r=La(e,r),o=[];break;case"select":s=Ie({},s,{value:void 0}),r=Ie({},r,{value:void 0}),o=[];break;case"textarea":s=Aa(e,s),r=Aa(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=El)}za(n,r);var l;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(l in a)a.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Us.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var c=r[u];if(a=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(l in a)!a.hasOwnProperty(l)||c&&c.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in c)c.hasOwnProperty(l)&&a[l]!==c[l]&&(n||(n={}),n[l]=c[l])}else n||(o||(o=[]),o.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(o=o||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(o=o||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Us.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ke("scroll",e),o||a===c||(o=[])):(o=o||[]).push(u,c))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};Tm=function(e,t,n,r){n!==r&&(t.flags|=4)};function bs(e,t){if(!je)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function t1(e,t,n){var r=t.pendingProps;switch(cu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return ct(t.type)&&Tl(),Xe(t),null;case 3:return r=t.stateNode,ns(),Se(at),Se(Je),xu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Fo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Lt!==null&&(yc(Lt),Lt=null))),dc(e,t),Xe(t),null;case 5:vu(t);var s=ir(eo.current);if(n=t.type,e!==null&&t.stateNode!=null)Em(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(z(166));return Xe(t),null}if(e=ir(Yt.current),Fo(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Wt]=t,r[qs]=o,e=(t.mode&1)!==0,n){case"dialog":ke("cancel",r),ke("close",r);break;case"iframe":case"object":case"embed":ke("load",r);break;case"video":case"audio":for(s=0;s<Is.length;s++)ke(Is[s],r);break;case"source":ke("error",r);break;case"img":case"image":case"link":ke("error",r),ke("load",r);break;case"details":ke("toggle",r);break;case"input":Rd(r,o),ke("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},ke("invalid",r);break;case"textarea":Pd(r,o),ke("invalid",r)}za(n,o),s=null;for(var l in o)if(o.hasOwnProperty(l)){var a=o[l];l==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&$o(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&$o(r.textContent,a,e),s=["children",""+a]):Us.hasOwnProperty(l)&&a!=null&&l==="onScroll"&&ke("scroll",r)}switch(n){case"input":Po(r),Id(r,o,!0);break;case"textarea":Po(r),_d(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=El)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=nh(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Wt]=t,e[qs]=r,Cm(e,t,!1,!1),t.stateNode=e;e:{switch(l=$a(n,r),n){case"dialog":ke("cancel",e),ke("close",e),s=r;break;case"iframe":case"object":case"embed":ke("load",e),s=r;break;case"video":case"audio":for(s=0;s<Is.length;s++)ke(Is[s],e);s=r;break;case"source":ke("error",e),s=r;break;case"img":case"image":case"link":ke("error",e),ke("load",e),s=r;break;case"details":ke("toggle",e),s=r;break;case"input":Rd(e,r),s=La(e,r),ke("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Ie({},r,{value:void 0}),ke("invalid",e);break;case"textarea":Pd(e,r),s=Aa(e,r),ke("invalid",e);break;default:s=r}za(n,s),a=s;for(o in a)if(a.hasOwnProperty(o)){var c=a[o];o==="style"?oh(e,c):o==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&rh(e,c)):o==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ws(e,c):typeof c=="number"&&Ws(e,""+c):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Us.hasOwnProperty(o)?c!=null&&o==="onScroll"&&ke("scroll",e):c!=null&&Kc(e,o,c,l))}switch(n){case"input":Po(e),Id(e,r,!1);break;case"textarea":Po(e),_d(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Gn(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Vr(e,!!r.multiple,o,!1):r.defaultValue!=null&&Vr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=El)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Xe(t),null;case 6:if(e&&t.stateNode!=null)Tm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(z(166));if(n=ir(eo.current),ir(Yt.current),Fo(t)){if(r=t.stateNode,n=t.memoizedProps,r[Wt]=t,(o=r.nodeValue!==n)&&(e=mt,e!==null))switch(e.tag){case 3:$o(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$o(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Wt]=t,t.stateNode=r}return Xe(t),null;case 13:if(Se(Ee),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(je&&ht!==null&&t.mode&1&&!(t.flags&128))Gh(),es(),t.flags|=98560,o=!1;else if(o=Fo(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(z(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(z(317));o[Wt]=t}else es(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Xe(t),o=!1}else Lt!==null&&(yc(Lt),Lt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ee.current&1?De===0&&(De=3):Iu())),t.updateQueue!==null&&(t.flags|=4),Xe(t),null);case 4:return ns(),dc(e,t),e===null&&Xs(t.stateNode.containerInfo),Xe(t),null;case 10:return pu(t.type._context),Xe(t),null;case 17:return ct(t.type)&&Tl(),Xe(t),null;case 19:if(Se(Ee),o=t.memoizedState,o===null)return Xe(t),null;if(r=(t.flags&128)!==0,l=o.rendering,l===null)if(r)bs(o,!1);else{if(De!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=Ol(e),l!==null){for(t.flags|=128,bs(o,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,l=o.alternate,l===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=l.childLanes,o.lanes=l.lanes,o.child=l.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=l.memoizedProps,o.memoizedState=l.memoizedState,o.updateQueue=l.updateQueue,o.type=l.type,e=l.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ye(Ee,Ee.current&1|2),t.child}e=e.sibling}o.tail!==null&&Le()>ss&&(t.flags|=128,r=!0,bs(o,!1),t.lanes=4194304)}else{if(!r)if(e=Ol(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),bs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!je)return Xe(t),null}else 2*Le()-o.renderingStartTime>ss&&n!==1073741824&&(t.flags|=128,r=!0,bs(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(n=o.last,n!==null?n.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Le(),t.sibling=null,n=Ee.current,ye(Ee,r?n&1|2:n&1),t):(Xe(t),null);case 22:case 23:return Ru(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pt&1073741824&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function n1(e,t){switch(cu(t),t.tag){case 1:return ct(t.type)&&Tl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ns(),Se(at),Se(Je),xu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vu(t),null;case 13:if(Se(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(Ee),null;case 4:return ns(),null;case 10:return pu(t.type._context),null;case 22:case 23:return Ru(),null;case 24:return null;default:return null}}var Wo=!1,Ze=!1,r1=typeof WeakSet=="function"?WeakSet:Set,Q=null;function Br(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){_e(e,t,r)}else n.current=null}function fc(e,t,n){try{n()}catch(r){_e(e,t,r)}}var kf=!1;function s1(e,t){if(Qa=Nl,e=Lh(),iu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,a=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var y;f!==n||s!==0&&f.nodeType!==3||(a=l+s),f!==o||r!==0&&f.nodeType!==3||(c=l+r),f.nodeType===3&&(l+=f.nodeValue.length),(y=f.firstChild)!==null;)h=f,f=y;for(;;){if(f===e)break t;if(h===n&&++u===s&&(a=l),h===o&&++d===r&&(c=l),(y=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=y}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xa={focusedElem:e,selectionRange:n},Nl=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var w=x.memoizedProps,b=x.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?w:Pt(t.type,w),b);m.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(k){_e(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return x=kf,kf=!1,x}function Ds(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&fc(t,n,o)}s=s.next}while(s!==r)}}function hi(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function pc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Rm(e){var t=e.alternate;t!==null&&(e.alternate=null,Rm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wt],delete t[qs],delete t[Ja],delete t[F0],delete t[B0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Im(e){return e.tag===5||e.tag===3||e.tag===4}function Sf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Im(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function hc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=El));else if(r!==4&&(e=e.child,e!==null))for(hc(e,t,n),e=e.sibling;e!==null;)hc(e,t,n),e=e.sibling}function mc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(mc(e,t,n),e=e.sibling;e!==null;)mc(e,t,n),e=e.sibling}var We=null,_t=!1;function Sn(e,t,n){for(n=n.child;n!==null;)Pm(e,t,n),n=n.sibling}function Pm(e,t,n){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(li,n)}catch{}switch(n.tag){case 5:Ze||Br(n,t);case 6:var r=We,s=_t;We=null,Sn(e,t,n),We=r,_t=s,We!==null&&(_t?(e=We,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):We.removeChild(n.stateNode));break;case 18:We!==null&&(_t?(e=We,n=n.stateNode,e.nodeType===8?Ji(e.parentNode,n):e.nodeType===1&&Ji(e,n),Ys(e)):Ji(We,n.stateNode));break;case 4:r=We,s=_t,We=n.stateNode.containerInfo,_t=!0,Sn(e,t,n),We=r,_t=s;break;case 0:case 11:case 14:case 15:if(!Ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&fc(n,t,l),s=s.next}while(s!==r)}Sn(e,t,n);break;case 1:if(!Ze&&(Br(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){_e(n,t,a)}Sn(e,t,n);break;case 21:Sn(e,t,n);break;case 22:n.mode&1?(Ze=(r=Ze)||n.memoizedState!==null,Sn(e,t,n),Ze=r):Sn(e,t,n);break;default:Sn(e,t,n)}}function Nf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new r1),t.forEach(function(r){var s=p1.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function It(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var o=e,l=t,a=l;e:for(;a!==null;){switch(a.tag){case 5:We=a.stateNode,_t=!1;break e;case 3:We=a.stateNode.containerInfo,_t=!0;break e;case 4:We=a.stateNode.containerInfo,_t=!0;break e}a=a.return}if(We===null)throw Error(z(160));Pm(o,l,s),We=null,_t=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){_e(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)_m(t,e),t=t.sibling}function _m(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(It(t,e),$t(e),r&4){try{Ds(3,e,e.return),hi(3,e)}catch(w){_e(e,e.return,w)}try{Ds(5,e,e.return)}catch(w){_e(e,e.return,w)}}break;case 1:It(t,e),$t(e),r&512&&n!==null&&Br(n,n.return);break;case 5:if(It(t,e),$t(e),r&512&&n!==null&&Br(n,n.return),e.flags&32){var s=e.stateNode;try{Ws(s,"")}catch(w){_e(e,e.return,w)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,l=n!==null?n.memoizedProps:o,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&eh(s,o),$a(a,l);var u=$a(a,o);for(l=0;l<c.length;l+=2){var d=c[l],f=c[l+1];d==="style"?oh(s,f):d==="dangerouslySetInnerHTML"?rh(s,f):d==="children"?Ws(s,f):Kc(s,d,f,u)}switch(a){case"input":Ma(s,o);break;case"textarea":th(s,o);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var y=o.value;y!=null?Vr(s,!!o.multiple,y,!1):h!==!!o.multiple&&(o.defaultValue!=null?Vr(s,!!o.multiple,o.defaultValue,!0):Vr(s,!!o.multiple,o.multiple?[]:"",!1))}s[qs]=o}catch(w){_e(e,e.return,w)}}break;case 6:if(It(t,e),$t(e),r&4){if(e.stateNode===null)throw Error(z(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(w){_e(e,e.return,w)}}break;case 3:if(It(t,e),$t(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ys(t.containerInfo)}catch(w){_e(e,e.return,w)}break;case 4:It(t,e),$t(e);break;case 13:It(t,e),$t(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Eu=Le())),r&4&&Nf(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Ze=(u=Ze)||d,It(t,e),Ze=u):It(t,e),$t(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Q=e,d=e.child;d!==null;){for(f=Q=d;Q!==null;){switch(h=Q,y=h.child,h.tag){case 0:case 11:case 14:case 15:Ds(4,h,h.return);break;case 1:Br(h,h.return);var x=h.stateNode;if(typeof x.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(w){_e(r,n,w)}}break;case 5:Br(h,h.return);break;case 22:if(h.memoizedState!==null){Cf(f);continue}}y!==null?(y.return=h,Q=y):Cf(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{s=f.stateNode,u?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=f.stateNode,c=f.memoizedProps.style,l=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=sh("display",l))}catch(w){_e(e,e.return,w)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(w){_e(e,e.return,w)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:It(t,e),$t(e),r&4&&Nf(e);break;case 21:break;default:It(t,e),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Im(n)){var r=n;break e}n=n.return}throw Error(z(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Ws(s,""),r.flags&=-33);var o=Sf(e);mc(e,o,s);break;case 3:case 4:var l=r.stateNode.containerInfo,a=Sf(e);hc(e,a,l);break;default:throw Error(z(161))}}catch(c){_e(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function o1(e,t,n){Q=e,Lm(e)}function Lm(e,t,n){for(var r=(e.mode&1)!==0;Q!==null;){var s=Q,o=s.child;if(s.tag===22&&r){var l=s.memoizedState!==null||Wo;if(!l){var a=s.alternate,c=a!==null&&a.memoizedState!==null||Ze;a=Wo;var u=Ze;if(Wo=l,(Ze=c)&&!u)for(Q=s;Q!==null;)l=Q,c=l.child,l.tag===22&&l.memoizedState!==null?Ef(s):c!==null?(c.return=l,Q=c):Ef(s);for(;o!==null;)Q=o,Lm(o),o=o.sibling;Q=s,Wo=a,Ze=u}jf(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,Q=o):jf(e)}}function jf(e){for(;Q!==null;){var t=Q;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ze||hi(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ze)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Pt(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&cf(t,o,r);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}cf(t,l,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Ys(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(z(163))}Ze||t.flags&512&&pc(t)}catch(h){_e(t,t.return,h)}}if(t===e){Q=null;break}if(n=t.sibling,n!==null){n.return=t.return,Q=n;break}Q=t.return}}function Cf(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Q=n;break}Q=t.return}}function Ef(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{hi(4,t)}catch(c){_e(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){_e(t,s,c)}}var o=t.return;try{pc(t)}catch(c){_e(t,o,c)}break;case 5:var l=t.return;try{pc(t)}catch(c){_e(t,l,c)}}}catch(c){_e(t,t.return,c)}if(t===e){Q=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Q=a;break}Q=t.return}}var l1=Math.ceil,zl=vn.ReactCurrentDispatcher,ju=vn.ReactCurrentOwner,St=vn.ReactCurrentBatchConfig,de=0,Be=null,Me=null,Ve=0,pt=0,Ur=Jn(0),De=0,so=null,pr=0,mi=0,Cu=0,zs=null,lt=null,Eu=0,ss=1/0,rn=null,$l=!1,gc=null,$n=null,Vo=!1,_n=null,Fl=0,$s=0,vc=null,ul=-1,dl=0;function nt(){return de&6?Le():ul!==-1?ul:ul=Le()}function Fn(e){return e.mode&1?de&2&&Ve!==0?Ve&-Ve:W0.transition!==null?(dl===0&&(dl=vh()),dl):(e=me,e!==0||(e=window.event,e=e===void 0?16:Nh(e.type)),e):1}function Ot(e,t,n,r){if(50<$s)throw $s=0,vc=null,Error(z(185));po(e,n,r),(!(de&2)||e!==Be)&&(e===Be&&(!(de&2)&&(mi|=n),De===4&&In(e,Ve)),ut(e,r),n===1&&de===0&&!(t.mode&1)&&(ss=Le()+500,di&&er()))}function ut(e,t){var n=e.callbackNode;Wy(e,t);var r=Sl(e,e===Be?Ve:0);if(r===0)n!==null&&Od(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Od(n),t===1)e.tag===0?U0(Tf.bind(null,e)):Wh(Tf.bind(null,e)),z0(function(){!(de&6)&&er()}),n=null;else{switch(xh(r)){case 1:n=Jc;break;case 4:n=mh;break;case 16:n=kl;break;case 536870912:n=gh;break;default:n=kl}n=Bm(n,Mm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Mm(e,t){if(ul=-1,dl=0,de&6)throw Error(z(327));var n=e.callbackNode;if(Qr()&&e.callbackNode!==n)return null;var r=Sl(e,e===Be?Ve:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Bl(e,r);else{t=r;var s=de;de|=2;var o=Am();(Be!==e||Ve!==t)&&(rn=null,ss=Le()+500,ar(e,t));do try{c1();break}catch(a){Om(e,a)}while(!0);fu(),zl.current=o,de=s,Me!==null?t=0:(Be=null,Ve=0,t=De)}if(t!==0){if(t===2&&(s=Va(e),s!==0&&(r=s,t=xc(e,s))),t===1)throw n=so,ar(e,0),In(e,r),ut(e,Le()),n;if(t===6)In(e,r);else{if(s=e.current.alternate,!(r&30)&&!i1(s)&&(t=Bl(e,r),t===2&&(o=Va(e),o!==0&&(r=o,t=xc(e,o))),t===1))throw n=so,ar(e,0),In(e,r),ut(e,Le()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(z(345));case 2:sr(e,lt,rn);break;case 3:if(In(e,r),(r&130023424)===r&&(t=Eu+500-Le(),10<t)){if(Sl(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){nt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=qa(sr.bind(null,e,lt,rn),t);break}sr(e,lt,rn);break;case 4:if(In(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var l=31-Mt(r);o=1<<l,l=t[l],l>s&&(s=l),r&=~o}if(r=s,r=Le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*l1(r/1960))-r,10<r){e.timeoutHandle=qa(sr.bind(null,e,lt,rn),r);break}sr(e,lt,rn);break;case 5:sr(e,lt,rn);break;default:throw Error(z(329))}}}return ut(e,Le()),e.callbackNode===n?Mm.bind(null,e):null}function xc(e,t){var n=zs;return e.current.memoizedState.isDehydrated&&(ar(e,t).flags|=256),e=Bl(e,t),e!==2&&(t=lt,lt=n,t!==null&&yc(t)),e}function yc(e){lt===null?lt=e:lt.push.apply(lt,e)}function i1(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],o=s.getSnapshot;s=s.value;try{if(!At(o(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function In(e,t){for(t&=~Cu,t&=~mi,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Mt(t),r=1<<n;e[n]=-1,t&=~r}}function Tf(e){if(de&6)throw Error(z(327));Qr();var t=Sl(e,0);if(!(t&1))return ut(e,Le()),null;var n=Bl(e,t);if(e.tag!==0&&n===2){var r=Va(e);r!==0&&(t=r,n=xc(e,r))}if(n===1)throw n=so,ar(e,0),In(e,t),ut(e,Le()),n;if(n===6)throw Error(z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,sr(e,lt,rn),ut(e,Le()),null}function Tu(e,t){var n=de;de|=1;try{return e(t)}finally{de=n,de===0&&(ss=Le()+500,di&&er())}}function hr(e){_n!==null&&_n.tag===0&&!(de&6)&&Qr();var t=de;de|=1;var n=St.transition,r=me;try{if(St.transition=null,me=1,e)return e()}finally{me=r,St.transition=n,de=t,!(de&6)&&er()}}function Ru(){pt=Ur.current,Se(Ur)}function ar(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,D0(n)),Me!==null)for(n=Me.return;n!==null;){var r=n;switch(cu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Tl();break;case 3:ns(),Se(at),Se(Je),xu();break;case 5:vu(r);break;case 4:ns();break;case 13:Se(Ee);break;case 19:Se(Ee);break;case 10:pu(r.type._context);break;case 22:case 23:Ru()}n=n.return}if(Be=e,Me=e=Bn(e.current,null),Ve=pt=t,De=0,so=null,Cu=mi=pr=0,lt=zs=null,lr!==null){for(t=0;t<lr.length;t++)if(n=lr[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,o=n.pending;if(o!==null){var l=o.next;o.next=s,r.next=l}n.pending=r}lr=null}return e}function Om(e,t){do{var n=Me;try{if(fu(),il.current=Dl,Al){for(var r=Te.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Al=!1}if(fr=0,Fe=Ae=Te=null,As=!1,to=0,ju.current=null,n===null||n.return===null){De=1,so=t,Me=null;break}e:{var o=e,l=n.return,a=n,c=t;if(t=Ve,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var y=mf(l);if(y!==null){y.flags&=-257,gf(y,l,a,o,t),y.mode&1&&hf(o,u,t),t=y,c=u;var x=t.updateQueue;if(x===null){var w=new Set;w.add(c),t.updateQueue=w}else x.add(c);break e}else{if(!(t&1)){hf(o,u,t),Iu();break e}c=Error(z(426))}}else if(je&&a.mode&1){var b=mf(l);if(b!==null){!(b.flags&65536)&&(b.flags|=256),gf(b,l,a,o,t),uu(rs(c,a));break e}}o=c=rs(c,a),De!==4&&(De=2),zs===null?zs=[o]:zs.push(o),o=l;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var m=xm(o,c,t);af(o,m);break e;case 1:a=c;var v=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof v.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&($n===null||!$n.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var k=ym(o,a,t);af(o,k);break e}}o=o.return}while(o!==null)}zm(n)}catch(j){t=j,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(!0)}function Am(){var e=zl.current;return zl.current=Dl,e===null?Dl:e}function Iu(){(De===0||De===3||De===2)&&(De=4),Be===null||!(pr&268435455)&&!(mi&268435455)||In(Be,Ve)}function Bl(e,t){var n=de;de|=2;var r=Am();(Be!==e||Ve!==t)&&(rn=null,ar(e,t));do try{a1();break}catch(s){Om(e,s)}while(!0);if(fu(),de=n,zl.current=r,Me!==null)throw Error(z(261));return Be=null,Ve=0,De}function a1(){for(;Me!==null;)Dm(Me)}function c1(){for(;Me!==null&&!My();)Dm(Me)}function Dm(e){var t=Fm(e.alternate,e,pt);e.memoizedProps=e.pendingProps,t===null?zm(e):Me=t,ju.current=null}function zm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=n1(n,t),n!==null){n.flags&=32767,Me=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{De=6,Me=null;return}}else if(n=t1(n,t,pt),n!==null){Me=n;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);De===0&&(De=5)}function sr(e,t,n){var r=me,s=St.transition;try{St.transition=null,me=1,u1(e,t,n,r)}finally{St.transition=s,me=r}return null}function u1(e,t,n,r){do Qr();while(_n!==null);if(de&6)throw Error(z(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(z(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Vy(e,o),e===Be&&(Me=Be=null,Ve=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Vo||(Vo=!0,Bm(kl,function(){return Qr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=St.transition,St.transition=null;var l=me;me=1;var a=de;de|=4,ju.current=null,s1(e,n),_m(n,e),I0(Xa),Nl=!!Qa,Xa=Qa=null,e.current=n,o1(n),Oy(),de=a,me=l,St.transition=o}else e.current=n;if(Vo&&(Vo=!1,_n=e,Fl=s),o=e.pendingLanes,o===0&&($n=null),zy(n.stateNode),ut(e,Le()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if($l)throw $l=!1,e=gc,gc=null,e;return Fl&1&&e.tag!==0&&Qr(),o=e.pendingLanes,o&1?e===vc?$s++:($s=0,vc=e):$s=0,er(),null}function Qr(){if(_n!==null){var e=xh(Fl),t=St.transition,n=me;try{if(St.transition=null,me=16>e?16:e,_n===null)var r=!1;else{if(e=_n,_n=null,Fl=0,de&6)throw Error(z(331));var s=de;for(de|=4,Q=e.current;Q!==null;){var o=Q,l=o.child;if(Q.flags&16){var a=o.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(Q=u;Q!==null;){var d=Q;switch(d.tag){case 0:case 11:case 15:Ds(8,d,o)}var f=d.child;if(f!==null)f.return=d,Q=f;else for(;Q!==null;){d=Q;var h=d.sibling,y=d.return;if(Rm(d),d===u){Q=null;break}if(h!==null){h.return=y,Q=h;break}Q=y}}}var x=o.alternate;if(x!==null){var w=x.child;if(w!==null){x.child=null;do{var b=w.sibling;w.sibling=null,w=b}while(w!==null)}}Q=o}}if(o.subtreeFlags&2064&&l!==null)l.return=o,Q=l;else e:for(;Q!==null;){if(o=Q,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ds(9,o,o.return)}var m=o.sibling;if(m!==null){m.return=o.return,Q=m;break e}Q=o.return}}var v=e.current;for(Q=v;Q!==null;){l=Q;var g=l.child;if(l.subtreeFlags&2064&&g!==null)g.return=l,Q=g;else e:for(l=v;Q!==null;){if(a=Q,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:hi(9,a)}}catch(j){_e(a,a.return,j)}if(a===l){Q=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,Q=k;break e}Q=a.return}}if(de=s,er(),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(li,e)}catch{}r=!0}return r}finally{me=n,St.transition=t}}return!1}function Rf(e,t,n){t=rs(n,t),t=xm(e,t,1),e=zn(e,t,1),t=nt(),e!==null&&(po(e,1,t),ut(e,t))}function _e(e,t,n){if(e.tag===3)Rf(e,e,n);else for(;t!==null;){if(t.tag===3){Rf(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&($n===null||!$n.has(r))){e=rs(n,e),e=ym(t,e,1),t=zn(t,e,1),e=nt(),t!==null&&(po(t,1,e),ut(t,e));break}}t=t.return}}function d1(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=nt(),e.pingedLanes|=e.suspendedLanes&n,Be===e&&(Ve&n)===n&&(De===4||De===3&&(Ve&130023424)===Ve&&500>Le()-Eu?ar(e,0):Cu|=n),ut(e,t)}function $m(e,t){t===0&&(e.mode&1?(t=Mo,Mo<<=1,!(Mo&130023424)&&(Mo=4194304)):t=1);var n=nt();e=hn(e,t),e!==null&&(po(e,t,n),ut(e,n))}function f1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$m(e,n)}function p1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),$m(e,n)}var Fm;Fm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||at.current)it=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return it=!1,e1(e,t,n);it=!!(e.flags&131072)}else it=!1,je&&t.flags&1048576&&Vh(t,Pl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;cl(e,t),e=t.pendingProps;var s=Jr(t,Je.current);Kr(t,n),s=wu(null,t,r,e,s,n);var o=bu();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ct(r)?(o=!0,Rl(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,mu(t),s.updater=pi,t.stateNode=s,s._reactInternals=t,oc(t,r,e,n),t=ac(null,t,r,!0,o,n)):(t.tag=0,je&&o&&au(t),et(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(cl(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=m1(r),e=Pt(r,e),s){case 0:t=ic(null,t,r,e,n);break e;case 1:t=yf(null,t,r,e,n);break e;case 11:t=vf(null,t,r,e,n);break e;case 14:t=xf(null,t,r,Pt(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Pt(r,s),ic(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Pt(r,s),yf(e,t,r,s,n);case 3:e:{if(Sm(t),e===null)throw Error(z(387));r=t.pendingProps,o=t.memoizedState,s=o.element,Xh(e,t),Ml(t,r,null,n);var l=t.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=rs(Error(z(423)),t),t=wf(e,t,r,n,s);break e}else if(r!==s){s=rs(Error(z(424)),t),t=wf(e,t,r,n,s);break e}else for(ht=Dn(t.stateNode.containerInfo.firstChild),mt=t,je=!0,Lt=null,n=Kh(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(es(),r===s){t=mn(e,t,n);break e}et(e,t,r,n)}t=t.child}return t;case 5:return Zh(t),e===null&&nc(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,l=s.children,Za(r,s)?l=null:o!==null&&Za(r,o)&&(t.flags|=32),km(e,t),et(e,t,l,n),t.child;case 6:return e===null&&nc(t),null;case 13:return Nm(e,t,n);case 4:return gu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ts(t,null,r,n):et(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Pt(r,s),vf(e,t,r,s,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,l=s.value,ye(_l,r._currentValue),r._currentValue=l,o!==null)if(At(o.value,l)){if(o.children===s.children&&!at.current){t=mn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){l=o.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(o.tag===1){c=un(-1,n&-n),c.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),rc(o.return,n,t),a.lanes|=n;break}c=c.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(z(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),rc(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}et(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Kr(t,n),s=Nt(s),r=r(s),t.flags|=1,et(e,t,r,n),t.child;case 14:return r=t.type,s=Pt(r,t.pendingProps),s=Pt(r.type,s),xf(e,t,r,s,n);case 15:return wm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Pt(r,s),cl(e,t),t.tag=1,ct(r)?(e=!0,Rl(t)):e=!1,Kr(t,n),vm(t,r,s),oc(t,r,s,n),ac(null,t,r,!0,e,n);case 19:return jm(e,t,n);case 22:return bm(e,t,n)}throw Error(z(156,t.tag))};function Bm(e,t){return hh(e,t)}function h1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kt(e,t,n,r){return new h1(e,t,n,r)}function Pu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function m1(e){if(typeof e=="function")return Pu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Xc)return 11;if(e===Zc)return 14}return 2}function Bn(e,t){var n=e.alternate;return n===null?(n=kt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function fl(e,t,n,r,s,o){var l=2;if(r=e,typeof e=="function")Pu(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case _r:return cr(n.children,s,o,t);case Qc:l=8,s|=8;break;case Ra:return e=kt(12,n,t,s|2),e.elementType=Ra,e.lanes=o,e;case Ia:return e=kt(13,n,t,s),e.elementType=Ia,e.lanes=o,e;case Pa:return e=kt(19,n,t,s),e.elementType=Pa,e.lanes=o,e;case Zp:return gi(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qp:l=10;break e;case Xp:l=9;break e;case Xc:l=11;break e;case Zc:l=14;break e;case En:l=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=kt(l,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function cr(e,t,n,r){return e=kt(7,e,r,t),e.lanes=n,e}function gi(e,t,n,r){return e=kt(22,e,r,t),e.elementType=Zp,e.lanes=n,e.stateNode={isHidden:!1},e}function ia(e,t,n){return e=kt(6,e,null,t),e.lanes=n,e}function aa(e,t,n){return t=kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function g1(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ui(0),this.expirationTimes=Ui(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ui(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function _u(e,t,n,r,s,o,l,a,c){return e=new g1(e,t,n,a,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=kt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},mu(o),e}function v1(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Pr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Um(e){if(!e)return Yn;e=e._reactInternals;e:{if(yr(e)!==e||e.tag!==1)throw Error(z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ct(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(z(171))}if(e.tag===1){var n=e.type;if(ct(n))return Uh(e,n,t)}return t}function Wm(e,t,n,r,s,o,l,a,c){return e=_u(n,r,!0,e,s,o,l,a,c),e.context=Um(null),n=e.current,r=nt(),s=Fn(n),o=un(r,s),o.callback=t??null,zn(n,o,s),e.current.lanes=s,po(e,s,r),ut(e,r),e}function vi(e,t,n,r){var s=t.current,o=nt(),l=Fn(s);return n=Um(n),t.context===null?t.context=n:t.pendingContext=n,t=un(o,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=zn(s,t,l),e!==null&&(Ot(e,s,l,o),ll(e,s,l)),l}function Ul(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function If(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Lu(e,t){If(e,t),(e=e.alternate)&&If(e,t)}function x1(){return null}var Vm=typeof reportError=="function"?reportError:function(e){console.error(e)};function Mu(e){this._internalRoot=e}xi.prototype.render=Mu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(z(409));vi(e,t,null,null)};xi.prototype.unmount=Mu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hr(function(){vi(null,e,null,null)}),t[pn]=null}};function xi(e){this._internalRoot=e}xi.prototype.unstable_scheduleHydration=function(e){if(e){var t=bh();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rn.length&&t!==0&&t<Rn[n].priority;n++);Rn.splice(n,0,e),n===0&&Sh(e)}};function Ou(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function yi(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Pf(){}function y1(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var u=Ul(l);o.call(u)}}var l=Wm(t,r,e,0,null,!1,!1,"",Pf);return e._reactRootContainer=l,e[pn]=l.current,Xs(e.nodeType===8?e.parentNode:e),hr(),l}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var u=Ul(c);a.call(u)}}var c=_u(e,0,!1,null,null,!1,!1,"",Pf);return e._reactRootContainer=c,e[pn]=c.current,Xs(e.nodeType===8?e.parentNode:e),hr(function(){vi(t,c,n,r)}),c}function wi(e,t,n,r,s){var o=n._reactRootContainer;if(o){var l=o;if(typeof s=="function"){var a=s;s=function(){var c=Ul(l);a.call(c)}}vi(t,l,e,s)}else l=y1(n,t,e,s,r);return Ul(l)}yh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Rs(t.pendingLanes);n!==0&&(eu(t,n|1),ut(t,Le()),!(de&6)&&(ss=Le()+500,er()))}break;case 13:hr(function(){var r=hn(e,1);if(r!==null){var s=nt();Ot(r,e,1,s)}}),Lu(e,1)}};tu=function(e){if(e.tag===13){var t=hn(e,134217728);if(t!==null){var n=nt();Ot(t,e,134217728,n)}Lu(e,134217728)}};wh=function(e){if(e.tag===13){var t=Fn(e),n=hn(e,t);if(n!==null){var r=nt();Ot(n,e,t,r)}Lu(e,t)}};bh=function(){return me};kh=function(e,t){var n=me;try{return me=e,t()}finally{me=n}};Ba=function(e,t,n){switch(t){case"input":if(Ma(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=ui(r);if(!s)throw Error(z(90));Jp(r),Ma(r,s)}}}break;case"textarea":th(e,n);break;case"select":t=n.value,t!=null&&Vr(e,!!n.multiple,t,!1)}};ah=Tu;ch=hr;var w1={usingClientEntryPoint:!1,Events:[mo,Ar,ui,lh,ih,Tu]},ks={findFiberByHostInstance:or,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},b1={bundleType:ks.bundleType,version:ks.version,rendererPackageName:ks.rendererPackageName,rendererConfig:ks.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:vn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=fh(e),e===null?null:e.stateNode},findFiberByHostInstance:ks.findFiberByHostInstance||x1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ho=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ho.isDisabled&&Ho.supportsFiber)try{li=Ho.inject(b1),Gt=Ho}catch{}}vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=w1;vt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ou(t))throw Error(z(200));return v1(e,t,null,n)};vt.createRoot=function(e,t){if(!Ou(e))throw Error(z(299));var n=!1,r="",s=Vm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=_u(e,1,!1,null,null,n,!1,r,s),e[pn]=t.current,Xs(e.nodeType===8?e.parentNode:e),new Mu(t)};vt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(z(188)):(e=Object.keys(e).join(","),Error(z(268,e)));return e=fh(t),e=e===null?null:e.stateNode,e};vt.flushSync=function(e){return hr(e)};vt.hydrate=function(e,t,n){if(!yi(t))throw Error(z(200));return wi(null,e,t,!0,n)};vt.hydrateRoot=function(e,t,n){if(!Ou(e))throw Error(z(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",l=Vm;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=Wm(t,null,e,1,n??null,s,!1,o,l),e[pn]=t.current,Xs(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new xi(t)};vt.render=function(e,t,n){if(!yi(t))throw Error(z(200));return wi(null,e,t,!1,n)};vt.unmountComponentAtNode=function(e){if(!yi(e))throw Error(z(40));return e._reactRootContainer?(hr(function(){wi(null,null,e,!1,function(){e._reactRootContainer=null,e[pn]=null})}),!0):!1};vt.unstable_batchedUpdates=Tu;vt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!yi(n))throw Error(z(200));if(e==null||e._reactInternals===void 0)throw Error(z(38));return wi(e,t,n,!1,r)};vt.version="18.3.1-next-f1338f8080-20240426";function Hm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Hm)}catch(e){console.error(e)}}Hm(),Hp.exports=vt;var Au=Hp.exports;const Gm=Lp(Au);var _f=Au;Ea.createRoot=_f.createRoot,Ea.hydrateRoot=_f.hydrateRoot;/**
|
|
41
|
+
* @remix-run/router v1.23.2
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/function oo(){return oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oo.apply(this,arguments)}var Ln;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ln||(Ln={}));const Lf="popstate";function k1(e){e===void 0&&(e={});function t(r,s){let{pathname:o,search:l,hash:a}=r.location;return wc("",{pathname:o,search:l,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Wl(s)}return N1(t,n,null,e)}function Re(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Du(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function S1(){return Math.random().toString(36).substr(2,8)}function Mf(e,t){return{usr:e.state,key:e.key,idx:t}}function wc(e,t,n,r){return n===void 0&&(n=null),oo({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?us(t):t,{state:n,key:t&&t.key||r||S1()})}function Wl(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function us(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function N1(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:o=!1}=r,l=s.history,a=Ln.Pop,c=null,u=d();u==null&&(u=0,l.replaceState(oo({},l.state,{idx:u}),""));function d(){return(l.state||{idx:null}).idx}function f(){a=Ln.Pop;let b=d(),m=b==null?null:b-u;u=b,c&&c({action:a,location:w.location,delta:m})}function h(b,m){a=Ln.Push;let v=wc(w.location,b,m);u=d()+1;let g=Mf(v,u),k=w.createHref(v);try{l.pushState(g,"",k)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;s.location.assign(k)}o&&c&&c({action:a,location:w.location,delta:1})}function y(b,m){a=Ln.Replace;let v=wc(w.location,b,m);u=d();let g=Mf(v,u),k=w.createHref(v);l.replaceState(g,"",k),o&&c&&c({action:a,location:w.location,delta:0})}function x(b){let m=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof b=="string"?b:Wl(b);return v=v.replace(/ $/,"%20"),Re(m,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,m)}let w={get action(){return a},get location(){return e(s,l)},listen(b){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Lf,f),c=b,()=>{s.removeEventListener(Lf,f),c=null}},createHref(b){return t(s,b)},createURL:x,encodeLocation(b){let m=x(b);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:h,replace:y,go(b){return l.go(b)}};return w}var Of;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Of||(Of={}));function j1(e,t,n){return n===void 0&&(n="/"),C1(e,t,n)}function C1(e,t,n,r){let s=typeof t=="string"?us(t):t,o=os(s.pathname||"/",n);if(o==null)return null;let l=Ym(e);E1(l);let a=null;for(let c=0;a==null&&c<l.length;++c){let u=z1(o);a=A1(l[c],u)}return a}function Ym(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(o,l,a)=>{let c={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};c.relativePath.startsWith("/")&&(Re(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Un([r,c.relativePath]),d=n.concat(c);o.children&&o.children.length>0&&(Re(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Ym(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:M1(u,o.index),routesMeta:d})};return e.forEach((o,l)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))s(o,l);else for(let c of Km(o.path))s(o,l,c)}),t}function Km(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let l=Km(r.join("/")),a=[];return a.push(...l.map(c=>c===""?o:[o,c].join("/"))),s&&a.push(...l),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function E1(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:O1(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const T1=/^:[\w-]+$/,R1=3,I1=2,P1=1,_1=10,L1=-2,Af=e=>e==="*";function M1(e,t){let n=e.split("/"),r=n.length;return n.some(Af)&&(r+=L1),t&&(r+=I1),n.filter(s=>!Af(s)).reduce((s,o)=>s+(T1.test(o)?R1:o===""?P1:_1),r)}function O1(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function A1(e,t,n){let{routesMeta:r}=e,s={},o="/",l=[];for(let a=0;a<r.length;++a){let c=r[a],u=a===r.length-1,d=o==="/"?t:t.slice(o.length)||"/",f=Vl({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f)return null;Object.assign(s,f.params),l.push({params:s,pathname:Un([o,f.pathname]),pathnameBase:W1(Un([o,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(o=Un([o,f.pathnameBase]))}return l}function Vl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=D1(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],l=o.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:y}=d;if(h==="*"){let w=a[f]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const x=a[f];return y&&!x?u[h]=void 0:u[h]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function D1(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Du(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function z1(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Du(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function os(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const $1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,F1=e=>$1.test(e);function B1(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?us(e):e,o;if(n)if(F1(n))o=n;else{if(n.includes("//")){let l=n;n=n.replace(/\/\/+/g,"/"),Du(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+n))}n.startsWith("/")?o=Df(n.substring(1),"/"):o=Df(n,t)}else o=t;return{pathname:o,search:V1(r),hash:H1(s)}}function Df(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function ca(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function U1(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function zu(e,t){let n=U1(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function $u(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=us(e):(s=oo({},e),Re(!s.pathname||!s.pathname.includes("?"),ca("?","pathname","search",s)),Re(!s.pathname||!s.pathname.includes("#"),ca("#","pathname","hash",s)),Re(!s.search||!s.search.includes("#"),ca("#","search","hash",s)));let o=e===""||s.pathname==="",l=o?"/":s.pathname,a;if(l==null)a=n;else{let f=t.length-1;if(!r&&l.startsWith("..")){let h=l.split("/");for(;h[0]==="..";)h.shift(),f-=1;s.pathname=h.join("/")}a=f>=0?t[f]:"/"}let c=B1(s,a),u=l&&l!=="/"&&l.endsWith("/"),d=(o||l===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Un=e=>e.join("/").replace(/\/\/+/g,"/"),W1=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),V1=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,H1=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function G1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Qm=["post","put","patch","delete"];new Set(Qm);const Y1=["get",...Qm];new Set(Y1);/**
|
|
50
|
+
* React Router v6.30.3
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lo.apply(this,arguments)}const bi=p.createContext(null),Xm=p.createContext(null),xn=p.createContext(null),ki=p.createContext(null),Zt=p.createContext({outlet:null,matches:[],isDataRoute:!1}),Zm=p.createContext(null);function K1(e,t){let{relative:n}=t===void 0?{}:t;ds()||Re(!1);let{basename:r,navigator:s}=p.useContext(xn),{hash:o,pathname:l,search:a}=Si(e,{relative:n}),c=l;return r!=="/"&&(c=l==="/"?r:Un([r,l])),s.createHref({pathname:c,search:a,hash:o})}function ds(){return p.useContext(ki)!=null}function qt(){return ds()||Re(!1),p.useContext(ki).location}function qm(e){p.useContext(xn).static||p.useLayoutEffect(e)}function yn(){let{isDataRoute:e}=p.useContext(Zt);return e?cw():Q1()}function Q1(){ds()||Re(!1);let e=p.useContext(bi),{basename:t,future:n,navigator:r}=p.useContext(xn),{matches:s}=p.useContext(Zt),{pathname:o}=qt(),l=JSON.stringify(zu(s,n.v7_relativeSplatPath)),a=p.useRef(!1);return qm(()=>{a.current=!0}),p.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let f=$u(u,JSON.parse(l),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Un([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,l,o,e])}const X1=p.createContext(null);function Z1(e){let t=p.useContext(Zt).outlet;return t&&p.createElement(X1.Provider,{value:e},t)}function fs(){let{matches:e}=p.useContext(Zt),t=e[e.length-1];return t?t.params:{}}function Si(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=p.useContext(xn),{matches:s}=p.useContext(Zt),{pathname:o}=qt(),l=JSON.stringify(zu(s,r.v7_relativeSplatPath));return p.useMemo(()=>$u(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function q1(e,t){return J1(e,t)}function J1(e,t,n,r){ds()||Re(!1);let{navigator:s}=p.useContext(xn),{matches:o}=p.useContext(Zt),l=o[o.length-1],a=l?l.params:{};l&&l.pathname;let c=l?l.pathnameBase:"/";l&&l.route;let u=qt(),d;if(t){var f;let b=typeof t=="string"?us(t):t;c==="/"||(f=b.pathname)!=null&&f.startsWith(c)||Re(!1),d=b}else d=u;let h=d.pathname||"/",y=h;if(c!=="/"){let b=c.replace(/^\//,"").split("/");y="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let x=j1(e,{pathname:y}),w=sw(x&&x.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:Un([c,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Un([c,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),o,n,r);return t&&w?p.createElement(ki.Provider,{value:{location:lo({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Ln.Pop}},w):w}function ew(){let e=aw(),t=G1(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:s},n):null,null)}const tw=p.createElement(ew,null);class nw extends p.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?p.createElement(Zt.Provider,{value:this.props.routeContext},p.createElement(Zm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function rw(e){let{routeContext:t,match:n,children:r}=e,s=p.useContext(bi);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(Zt.Provider,{value:t},r)}function sw(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=l.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||Re(!1),l=l.slice(0,Math.min(l.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<l.length;d++){let f=l[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:y}=n,x=f.route.loader&&h[f.route.id]===void 0&&(!y||y[f.route.id]===void 0);if(f.route.lazy||x){c=!0,u>=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((d,f,h)=>{let y,x=!1,w=null,b=null;n&&(y=a&&f.route.id?a[f.route.id]:void 0,w=f.route.errorElement||tw,c&&(u<0&&h===0?(uw("route-fallback"),x=!0,b=null):u===h&&(x=!0,b=f.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,h+1)),v=()=>{let g;return y?g=w:x?g=b:f.route.Component?g=p.createElement(f.route.Component,null):f.route.element?g=f.route.element:g=d,p.createElement(rw,{match:f,routeContext:{outlet:d,matches:m,isDataRoute:n!=null},children:g})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?p.createElement(nw,{location:n.location,revalidation:n.revalidation,component:w,error:y,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()},null)}var Jm=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Jm||{}),eg=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(eg||{});function ow(e){let t=p.useContext(bi);return t||Re(!1),t}function lw(e){let t=p.useContext(Xm);return t||Re(!1),t}function iw(e){let t=p.useContext(Zt);return t||Re(!1),t}function tg(e){let t=iw(),n=t.matches[t.matches.length-1];return n.route.id||Re(!1),n.route.id}function aw(){var e;let t=p.useContext(Zm),n=lw(),r=tg();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function cw(){let{router:e}=ow(Jm.UseNavigateStable),t=tg(eg.UseNavigateStable),n=p.useRef(!1);return qm(()=>{n.current=!0}),p.useCallback(function(s,o){o===void 0&&(o={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,lo({fromRouteId:t},o)))},[e,t])}const zf={};function uw(e,t,n){zf[e]||(zf[e]=!0)}function dw(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function qe(e){let{to:t,replace:n,state:r,relative:s}=e;ds()||Re(!1);let{future:o,static:l}=p.useContext(xn),{matches:a}=p.useContext(Zt),{pathname:c}=qt(),u=yn(),d=$u(t,zu(a,o.v7_relativeSplatPath),c,s==="path"),f=JSON.stringify(d);return p.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:s}),[u,f,s,n,r]),null}function ng(e){return Z1(e.context)}function Oe(e){Re(!1)}function fw(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Ln.Pop,navigator:o,static:l=!1,future:a}=e;ds()&&Re(!1);let c=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:c,navigator:o,static:l,future:lo({v7_relativeSplatPath:!1},a)}),[c,a,o,l]);typeof r=="string"&&(r=us(r));let{pathname:d="/",search:f="",hash:h="",state:y=null,key:x="default"}=r,w=p.useMemo(()=>{let b=os(d,c);return b==null?null:{location:{pathname:b,search:f,hash:h,state:y,key:x},navigationType:s}},[c,d,f,h,y,x,s]);return w==null?null:p.createElement(xn.Provider,{value:u},p.createElement(ki.Provider,{children:n,value:w}))}function pw(e){let{children:t,location:n}=e;return q1(bc(t),n)}new Promise(()=>{});function bc(e,t){t===void 0&&(t=[]);let n=[];return p.Children.forEach(e,(r,s)=>{if(!p.isValidElement(r))return;let o=[...t,s];if(r.type===p.Fragment){n.push.apply(n,bc(r.props.children,o));return}r.type!==Oe&&Re(!1),!r.props.index||!r.props.children||Re(!1);let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=bc(r.props.children,o)),n.push(l)}),n}/**
|
|
59
|
+
* React Router DOM v6.30.3
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/function Hl(){return Hl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hl.apply(this,arguments)}function rg(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,o;for(o=0;o<r.length;o++)s=r[o],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function hw(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mw(e,t){return e.button===0&&(!t||t==="_self")&&!hw(e)}function kc(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function gw(e,t){let n=kc(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}const vw=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],xw=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],yw="6";try{window.__reactRouterVersion=yw}catch{}const ww=p.createContext({isTransitioning:!1}),bw="startTransition",$f=oi[bw];function kw(e){let{basename:t,children:n,future:r,window:s}=e,o=p.useRef();o.current==null&&(o.current=k1({window:s,v5Compat:!0}));let l=o.current,[a,c]=p.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},d=p.useCallback(f=>{u&&$f?$f(()=>c(f)):c(f)},[c,u]);return p.useLayoutEffect(()=>l.listen(d),[l,d]),p.useEffect(()=>dw(r),[r]),p.createElement(fw,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:l,future:r})}const Sw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Nw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tr=p.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:o,replace:l,state:a,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=rg(t,vw),{basename:y}=p.useContext(xn),x,w=!1;if(typeof u=="string"&&Nw.test(u)&&(x=u,Sw))try{let g=new URL(window.location.href),k=u.startsWith("//")?new URL(g.protocol+u):new URL(u),j=os(k.pathname,y);k.origin===g.origin&&j!=null?u=j+k.search+k.hash:w=!0}catch{}let b=K1(u,{relative:s}),m=Ew(u,{replace:l,state:a,target:c,preventScrollReset:d,relative:s,viewTransition:f});function v(g){r&&r(g),g.defaultPrevented||m(g)}return p.createElement("a",Hl({},h,{href:x||b,onClick:w||o?r:v,ref:n,target:c}))}),jw=p.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:o="",end:l=!1,style:a,to:c,viewTransition:u,children:d}=t,f=rg(t,xw),h=Si(c,{relative:f.relative}),y=qt(),x=p.useContext(Xm),{navigator:w,basename:b}=p.useContext(xn),m=x!=null&&Rw(h)&&u===!0,v=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,g=y.pathname,k=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;s||(g=g.toLowerCase(),k=k?k.toLowerCase():null,v=v.toLowerCase()),k&&b&&(k=os(k,b)||k);const j=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let E=g===v||!l&&g.startsWith(v)&&g.charAt(j)==="/",S=k!=null&&(k===v||!l&&k.startsWith(v)&&k.charAt(v.length)==="/"),C={isActive:E,isPending:S,isTransitioning:m},U=E?r:void 0,T;typeof o=="function"?T=o(C):T=[o,E?"active":null,S?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let V=typeof a=="function"?a(C):a;return p.createElement(tr,Hl({},f,{"aria-current":U,className:T,ref:n,style:V,to:c,viewTransition:u}),typeof d=="function"?d(C):d)});var Sc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Sc||(Sc={}));var Ff;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ff||(Ff={}));function Cw(e){let t=p.useContext(bi);return t||Re(!1),t}function Ew(e,t){let{target:n,replace:r,state:s,preventScrollReset:o,relative:l,viewTransition:a}=t===void 0?{}:t,c=yn(),u=qt(),d=Si(e,{relative:l});return p.useCallback(f=>{if(mw(f,n)){f.preventDefault();let h=r!==void 0?r:Wl(u)===Wl(d);c(e,{replace:h,state:s,preventScrollReset:o,relative:l,viewTransition:a})}},[u,c,d,r,s,n,e,o,l,a])}function Tw(e){let t=p.useRef(kc(e)),n=p.useRef(!1),r=qt(),s=p.useMemo(()=>gw(r.search,n.current?null:t.current),[r.search]),o=yn(),l=p.useCallback((a,c)=>{const u=kc(typeof a=="function"?a(s):a);n.current=!0,o("?"+u,c)},[o,s]);return[s,l]}function Rw(e,t){t===void 0&&(t={});let n=p.useContext(ww);n==null&&Re(!1);let{basename:r}=Cw(Sc.useViewTransitionState),s=Si(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=os(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=os(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Vl(s.pathname,l)!=null||Vl(s.pathname,o)!=null}function Iw(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Pw=e=>{switch(e){case"success":return Mw;case"info":return Aw;case"warning":return Ow;case"error":return Dw;default:return null}},_w=Array(12).fill(0),Lw=({visible:e,className:t})=>L.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},L.createElement("div",{className:"sonner-spinner"},_w.map((n,r)=>L.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Mw=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Ow=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Aw=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Dw=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),zw=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},L.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),L.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),$w=()=>{const[e,t]=L.useState(document.hidden);return L.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Nc=1;class Fw{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Nc++,l=this.toasts.find(c=>c.id===o),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(c=>c.id===o?(this.publish({...c,...t,id:o,title:r}),{...c,...t,id:o,dismissible:a,title:r}):c):this.addToast({title:r,...s,dismissible:a,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,l;const a=s.then(async u=>{if(l=["resolve",u],L.isValidElement(u))o=!1,this.create({id:r,type:"default",message:u});else if(Uw(u)&&!u.ok){o=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,h=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,x=typeof f=="object"&&!L.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:h,...x})}else if(u instanceof Error){o=!1;const f=typeof n.error=="function"?await n.error(u):n.error,h=typeof n.description=="function"?await n.description(u):n.description,x=typeof f=="object"&&!L.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:h,...x})}else if(n.success!==void 0){o=!1;const f=typeof n.success=="function"?await n.success(u):n.success,h=typeof n.description=="function"?await n.description(u):n.description,x=typeof f=="object"&&!L.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:h,...x})}}).catch(async u=>{if(l=["reject",u],n.error!==void 0){o=!1;const d=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description,y=typeof d=="object"&&!L.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:f,...y})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((u,d)=>a.then(()=>l[0]==="reject"?d(l[1]):u(l[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Nc++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ot=new Fw,Bw=(e,t)=>{const n=(t==null?void 0:t.id)||Nc++;return ot.addToast({title:e,...t,id:n}),n},Uw=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Ww=Bw,Vw=()=>ot.toasts,Hw=()=>ot.getActiveToasts(),Y=Object.assign(Ww,{success:ot.success,info:ot.info,warning:ot.warning,error:ot.error,custom:ot.custom,message:ot.message,promise:ot.promise,dismiss:ot.dismiss,loading:ot.loading},{getHistory:Vw,getToasts:Hw});Iw("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Go(e){return e.label!==void 0}const Gw=3,Yw="24px",Kw="16px",Bf=4e3,Qw=356,Xw=14,Zw=45,qw=200;function Ft(...e){return e.filter(Boolean).join(" ")}function Jw(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const eb=e=>{var t,n,r,s,o,l,a,c,u;const{invert:d,toast:f,unstyled:h,interacting:y,setHeights:x,visibleToasts:w,heights:b,index:m,toasts:v,expanded:g,removeToast:k,defaultRichColors:j,closeButton:E,style:S,cancelButtonStyle:C,actionButtonStyle:U,className:T="",descriptionClassName:V="",duration:_,position:K,gap:J,expandByDefault:O,classNames:A,icons:W,closeButtonAriaLabel:R="Close toast"}=e,[$,F]=L.useState(null),[X,ee]=L.useState(null),[G,ne]=L.useState(!1),[oe,le]=L.useState(!1),[we,M]=L.useState(!1),[D,P]=L.useState(!1),[N,I]=L.useState(!1),[B,q]=L.useState(0),[ce,fe]=L.useState(0),Ce=L.useRef(f.duration||_||Bf),en=L.useRef(null),Et=L.useRef(null),zx=m===0,$x=m+1<=w,dt=f.type,Nr=f.dismissible!==!1,Fx=f.className||"",Bx=f.descriptionClassName||"",Co=L.useMemo(()=>b.findIndex(re=>re.toastId===f.id)||0,[b,f.id]),Ux=L.useMemo(()=>{var re;return(re=f.closeButton)!=null?re:E},[f.closeButton,E]),gd=L.useMemo(()=>f.duration||_||Bf,[f.duration,_]),Oi=L.useRef(0),jr=L.useRef(0),vd=L.useRef(0),Cr=L.useRef(null),[Wx,Vx]=K.split("-"),xd=L.useMemo(()=>b.reduce((re,$e,Ke)=>Ke>=Co?re:re+$e.height,0),[b,Co]),yd=$w(),Hx=f.invert||d,Ai=dt==="loading";jr.current=L.useMemo(()=>Co*J+xd,[Co,xd]),L.useEffect(()=>{Ce.current=gd},[gd]),L.useEffect(()=>{ne(!0)},[]),L.useEffect(()=>{const re=Et.current;if(re){const $e=re.getBoundingClientRect().height;return fe($e),x(Ke=>[{toastId:f.id,height:$e,position:f.position},...Ke]),()=>x(Ke=>Ke.filter(ft=>ft.toastId!==f.id))}},[x,f.id]),L.useLayoutEffect(()=>{if(!G)return;const re=Et.current,$e=re.style.height;re.style.height="auto";const Ke=re.getBoundingClientRect().height;re.style.height=$e,fe(Ke),x(ft=>ft.find(Ue=>Ue.toastId===f.id)?ft.map(Ue=>Ue.toastId===f.id?{...Ue,height:Ke}:Ue):[{toastId:f.id,height:Ke,position:f.position},...ft])},[G,f.title,f.description,x,f.id,f.jsx,f.action,f.cancel]);const kn=L.useCallback(()=>{le(!0),q(jr.current),x(re=>re.filter($e=>$e.toastId!==f.id)),setTimeout(()=>{k(f)},qw)},[f,k,x,jr]);L.useEffect(()=>{if(f.promise&&dt==="loading"||f.duration===1/0||f.type==="loading")return;let re;return g||y||yd?(()=>{if(vd.current<Oi.current){const ft=new Date().getTime()-Oi.current;Ce.current=Ce.current-ft}vd.current=new Date().getTime()})():(()=>{Ce.current!==1/0&&(Oi.current=new Date().getTime(),re=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),kn()},Ce.current))})(),()=>clearTimeout(re)},[g,y,f,dt,yd,kn]),L.useEffect(()=>{f.delete&&(kn(),f.onDismiss==null||f.onDismiss.call(f,f))},[kn,f.delete]);function Gx(){var re;if(W!=null&&W.loading){var $e;return L.createElement("div",{className:Ft(A==null?void 0:A.loader,f==null||($e=f.classNames)==null?void 0:$e.loader,"sonner-loader"),"data-visible":dt==="loading"},W.loading)}return L.createElement(Lw,{className:Ft(A==null?void 0:A.loader,f==null||(re=f.classNames)==null?void 0:re.loader),visible:dt==="loading"})}const Yx=f.icon||(W==null?void 0:W[dt])||Pw(dt);var wd,bd;return L.createElement("li",{tabIndex:0,ref:Et,className:Ft(T,Fx,A==null?void 0:A.toast,f==null||(t=f.classNames)==null?void 0:t.toast,A==null?void 0:A.default,A==null?void 0:A[dt],f==null||(n=f.classNames)==null?void 0:n[dt]),"data-sonner-toast":"","data-rich-colors":(wd=f.richColors)!=null?wd:j,"data-styled":!(f.jsx||f.unstyled||h),"data-mounted":G,"data-promise":!!f.promise,"data-swiped":N,"data-removed":oe,"data-visible":$x,"data-y-position":Wx,"data-x-position":Vx,"data-index":m,"data-front":zx,"data-swiping":we,"data-dismissible":Nr,"data-type":dt,"data-invert":Hx,"data-swipe-out":D,"data-swipe-direction":X,"data-expanded":!!(g||O&&G),"data-testid":f.testId,style:{"--index":m,"--toasts-before":m,"--z-index":v.length-m,"--offset":`${oe?B:jr.current}px`,"--initial-height":O?"auto":`${ce}px`,...S,...f.style},onDragEnd:()=>{M(!1),F(null),Cr.current=null},onPointerDown:re=>{re.button!==2&&(Ai||!Nr||(en.current=new Date,q(jr.current),re.target.setPointerCapture(re.pointerId),re.target.tagName!=="BUTTON"&&(M(!0),Cr.current={x:re.clientX,y:re.clientY})))},onPointerUp:()=>{var re,$e,Ke;if(D||!Nr)return;Cr.current=null;const ft=Number(((re=Et.current)==null?void 0:re.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Eo=Number((($e=Et.current)==null?void 0:$e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ue=new Date().getTime()-((Ke=en.current)==null?void 0:Ke.getTime()),yt=$==="x"?ft:Eo,To=Math.abs(yt)/Ue;if(Math.abs(yt)>=Zw||To>.11){q(jr.current),f.onDismiss==null||f.onDismiss.call(f,f),ee($==="x"?ft>0?"right":"left":Eo>0?"down":"up"),kn(),P(!0);return}else{var Tt,Rt;(Tt=Et.current)==null||Tt.style.setProperty("--swipe-amount-x","0px"),(Rt=Et.current)==null||Rt.style.setProperty("--swipe-amount-y","0px")}I(!1),M(!1),F(null)},onPointerMove:re=>{var $e,Ke,ft;if(!Cr.current||!Nr||(($e=window.getSelection())==null?void 0:$e.toString().length)>0)return;const Ue=re.clientY-Cr.current.y,yt=re.clientX-Cr.current.x;var To;const Tt=(To=e.swipeDirections)!=null?To:Jw(K);!$&&(Math.abs(yt)>1||Math.abs(Ue)>1)&&F(Math.abs(yt)>Math.abs(Ue)?"x":"y");let Rt={x:0,y:0};const kd=nr=>1/(1.5+Math.abs(nr)/20);if($==="y"){if(Tt.includes("top")||Tt.includes("bottom"))if(Tt.includes("top")&&Ue<0||Tt.includes("bottom")&&Ue>0)Rt.y=Ue;else{const nr=Ue*kd(Ue);Rt.y=Math.abs(nr)<Math.abs(Ue)?nr:Ue}}else if($==="x"&&(Tt.includes("left")||Tt.includes("right")))if(Tt.includes("left")&&yt<0||Tt.includes("right")&&yt>0)Rt.x=yt;else{const nr=yt*kd(yt);Rt.x=Math.abs(nr)<Math.abs(yt)?nr:yt}(Math.abs(Rt.x)>0||Math.abs(Rt.y)>0)&&I(!0),(Ke=Et.current)==null||Ke.style.setProperty("--swipe-amount-x",`${Rt.x}px`),(ft=Et.current)==null||ft.style.setProperty("--swipe-amount-y",`${Rt.y}px`)}},Ux&&!f.jsx&&dt!=="loading"?L.createElement("button",{"aria-label":R,"data-disabled":Ai,"data-close-button":!0,onClick:Ai||!Nr?()=>{}:()=>{kn(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Ft(A==null?void 0:A.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(bd=W==null?void 0:W.close)!=null?bd:zw):null,(dt||f.icon||f.promise)&&f.icon!==null&&((W==null?void 0:W[dt])!==null||f.icon)?L.createElement("div",{"data-icon":"",className:Ft(A==null?void 0:A.icon,f==null||(s=f.classNames)==null?void 0:s.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Gx():null,f.type!=="loading"?Yx:null):null,L.createElement("div",{"data-content":"",className:Ft(A==null?void 0:A.content,f==null||(o=f.classNames)==null?void 0:o.content)},L.createElement("div",{"data-title":"",className:Ft(A==null?void 0:A.title,f==null||(l=f.classNames)==null?void 0:l.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?L.createElement("div",{"data-description":"",className:Ft(V,Bx,A==null?void 0:A.description,f==null||(a=f.classNames)==null?void 0:a.description)},typeof f.description=="function"?f.description():f.description):null),L.isValidElement(f.cancel)?f.cancel:f.cancel&&Go(f.cancel)?L.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||C,onClick:re=>{Go(f.cancel)&&Nr&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,re),kn())},className:Ft(A==null?void 0:A.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,L.isValidElement(f.action)?f.action:f.action&&Go(f.action)?L.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||U,onClick:re=>{Go(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,re),!re.defaultPrevented&&kn())},className:Ft(A==null?void 0:A.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function Uf(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function tb(e,t){const n={};return[e,t].forEach((r,s)=>{const o=s===1,l=o?"--mobile-offset":"--offset",a=o?Kw:Yw;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${l}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${l}-${u}`]=a:n[`${l}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(a)}),n}const nb=L.forwardRef(function(t,n){const{id:r,invert:s,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:a,closeButton:c,className:u,offset:d,mobileOffset:f,theme:h="light",richColors:y,duration:x,style:w,visibleToasts:b=Gw,toastOptions:m,dir:v=Uf(),gap:g=Xw,icons:k,containerAriaLabel:j="Notifications"}=t,[E,S]=L.useState([]),C=L.useMemo(()=>r?E.filter(G=>G.toasterId===r):E.filter(G=>!G.toasterId),[E,r]),U=L.useMemo(()=>Array.from(new Set([o].concat(C.filter(G=>G.position).map(G=>G.position)))),[C,o]),[T,V]=L.useState([]),[_,K]=L.useState(!1),[J,O]=L.useState(!1),[A,W]=L.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),R=L.useRef(null),$=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=L.useRef(null),X=L.useRef(!1),ee=L.useCallback(G=>{S(ne=>{var oe;return(oe=ne.find(le=>le.id===G.id))!=null&&oe.delete||ot.dismiss(G.id),ne.filter(({id:le})=>le!==G.id)})},[]);return L.useEffect(()=>ot.subscribe(G=>{if(G.dismiss){requestAnimationFrame(()=>{S(ne=>ne.map(oe=>oe.id===G.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{Gm.flushSync(()=>{S(ne=>{const oe=ne.findIndex(le=>le.id===G.id);return oe!==-1?[...ne.slice(0,oe),{...ne[oe],...G},...ne.slice(oe+1)]:[G,...ne]})})})}),[E]),L.useEffect(()=>{if(h!=="system"){W(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;const G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:ne})=>{W(ne?"dark":"light")})}catch{G.addListener(({matches:oe})=>{try{W(oe?"dark":"light")}catch(le){console.error(le)}})}},[h]),L.useEffect(()=>{E.length<=1&&K(!1)},[E]),L.useEffect(()=>{const G=ne=>{var oe;if(l.every(M=>ne[M]||ne.code===M)){var we;K(!0),(we=R.current)==null||we.focus()}ne.code==="Escape"&&(document.activeElement===R.current||(oe=R.current)!=null&&oe.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[l]),L.useEffect(()=>{if(R.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,X.current=!1)}},[R.current]),L.createElement("section",{ref:n,"aria-label":`${j} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((G,ne)=>{var oe;const[le,we]=G.split("-");return C.length?L.createElement("ol",{key:G,dir:v==="auto"?Uf():v,tabIndex:-1,ref:R,className:u,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":le,"data-x-position":we,style:{"--front-toast-height":`${((oe=T[0])==null?void 0:oe.height)||0}px`,"--width":`${Qw}px`,"--gap":`${g}px`,...w,...tb(d,f)},onBlur:M=>{X.current&&!M.currentTarget.contains(M.relatedTarget)&&(X.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:M=>{M.target instanceof HTMLElement&&M.target.dataset.dismissible==="false"||X.current||(X.current=!0,F.current=M.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{J||K(!1)},onDragEnd:()=>K(!1),onPointerDown:M=>{M.target instanceof HTMLElement&&M.target.dataset.dismissible==="false"||O(!0)},onPointerUp:()=>O(!1)},C.filter(M=>!M.position&&ne===0||M.position===G).map((M,D)=>{var P,N;return L.createElement(eb,{key:M.id,icons:k,index:D,toast:M,defaultRichColors:y,duration:(P=m==null?void 0:m.duration)!=null?P:x,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:s,visibleToasts:b,closeButton:(N=m==null?void 0:m.closeButton)!=null?N:c,interacting:J,position:G,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,closeButtonAriaLabel:m==null?void 0:m.closeButtonAriaLabel,removeToast:ee,toasts:C.filter(I=>I.position==M.position),heights:T.filter(I=>I.position==M.position),setHeights:V,expandByDefault:a,gap:g,expanded:_,swipeDirections:t.swipeDirections})})):null}))});function Wf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function wn(...e){return t=>{let n=!1;const r=e.map(s=>{const o=Wf(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Wf(e[s],null)}}}}function Xt(...e){return p.useCallback(wn(...e),e)}var rb=Symbol.for("react.lazy"),Gl=oi[" use ".trim().toString()];function sb(e){return typeof e=="object"&&e!==null&&"then"in e}function sg(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===rb&&"_payload"in e&&sb(e._payload)}function ob(e){const t=ib(e),n=p.forwardRef((r,s)=>{let{children:o,...l}=r;sg(o)&&typeof Gl=="function"&&(o=Gl(o._payload));const a=p.Children.toArray(o),c=a.find(cb);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return i.jsx(t,{...l,ref:s,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return i.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var lb=ob("Slot");function ib(e){const t=p.forwardRef((n,r)=>{let{children:s,...o}=n;if(sg(s)&&typeof Gl=="function"&&(s=Gl(s._payload)),p.isValidElement(s)){const l=db(s),a=ub(o,s.props);return s.type!==p.Fragment&&(a.ref=r?wn(r,l):l),p.cloneElement(s,a)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ab=Symbol("radix.slottable");function cb(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ab}function ub(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function db(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function og(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=og(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function lg(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=og(e))&&(r&&(r+=" "),r+=t);return r}const Vf=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hf=lg,ig=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Hf(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,l=Object.keys(s).map(u=>{const d=n==null?void 0:n[u],f=o==null?void 0:o[u];if(d===null)return null;const h=Vf(d)||Vf(f);return s[u][h]}),a=n&&Object.entries(n).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:h,...y}=d;return Object.entries(y).every(x=>{let[w,b]=x;return Array.isArray(b)?b.includes({...o,...a}[w]):{...o,...a}[w]===b})?[...u,f,h]:u},[]);return Hf(e,l,c,n==null?void 0:n.class,n==null?void 0:n.className)},Fu="-",fb=e=>{const t=hb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const a=l.split(Fu);return a[0]===""&&a.length!==1&&a.shift(),ag(a,t)||pb(l)},getConflictingClassGroupIds:(l,a)=>{const c=n[l]||[];return a&&r[l]?[...c,...r[l]]:c}}},ag=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?ag(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Fu);return(l=t.validators.find(({validator:a})=>a(o)))==null?void 0:l.classGroupId},Gf=/^\[(.+)\]$/,pb=e=>{if(Gf.test(e)){const t=Gf.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},hb=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return gb(Object.entries(e.classGroups),n).forEach(([o,l])=>{jc(l,r,o,t)}),r},jc=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Yf(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(mb(s)){jc(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,l])=>{jc(l,Yf(t,o),n,r)})})},Yf=(e,t)=>{let n=e;return t.split(Fu).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},mb=e=>e.isThemeGetter,gb=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([l,a])=>[t+l,a])):o);return[n,s]}):e,vb=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,l)=>{n.set(o,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let l=n.get(o);if(l!==void 0)return l;if((l=r.get(o))!==void 0)return s(o,l),l},set(o,l){n.has(o)?n.set(o,l):s(o,l)}}},cg="!",xb=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,l=a=>{const c=[];let u=0,d=0,f;for(let b=0;b<a.length;b++){let m=a[b];if(u===0){if(m===s&&(r||a.slice(b,b+o)===t)){c.push(a.slice(d,b)),d=b+o;continue}if(m==="/"){f=b;continue}}m==="["?u++:m==="]"&&u--}const h=c.length===0?a:a.substring(d),y=h.startsWith(cg),x=y?h.substring(1):h,w=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:w}};return n?a=>n({className:a,parseClassName:l}):l},yb=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},wb=e=>({cache:vb(e.cacheSize),parseClassName:xb(e),...fb(e)}),bb=/\s+/,kb=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],l=e.trim().split(bb);let a="";for(let c=l.length-1;c>=0;c-=1){const u=l[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:y}=n(u);let x=!!y,w=r(x?h.substring(0,y):h);if(!w){if(!x){a=u+(a.length>0?" "+a:a);continue}if(w=r(h),!w){a=u+(a.length>0?" "+a:a);continue}x=!1}const b=yb(d).join(":"),m=f?b+cg:b,v=m+w;if(o.includes(v))continue;o.push(v);const g=s(w,x);for(let k=0;k<g.length;++k){const j=g[k];o.push(m+j)}a=u+(a.length>0?" "+a:a)}return a};function Sb(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ug(t))&&(r&&(r+=" "),r+=n);return r}const ug=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ug(e[r]))&&(n&&(n+=" "),n+=t);return n};function Nb(e,...t){let n,r,s,o=l;function l(c){const u=t.reduce((d,f)=>f(d),e());return n=wb(u),r=n.cache.get,s=n.cache.set,o=a,a(c)}function a(c){const u=r(c);if(u)return u;const d=kb(c,n);return s(c,d),d}return function(){return o(Sb.apply(null,arguments))}}const be=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},dg=/^\[(?:([a-z-]+):)?(.+)\]$/i,jb=/^\d+\/\d+$/,Cb=new Set(["px","full","screen"]),Eb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Tb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Rb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ib=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Pb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tn=e=>Xr(e)||Cb.has(e)||jb.test(e),Nn=e=>ps(e,"length",$b),Xr=e=>!!e&&!Number.isNaN(Number(e)),ua=e=>ps(e,"number",Xr),Ss=e=>!!e&&Number.isInteger(Number(e)),_b=e=>e.endsWith("%")&&Xr(e.slice(0,-1)),se=e=>dg.test(e),jn=e=>Eb.test(e),Lb=new Set(["length","size","percentage"]),Mb=e=>ps(e,Lb,fg),Ob=e=>ps(e,"position",fg),Ab=new Set(["image","url"]),Db=e=>ps(e,Ab,Bb),zb=e=>ps(e,"",Fb),Ns=()=>!0,ps=(e,t,n)=>{const r=dg.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},$b=e=>Tb.test(e)&&!Rb.test(e),fg=()=>!1,Fb=e=>Ib.test(e),Bb=e=>Pb.test(e),Ub=()=>{const e=be("colors"),t=be("spacing"),n=be("blur"),r=be("brightness"),s=be("borderColor"),o=be("borderRadius"),l=be("borderSpacing"),a=be("borderWidth"),c=be("contrast"),u=be("grayscale"),d=be("hueRotate"),f=be("invert"),h=be("gap"),y=be("gradientColorStops"),x=be("gradientColorStopPositions"),w=be("inset"),b=be("margin"),m=be("opacity"),v=be("padding"),g=be("saturate"),k=be("scale"),j=be("sepia"),E=be("skew"),S=be("space"),C=be("translate"),U=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",se,t],_=()=>[se,t],K=()=>["",tn,Nn],J=()=>["auto",Xr,se],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",se],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[Xr,se];return{cacheSize:500,separator:":",theme:{colors:[Ns],spacing:[tn,Nn],blur:["none","",jn,se],brightness:X(),borderColor:[e],borderRadius:["none","","full",jn,se],borderSpacing:_(),borderWidth:K(),contrast:X(),grayscale:$(),hueRotate:X(),invert:$(),gap:_(),gradientColorStops:[e],gradientColorStopPositions:[_b,Nn],inset:V(),margin:V(),opacity:X(),padding:_(),saturate:X(),scale:X(),sepia:$(),skew:X(),space:_(),translate:_()},classGroups:{aspect:[{aspect:["auto","square","video",se]}],container:["container"],columns:[{columns:[jn]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...O(),se]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ss,se]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",se]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",Ss,se]}],"grid-cols":[{"grid-cols":[Ns]}],"col-start-end":[{col:["auto",{span:["full",Ss,se]},se]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[Ns]}],"row-start-end":[{row:["auto",{span:[Ss,se]},se]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",se]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...R()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...R(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...R(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",se,t]}],"min-w":[{"min-w":[se,t,"min","max","fit"]}],"max-w":[{"max-w":[se,t,"none","full","min","max","fit","prose",{screen:[jn]},jn]}],h:[{h:[se,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[se,t,"auto","min","max","fit"]}],"font-size":[{text:["base",jn,Nn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ua]}],"font-family":[{font:[Ns]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",se]}],"line-clamp":[{"line-clamp":["none",Xr,ua]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",tn,se]}],"list-image":[{"list-image":["none",se]}],"list-style-type":[{list:["none","disc","decimal",se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...A(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",tn,Nn]}],"underline-offset":[{"underline-offset":["auto",tn,se]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...O(),Ob]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Mb]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Db]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...A(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:A()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...A()]}],"outline-offset":[{"outline-offset":[tn,se]}],"outline-w":[{outline:[tn,Nn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[tn,Nn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",jn,zb]}],"shadow-color":[{shadow:[Ns]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",jn,se]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[g]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",se]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",se]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Ss,se]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",se]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",se]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",se]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[tn,Nn,ua]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Wb=Nb(Ub);function ze(e,t){const n=new Set(t),r={};for(const s of Object.keys(e))if(!n.has(s)){const o=e[s];typeof o<"u"&&(r[s]=o)}return r}function Z(e,t=null,n=null,r=null,s=null,o=null,l=null,a=null,c=null,u=null){const d=[];return e!==null&&d.push(e),t!==null&&d.push(t),n!==null&&d.push(n),r!==null&&d.push(r),s!==null&&d.push(s),o!==null&&d.push(o),l!==null&&d.push(l),a!==null&&d.push(a),c!==null&&d.push(c),u!==null&&d.push(u),Wb(lg(d))}function Bu(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}const Vb=ig("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-white/[0.1] bg-[#111111] hover:bg-white/[0.05] hover:text-foreground",secondary:"bg-[#161616] text-secondary-foreground hover:bg-[#1c1c1c]",ghost:"hover:bg-white/[0.06] hover:text-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-8 rounded-lg px-3 text-xs",lg:"h-11 rounded-xl px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),H=p.forwardRef((e,t)=>{let n=!1;"asChild"in e&&e.asChild===!0&&(n=!0);const r=n?lb:"button";return p.createElement(r,Object.assign({},ze(e,["className","variant","size","asChild"]),{ref:t,className:Z(Vb({variant:e.variant,size:e.size,className:e.className}))}))});H.displayName="Button";function He(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Hb(e,t){const n=p.createContext(t),r=o=>{const{children:l,...a}=o,c=p.useMemo(()=>a,Object.values(a));return i.jsx(n.Provider,{value:c,children:l})};r.displayName=e+"Provider";function s(o){const l=p.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function Ni(e,t=[]){let n=[];function r(o,l){const a=p.createContext(l),c=n.length;n=[...n,l];const u=f=>{var m;const{scope:h,children:y,...x}=f,w=((m=h==null?void 0:h[e])==null?void 0:m[c])||a,b=p.useMemo(()=>x,Object.values(x));return i.jsx(w.Provider,{value:b,children:y})};u.displayName=o+"Provider";function d(f,h){var w;const y=((w=h==null?void 0:h[e])==null?void 0:w[c])||a,x=p.useContext(y);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[u,d]}const s=()=>{const o=n.map(l=>p.createContext(l));return function(a){const c=(a==null?void 0:a[e])||o;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,Gb(s,...t)]}function Gb(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=r.reduce((a,{useScope:c,scopeName:u})=>{const f=c(o)[`__scope${u}`];return{...a,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var io=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},Yb=oi[" useId ".trim().toString()]||(()=>{}),Kb=0;function Fs(e){const[t,n]=p.useState(Yb());return io(()=>{n(r=>r??String(Kb++))},[e]),t?`radix-${t}`:""}var Qb=oi[" useInsertionEffect ".trim().toString()]||io;function Uu({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,l]=Xb({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:s;{const d=p.useRef(e!==void 0);p.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const u=p.useCallback(d=>{var f;if(a){const h=Zb(d)?d(e):d;h!==e&&((f=l.current)==null||f.call(l,h))}else o(d)},[a,e,o,l]);return[c,u]}function Xb({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),s=p.useRef(n),o=p.useRef(t);return Qb(()=>{o.current=t},[t]),p.useEffect(()=>{var l;s.current!==n&&((l=o.current)==null||l.call(o,n),s.current=n)},[n,s]),[n,r,o]}function Zb(e){return typeof e=="function"}function qb(e){const t=Jb(e),n=p.forwardRef((r,s)=>{const{children:o,...l}=r,a=p.Children.toArray(o),c=a.find(tk);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return i.jsx(t,{...l,ref:s,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return i.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Jb(e){const t=p.forwardRef((n,r)=>{const{children:s,...o}=n;if(p.isValidElement(s)){const l=rk(s),a=nk(o,s.props);return s.type!==p.Fragment&&(a.ref=r?wn(r,l):l),p.cloneElement(s,a)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ek=Symbol("radix.slottable");function tk(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ek}function nk(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function rk(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var sk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pg=sk.reduce((e,t)=>{const n=qb(`Primitive.${t}`),r=p.forwardRef((s,o)=>{const{asChild:l,...a}=s,c=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ok(e,t){e&&Au.flushSync(()=>e.dispatchEvent(t))}function ls(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function lk(e,t=globalThis==null?void 0:globalThis.document){const n=ls(e);p.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ik="DismissableLayer",Cc="dismissableLayer.update",ak="dismissableLayer.pointerDownOutside",ck="dismissableLayer.focusOutside",Kf,hg=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mg=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:l,onDismiss:a,...c}=e,u=p.useContext(hg),[d,f]=p.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=p.useState({}),x=Xt(t,S=>f(S)),w=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=w.indexOf(b),v=d?w.indexOf(d):-1,g=u.layersWithOutsidePointerEventsDisabled.size>0,k=v>=m,j=fk(S=>{const C=S.target,U=[...u.branches].some(T=>T.contains(C));!k||U||(s==null||s(S),l==null||l(S),S.defaultPrevented||a==null||a())},h),E=pk(S=>{const C=S.target;[...u.branches].some(T=>T.contains(C))||(o==null||o(S),l==null||l(S),S.defaultPrevented||a==null||a())},h);return lk(S=>{v===u.layers.size-1&&(r==null||r(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},h),p.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Kf=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Qf(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Kf)}},[d,h,n,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Qf())},[d,u]),p.useEffect(()=>{const S=()=>y({});return document.addEventListener(Cc,S),()=>document.removeEventListener(Cc,S)},[]),i.jsx(pg.div,{...c,ref:x,style:{pointerEvents:g?k?"auto":"none":void 0,...e.style},onFocusCapture:He(e.onFocusCapture,E.onFocusCapture),onBlurCapture:He(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:He(e.onPointerDownCapture,j.onPointerDownCapture)})});mg.displayName=ik;var uk="DismissableLayerBranch",dk=p.forwardRef((e,t)=>{const n=p.useContext(hg),r=p.useRef(null),s=Xt(t,r);return p.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),i.jsx(pg.div,{...e,ref:s})});dk.displayName=uk;function fk(e,t=globalThis==null?void 0:globalThis.document){const n=ls(e),r=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){gg(ak,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pk(e,t=globalThis==null?void 0:globalThis.document){const n=ls(e),r=p.useRef(!1);return p.useEffect(()=>{const s=o=>{o.target&&!r.current&&gg(ck,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Qf(){const e=new CustomEvent(Cc);document.dispatchEvent(e)}function gg(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?ok(s,o):s.dispatchEvent(o)}function hk(e){const t=mk(e),n=p.forwardRef((r,s)=>{const{children:o,...l}=r,a=p.Children.toArray(o),c=a.find(vk);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return i.jsx(t,{...l,ref:s,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return i.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function mk(e){const t=p.forwardRef((n,r)=>{const{children:s,...o}=n;if(p.isValidElement(s)){const l=yk(s),a=xk(o,s.props);return s.type!==p.Fragment&&(a.ref=r?wn(r,l):l),p.cloneElement(s,a)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gk=Symbol("radix.slottable");function vk(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gk}function xk(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function yk(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bk=wk.reduce((e,t)=>{const n=hk(`Primitive.${t}`),r=p.forwardRef((s,o)=>{const{asChild:l,...a}=s,c=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),da="focusScope.autoFocusOnMount",fa="focusScope.autoFocusOnUnmount",Xf={bubbles:!1,cancelable:!0},kk="FocusScope",vg=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=e,[a,c]=p.useState(null),u=ls(s),d=ls(o),f=p.useRef(null),h=Xt(t,w=>c(w)),y=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let w=function(g){if(y.paused||!a)return;const k=g.target;a.contains(k)?f.current=k:Cn(f.current,{select:!0})},b=function(g){if(y.paused||!a)return;const k=g.relatedTarget;k!==null&&(a.contains(k)||Cn(f.current,{select:!0}))},m=function(g){if(document.activeElement===document.body)for(const j of g)j.removedNodes.length>0&&Cn(a)};document.addEventListener("focusin",w),document.addEventListener("focusout",b);const v=new MutationObserver(m);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",b),v.disconnect()}}},[r,a,y.paused]),p.useEffect(()=>{if(a){qf.add(y);const w=document.activeElement;if(!a.contains(w)){const m=new CustomEvent(da,Xf);a.addEventListener(da,u),a.dispatchEvent(m),m.defaultPrevented||(Sk(Tk(xg(a)),{select:!0}),document.activeElement===w&&Cn(a))}return()=>{a.removeEventListener(da,u),setTimeout(()=>{const m=new CustomEvent(fa,Xf);a.addEventListener(fa,d),a.dispatchEvent(m),m.defaultPrevented||Cn(w??document.body,{select:!0}),a.removeEventListener(fa,d),qf.remove(y)},0)}}},[a,u,d,y]);const x=p.useCallback(w=>{if(!n&&!r||y.paused)return;const b=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,m=document.activeElement;if(b&&m){const v=w.currentTarget,[g,k]=Nk(v);g&&k?!w.shiftKey&&m===k?(w.preventDefault(),n&&Cn(g,{select:!0})):w.shiftKey&&m===g&&(w.preventDefault(),n&&Cn(k,{select:!0})):m===v&&w.preventDefault()}},[n,r,y.paused]);return i.jsx(bk.div,{tabIndex:-1,...l,ref:h,onKeyDown:x})});vg.displayName=kk;function Sk(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Cn(r,{select:t}),document.activeElement!==n)return}function Nk(e){const t=xg(e),n=Zf(t,e),r=Zf(t.reverse(),e);return[n,r]}function xg(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Zf(e,t){for(const n of e)if(!jk(n,{upTo:t}))return n}function jk(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ck(e){return e instanceof HTMLInputElement&&"select"in e}function Cn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ck(e)&&t&&e.select()}}var qf=Ek();function Ek(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Jf(e,t),e.unshift(t)},remove(t){var n;e=Jf(e,t),(n=e[0])==null||n.resume()}}}function Jf(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Tk(e){return e.filter(t=>t.tagName!=="A")}function Rk(e){const t=Ik(e),n=p.forwardRef((r,s)=>{const{children:o,...l}=r,a=p.Children.toArray(o),c=a.find(_k);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return i.jsx(t,{...l,ref:s,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return i.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Ik(e){const t=p.forwardRef((n,r)=>{const{children:s,...o}=n;if(p.isValidElement(s)){const l=Mk(s),a=Lk(o,s.props);return s.type!==p.Fragment&&(a.ref=r?wn(r,l):l),p.cloneElement(s,a)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pk=Symbol("radix.slottable");function _k(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pk}function Lk(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Mk(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ok=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ak=Ok.reduce((e,t)=>{const n=Rk(`Primitive.${t}`),r=p.forwardRef((s,o)=>{const{asChild:l,...a}=s,c=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Dk="Portal",yg=p.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,o]=p.useState(!1);io(()=>o(!0),[]);const l=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return l?Gm.createPortal(i.jsx(Ak.div,{...r,ref:t}),l):null});yg.displayName=Dk;function zk(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var vo=e=>{const{present:t,children:n}=e,r=$k(t),s=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),o=Xt(r.ref,Fk(s));return typeof n=="function"||r.isPresent?p.cloneElement(s,{ref:o}):null};vo.displayName="Presence";function $k(e){const[t,n]=p.useState(),r=p.useRef(null),s=p.useRef(e),o=p.useRef("none"),l=e?"mounted":"unmounted",[a,c]=zk(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=Yo(r.current);o.current=a==="mounted"?u:"none"},[a]),io(()=>{const u=r.current,d=s.current;if(d!==e){const h=o.current,y=Yo(u);e?c("MOUNT"):y==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),io(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=y=>{const w=Yo(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(c("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=y=>{y.target===t&&(o.current=Yo(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Yo(e){return(e==null?void 0:e.animationName)||"none"}function Fk(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function wg(e){const t=Bk(e),n=p.forwardRef((r,s)=>{const{children:o,...l}=r,a=p.Children.toArray(o),c=a.find(Wk);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return i.jsx(t,{...l,ref:s,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return i.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function Bk(e){const t=p.forwardRef((n,r)=>{const{children:s,...o}=n;if(p.isValidElement(s)){const l=Hk(s),a=Vk(o,s.props);return s.type!==p.Fragment&&(a.ref=r?wn(r,l):l),p.cloneElement(s,a)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Uk=Symbol("radix.slottable");function Wk(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Uk}function Vk(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Hk(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xo=Gk.reduce((e,t)=>{const n=wg(`Primitive.${t}`),r=p.forwardRef((s,o)=>{const{asChild:l,...a}=s,c=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),pa=0;function Yk(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ep()),document.body.insertAdjacentElement("beforeend",e[1]??ep()),pa++,()=>{pa===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),pa--}},[])}function ep(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Vt=function(){return Vt=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Vt.apply(this,arguments)};function bg(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Kk(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var pl="right-scroll-bar-position",hl="width-before-scroll-bar",Qk="with-scroll-bars-hidden",Xk="--removed-body-scroll-bar-size";function ha(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Zk(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var qk=typeof window<"u"?p.useLayoutEffect:p.useEffect,tp=new WeakMap;function Jk(e,t){var n=Zk(null,function(r){return e.forEach(function(s){return ha(s,r)})});return qk(function(){var r=tp.get(n);if(r){var s=new Set(r),o=new Set(e),l=n.current;s.forEach(function(a){o.has(a)||ha(a,null)}),o.forEach(function(a){s.has(a)||ha(a,l)})}tp.set(n,e)},[e]),n}function eS(e){return e}function tS(e,t){t===void 0&&(t=eS);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var l=t(o,r);return n.push(l),function(){n=n.filter(function(a){return a!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var a=n;n=[],a.forEach(o),l=n}var c=function(){var d=l;l=[],d.forEach(o)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){l.push(d),u()},filter:function(d){return l=l.filter(d),n}}}};return s}function nS(e){e===void 0&&(e={});var t=tS(null);return t.options=Vt({async:!0,ssr:!1},e),t}var kg=function(e){var t=e.sideCar,n=bg(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,Vt({},n))};kg.isSideCarExport=!0;function rS(e,t){return e.useMedium(t),kg}var Sg=nS(),ma=function(){},ji=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:ma,onWheelCapture:ma,onTouchMoveCapture:ma}),s=r[0],o=r[1],l=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,y=e.noRelative,x=e.noIsolation,w=e.inert,b=e.allowPinchZoom,m=e.as,v=m===void 0?"div":m,g=e.gapMode,k=bg(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=h,E=Jk([n,t]),S=Vt(Vt({},k),s);return p.createElement(p.Fragment,null,d&&p.createElement(j,{sideCar:Sg,removeScrollBar:u,shards:f,noRelative:y,noIsolation:x,inert:w,setCallbacks:o,allowPinchZoom:!!b,lockRef:n,gapMode:g}),l?p.cloneElement(p.Children.only(a),Vt(Vt({},S),{ref:E})):p.createElement(v,Vt({},S,{className:c,ref:E}),a))});ji.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ji.classNames={fullWidth:hl,zeroRight:pl};var sS=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function oS(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=sS();return t&&e.setAttribute("nonce",t),e}function lS(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iS(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var aS=function(){var e=0,t=null;return{add:function(n){e==0&&(t=oS())&&(lS(t,n),iS(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cS=function(){var e=aS();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ng=function(){var e=cS(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},uS={left:0,top:0,right:0,gap:0},ga=function(e){return parseInt(e||"",10)||0},dS=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[ga(n),ga(r),ga(s)]},fS=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return uS;var t=dS(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},pS=Ng(),Zr="data-scroll-locked",hS=function(e,t,n,r){var s=e.left,o=e.top,l=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
68
|
+
.`.concat(Qk,` {
|
|
69
|
+
overflow: hidden `).concat(r,`;
|
|
70
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
71
|
+
}
|
|
72
|
+
body[`).concat(Zr,`] {
|
|
73
|
+
overflow: hidden `).concat(r,`;
|
|
74
|
+
overscroll-behavior: contain;
|
|
75
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
76
|
+
padding-left: `.concat(s,`px;
|
|
77
|
+
padding-top: `).concat(o,`px;
|
|
78
|
+
padding-right: `).concat(l,`px;
|
|
79
|
+
margin-left:0;
|
|
80
|
+
margin-top:0;
|
|
81
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
82
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.`).concat(pl,` {
|
|
86
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.`).concat(hl,` {
|
|
90
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.`).concat(pl," .").concat(pl,` {
|
|
94
|
+
right: 0 `).concat(r,`;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.`).concat(hl," .").concat(hl,` {
|
|
98
|
+
margin-right: 0 `).concat(r,`;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
body[`).concat(Zr,`] {
|
|
102
|
+
`).concat(Xk,": ").concat(a,`px;
|
|
103
|
+
}
|
|
104
|
+
`)},np=function(){var e=parseInt(document.body.getAttribute(Zr)||"0",10);return isFinite(e)?e:0},mS=function(){p.useEffect(function(){return document.body.setAttribute(Zr,(np()+1).toString()),function(){var e=np()-1;e<=0?document.body.removeAttribute(Zr):document.body.setAttribute(Zr,e.toString())}},[])},gS=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;mS();var o=p.useMemo(function(){return fS(s)},[s]);return p.createElement(pS,{styles:hS(o,!t,s,n?"":"!important")})},Ec=!1;if(typeof window<"u")try{var Ko=Object.defineProperty({},"passive",{get:function(){return Ec=!0,!0}});window.addEventListener("test",Ko,Ko),window.removeEventListener("test",Ko,Ko)}catch{Ec=!1}var Tr=Ec?{passive:!1}:!1,vS=function(e){return e.tagName==="TEXTAREA"},jg=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!vS(e)&&n[t]==="visible")},xS=function(e){return jg(e,"overflowY")},yS=function(e){return jg(e,"overflowX")},rp=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Cg(e,r);if(s){var o=Eg(e,r),l=o[1],a=o[2];if(l>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wS=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},bS=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Cg=function(e,t){return e==="v"?xS(t):yS(t)},Eg=function(e,t){return e==="v"?wS(t):bS(t)},kS=function(e,t){return e==="h"&&t==="rtl"?-1:1},SS=function(e,t,n,r,s){var o=kS(e,window.getComputedStyle(t).direction),l=o*r,a=n.target,c=t.contains(a),u=!1,d=l>0,f=0,h=0;do{if(!a)break;var y=Eg(e,a),x=y[0],w=y[1],b=y[2],m=w-b-o*x;(x||m)&&Cg(e,a)&&(f+=m,h+=x);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},Qo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sp=function(e){return[e.deltaX,e.deltaY]},op=function(e){return e&&"current"in e?e.current:e},NS=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jS=function(e){return`
|
|
105
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
106
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
107
|
+
`)},CS=0,Rr=[];function ES(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),s=p.useState(CS++)[0],o=p.useState(Ng)[0],l=p.useRef(e);p.useEffect(function(){l.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=Kk([e.lockRef.current],(e.shards||[]).map(op),!0).filter(Boolean);return w.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(w,b){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var m=Qo(w),v=n.current,g="deltaX"in w?w.deltaX:v[0]-m[0],k="deltaY"in w?w.deltaY:v[1]-m[1],j,E=w.target,S=Math.abs(g)>Math.abs(k)?"h":"v";if("touches"in w&&S==="h"&&E.type==="range")return!1;var C=window.getSelection(),U=C&&C.anchorNode,T=U?U===E||U.contains(E):!1;if(T)return!1;var V=rp(S,E);if(!V)return!0;if(V?j=S:(j=S==="v"?"h":"v",V=rp(S,E)),!V)return!1;if(!r.current&&"changedTouches"in w&&(g||k)&&(r.current=j),!j)return!0;var _=r.current||j;return SS(_,b,w,_==="h"?g:k)},[]),c=p.useCallback(function(w){var b=w;if(!(!Rr.length||Rr[Rr.length-1]!==o)){var m="deltaY"in b?sp(b):Qo(b),v=t.current.filter(function(j){return j.name===b.type&&(j.target===b.target||b.target===j.shadowParent)&&NS(j.delta,m)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}if(!v){var g=(l.current.shards||[]).map(op).filter(Boolean).filter(function(j){return j.contains(b.target)}),k=g.length>0?a(b,g[0]):!l.current.noIsolation;k&&b.cancelable&&b.preventDefault()}}},[]),u=p.useCallback(function(w,b,m,v){var g={name:w,delta:b,target:m,should:v,shadowParent:TS(m)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(k){return k!==g})},1)},[]),d=p.useCallback(function(w){n.current=Qo(w),r.current=void 0},[]),f=p.useCallback(function(w){u(w.type,sp(w),w.target,a(w,e.lockRef.current))},[]),h=p.useCallback(function(w){u(w.type,Qo(w),w.target,a(w,e.lockRef.current))},[]);p.useEffect(function(){return Rr.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Tr),document.addEventListener("touchmove",c,Tr),document.addEventListener("touchstart",d,Tr),function(){Rr=Rr.filter(function(w){return w!==o}),document.removeEventListener("wheel",c,Tr),document.removeEventListener("touchmove",c,Tr),document.removeEventListener("touchstart",d,Tr)}},[]);var y=e.removeScrollBar,x=e.inert;return p.createElement(p.Fragment,null,x?p.createElement(o,{styles:jS(s)}):null,y?p.createElement(gS,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function TS(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const RS=rS(Sg,ES);var Tg=p.forwardRef(function(e,t){return p.createElement(ji,Vt({},e,{ref:t,sideCar:RS}))});Tg.classNames=ji.classNames;var IS=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ir=new WeakMap,Xo=new WeakMap,Zo={},va=0,Rg=function(e){return e&&(e.host||Rg(e.parentNode))},PS=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Rg(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},_S=function(e,t,n,r){var s=PS(t,Array.isArray(e)?e:[e]);Zo[n]||(Zo[n]=new WeakMap);var o=Zo[n],l=[],a=new Set,c=new Set(s),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};s.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var y=h.getAttribute(r),x=y!==null&&y!=="false",w=(Ir.get(h)||0)+1,b=(o.get(h)||0)+1;Ir.set(h,w),o.set(h,b),l.push(h),w===1&&x&&Xo.set(h,!0),b===1&&h.setAttribute(n,"true"),x||h.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",h,m)}})};return d(t),a.clear(),va++,function(){l.forEach(function(f){var h=Ir.get(f)-1,y=o.get(f)-1;Ir.set(f,h),o.set(f,y),h||(Xo.has(f)||f.removeAttribute(r),Xo.delete(f)),y||f.removeAttribute(n)}),va--,va||(Ir=new WeakMap,Ir=new WeakMap,Xo=new WeakMap,Zo={})}},LS=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=IS(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),_S(r,s,n,"aria-hidden")):function(){return null}},Ci="Dialog",[Ig]=Ni(Ci),[MS,Dt]=Ig(Ci),Pg=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,a=p.useRef(null),c=p.useRef(null),[u,d]=Uu({prop:r,defaultProp:s??!1,onChange:o,caller:Ci});return i.jsx(MS,{scope:t,triggerRef:a,contentRef:c,contentId:Fs(),titleId:Fs(),descriptionId:Fs(),open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),modal:l,children:n})};Pg.displayName=Ci;var _g="DialogTrigger",Lg=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dt(_g,n),o=Xt(t,s.triggerRef);return i.jsx(xo.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Hu(s.open),...r,ref:o,onClick:He(e.onClick,s.onOpenToggle)})});Lg.displayName=_g;var Wu="DialogPortal",[OS,Mg]=Ig(Wu,{forceMount:void 0}),Og=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Dt(Wu,t);return i.jsx(OS,{scope:t,forceMount:n,children:p.Children.map(r,l=>i.jsx(vo,{present:n||o.open,children:i.jsx(yg,{asChild:!0,container:s,children:l})}))})};Og.displayName=Wu;var Yl="DialogOverlay",Ag=p.forwardRef((e,t)=>{const n=Mg(Yl,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Dt(Yl,e.__scopeDialog);return o.modal?i.jsx(vo,{present:r||o.open,children:i.jsx(DS,{...s,ref:t})}):null});Ag.displayName=Yl;var AS=wg("DialogOverlay.RemoveScroll"),DS=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dt(Yl,n);return i.jsx(Tg,{as:AS,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(xo.div,{"data-state":Hu(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),mr="DialogContent",Dg=p.forwardRef((e,t)=>{const n=Mg(mr,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Dt(mr,e.__scopeDialog);return i.jsx(vo,{present:r||o.open,children:o.modal?i.jsx(zS,{...s,ref:t}):i.jsx($S,{...s,ref:t})})});Dg.displayName=mr;var zS=p.forwardRef((e,t)=>{const n=Dt(mr,e.__scopeDialog),r=p.useRef(null),s=Xt(t,n.contentRef,r);return p.useEffect(()=>{const o=r.current;if(o)return LS(o)},[]),i.jsx(zg,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:He(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:He(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0;(l.button===2||a)&&o.preventDefault()}),onFocusOutside:He(e.onFocusOutside,o=>o.preventDefault())})}),$S=p.forwardRef((e,t)=>{const n=Dt(mr,e.__scopeDialog),r=p.useRef(!1),s=p.useRef(!1);return i.jsx(zg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,a;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),zg=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...l}=e,a=Dt(mr,n),c=p.useRef(null),u=Xt(t,c);return Yk(),i.jsxs(i.Fragment,{children:[i.jsx(vg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:i.jsx(mg,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Hu(a.open),...l,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(FS,{titleId:a.titleId}),i.jsx(US,{contentRef:c,descriptionId:a.descriptionId})]})]})}),Vu="DialogTitle",$g=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dt(Vu,n);return i.jsx(xo.h2,{id:s.titleId,...r,ref:t})});$g.displayName=Vu;var Fg="DialogDescription",Bg=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dt(Fg,n);return i.jsx(xo.p,{id:s.descriptionId,...r,ref:t})});Bg.displayName=Fg;var Ug="DialogClose",Wg=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dt(Ug,n);return i.jsx(xo.button,{type:"button",...r,ref:t,onClick:He(e.onClick,()=>s.onOpenChange(!1))})});Wg.displayName=Ug;function Hu(e){return e?"open":"closed"}var Vg="DialogTitleWarning",[qC,Hg]=Hb(Vg,{contentName:mr,titleName:Vu,docsSlug:"dialog"}),FS=({titleId:e})=>{const t=Hg(Vg),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
108
|
+
|
|
109
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
110
|
+
|
|
111
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},BS="DialogDescriptionWarning",US=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hg(BS).contentName}}.`;return p.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},WS=Pg,VS=Lg,HS=Og,Gg=Ag,Yg=Dg,Kg=$g,Qg=Bg,GS=Wg;/**
|
|
112
|
+
* @license lucide-react v0.460.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const YS=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Xg=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
117
|
+
* @license lucide-react v0.460.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/var KS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
122
|
+
* @license lucide-react v0.460.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const QS=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:l,...a},c)=>p.createElement("svg",{ref:c,...KS,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Xg("lucide",s),...a},[...l.map(([u,d])=>p.createElement(u,d)),...Array.isArray(o)?o:[o]]));/**
|
|
127
|
+
* @license lucide-react v0.460.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const te=(e,t)=>{const n=p.forwardRef(({className:r,...s},o)=>p.createElement(QS,{ref:o,iconNode:t,className:Xg(`lucide-${YS(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
132
|
+
* @license lucide-react v0.460.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const Kl=te("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
|
|
137
|
+
* @license lucide-react v0.460.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const XS=te("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
142
|
+
* @license lucide-react v0.460.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const ZS=te("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
147
|
+
* @license lucide-react v0.460.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const yo=te("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
152
|
+
* @license lucide-react v0.460.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const qS=te("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
157
|
+
* @license lucide-react v0.460.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const JS=te("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
162
|
+
* @license lucide-react v0.460.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const lp=te("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
167
|
+
* @license lucide-react v0.460.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const eN=te("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
172
|
+
* @license lucide-react v0.460.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const Tc=te("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
177
|
+
* @license lucide-react v0.460.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const tN=te("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
|
|
182
|
+
* @license lucide-react v0.460.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const Zg=te("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
187
|
+
* @license lucide-react v0.460.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const qg=te("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
192
|
+
* @license lucide-react v0.460.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const Jg=te("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
197
|
+
* @license lucide-react v0.460.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const xa=te("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
202
|
+
* @license lucide-react v0.460.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const ev=te("FolderKanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);/**
|
|
207
|
+
* @license lucide-react v0.460.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const ip=te("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
212
|
+
* @license lucide-react v0.460.0 - ISC
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the ISC license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const nN=te("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
|
|
217
|
+
* @license lucide-react v0.460.0 - ISC
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the ISC license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/const tv=te("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
222
|
+
* @license lucide-react v0.460.0 - ISC
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the ISC license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/const Rc=te("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
227
|
+
* @license lucide-react v0.460.0 - ISC
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the ISC license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/const nv=te("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
232
|
+
* @license lucide-react v0.460.0 - ISC
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the ISC license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/const ve=te("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
237
|
+
* @license lucide-react v0.460.0 - ISC
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the ISC license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/const rN=te("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
|
|
242
|
+
* @license lucide-react v0.460.0 - ISC
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the ISC license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/const sN=te("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
247
|
+
* @license lucide-react v0.460.0 - ISC
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the ISC license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/const oN=te("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
|
252
|
+
* @license lucide-react v0.460.0 - ISC
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the ISC license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/const rv=te("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
257
|
+
* @license lucide-react v0.460.0 - ISC
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the ISC license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const lN=te("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
262
|
+
* @license lucide-react v0.460.0 - ISC
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the ISC license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const iN=te("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
|
|
267
|
+
* @license lucide-react v0.460.0 - ISC
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the ISC license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/const aN=te("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
|
|
272
|
+
* @license lucide-react v0.460.0 - ISC
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the ISC license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/const sv=te("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
277
|
+
* @license lucide-react v0.460.0 - ISC
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the ISC license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/const Ct=te("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
282
|
+
* @license lucide-react v0.460.0 - ISC
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the ISC license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/const cN=te("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
|
|
287
|
+
* @license lucide-react v0.460.0 - ISC
|
|
288
|
+
*
|
|
289
|
+
* This source code is licensed under the ISC license.
|
|
290
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
+
*/const Ql=te("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
292
|
+
* @license lucide-react v0.460.0 - ISC
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the ISC license.
|
|
295
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
+
*/const Xl=te("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
297
|
+
* @license lucide-react v0.460.0 - ISC
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the ISC license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/const uN=te("SendHorizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
|
|
302
|
+
* @license lucide-react v0.460.0 - ISC
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the ISC license.
|
|
305
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
+
*/const ap=te("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
307
|
+
* @license lucide-react v0.460.0 - ISC
|
|
308
|
+
*
|
|
309
|
+
* This source code is licensed under the ISC license.
|
|
310
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
+
*/const dN=te("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
312
|
+
* @license lucide-react v0.460.0 - ISC
|
|
313
|
+
*
|
|
314
|
+
* This source code is licensed under the ISC license.
|
|
315
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
+
*/const ov=te("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
|
|
317
|
+
* @license lucide-react v0.460.0 - ISC
|
|
318
|
+
*
|
|
319
|
+
* This source code is licensed under the ISC license.
|
|
320
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
+
*/const gn=te("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
322
|
+
* @license lucide-react v0.460.0 - ISC
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the ISC license.
|
|
325
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
+
*/const fN=te("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
327
|
+
* @license lucide-react v0.460.0 - ISC
|
|
328
|
+
*
|
|
329
|
+
* This source code is licensed under the ISC license.
|
|
330
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
+
*/const pN=te("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
332
|
+
* @license lucide-react v0.460.0 - ISC
|
|
333
|
+
*
|
|
334
|
+
* This source code is licensed under the ISC license.
|
|
335
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
+
*/const Gu=te("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
337
|
+
* @license lucide-react v0.460.0 - ISC
|
|
338
|
+
*
|
|
339
|
+
* This source code is licensed under the ISC license.
|
|
340
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
+
*/const lv=te("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/**
|
|
342
|
+
* @license lucide-react v0.460.0 - ISC
|
|
343
|
+
*
|
|
344
|
+
* This source code is licensed under the ISC license.
|
|
345
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
+
*/const iv=te("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),hs=WS,hN=VS,mN=HS,av=p.forwardRef((e,t)=>p.createElement(Gg,Object.assign({},ze(e,["className"]),{ref:t,className:Z("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e.className)})));av.displayName=Gg.displayName;const wr=p.forwardRef((e,t)=>p.createElement(mN,null,p.createElement(av,null),p.createElement(Yg,Object.assign({},ze(e,["className","children"]),{ref:t,className:Z("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-card p-6 shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-xl",e.className)}),e.children,p.createElement(GS,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none"},p.createElement(Gu,{className:"h-4 w-4"}),p.createElement("span",{className:"sr-only"},"Close")))));wr.displayName=Yg.displayName;function br(e){return p.createElement("div",Object.assign({},ze(e,["className"]),{className:Z("flex flex-col space-y-1.5 text-center sm:text-left",e.className)}))}br.displayName="DialogHeader";function wo(e){return p.createElement("div",Object.assign({},ze(e,["className"]),{className:Z("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e.className)}))}wo.displayName="DialogFooter";const kr=p.forwardRef((e,t)=>p.createElement(Kg,Object.assign({},ze(e,["className"]),{ref:t,className:Z("text-lg font-semibold leading-none tracking-tight",e.className)})));kr.displayName=Kg.displayName;const cv=p.forwardRef((e,t)=>p.createElement(Qg,Object.assign({},ze(e,["className"]),{ref:t,className:Z("text-sm text-muted-foreground",e.className)})));cv.displayName=Qg.displayName;const uv=p.createContext(null);function gN({children:e}){const[t,n]=p.useState(!1),[r,s]=p.useState({title:null,message:"",confirmLabel:null,cancelLabel:null}),o=p.useRef(null),l=p.useCallback((f,h=null)=>new Promise(y=>{o.current=y;const x={title:null,confirmLabel:null,cancelLabel:null,message:f};h!==null&&(x.title=h.title,x.confirmLabel=h.confirmLabel,x.cancelLabel=h.cancelLabel),s(x),n(!0)}),[]);function a(f){n(!1);const h=o.current;h!==null&&h(f),o.current=null}let c="Delete?";r.title!==null&&(c=r.title);let u="Cancel";r.cancelLabel!==null&&(u=r.cancelLabel);let d="Delete";return r.confirmLabel!==null&&(d=r.confirmLabel),i.jsxs(uv.Provider,{value:{confirmDestructive:l},children:[e,i.jsx(hs,{open:t,onOpenChange:f=>{f||a(!1)},children:i.jsxs(wr,{className:"max-w-md border-white/[0.1] bg-[#111] sm:rounded-xl [&>button]:hidden",children:[i.jsxs(br,{children:[i.jsx(kr,{children:c}),i.jsx(cv,{children:r.message})]}),i.jsxs(wo,{className:"gap-2 sm:gap-2",children:[i.jsx(H,{type:"button",variant:"outline",onClick:()=>a(!1),children:u}),i.jsx(H,{type:"button",variant:"destructive",onClick:()=>a(!0),children:d})]})]})})]})}function Yu(){const e=p.useContext(uv);if(!e)throw new Error("useConfirm must be used within ConfirmDialogProvider");return e}function Ei(e={}){let t=null;"className"in e&&(e.className===null?t=null:typeof e.className=="string"&&(t=e.className));let n=!1;"compact"in e&&e.compact===!0&&(n=!0);let r="/projects";"linkTo"in e&&(e.linkTo===null?r=null:typeof e.linkTo=="string"&&(r=e.linkTo));const s=qt(),o=r,l=i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:Z("relative flex shrink-0 items-center justify-center rounded-lg bg-primary/15 ring-1 ring-primary/25",n?"h-8 w-8":"h-10 w-10"),children:[i.jsx(nv,{className:Z("text-primary",n?"h-4 w-4":"h-5 w-5")}),i.jsx(cN,{className:Z("absolute rounded-full bg-card p-0.5 text-primary",n?"-bottom-0.5 -right-0.5 h-3 w-3":"-bottom-1 -right-1 h-4 w-4")})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:Z("font-semibold tracking-tight",n?"text-sm":"text-base"),children:"Task Bridge"}),n?i.jsx("p",{className:"text-[10px] text-muted-foreground",children:"v0.1"}):null]})]});if(!o)return i.jsx("div",{className:Z("flex items-center gap-2.5",t),children:l});let a=null;return s.pathname.startsWith("/projects/")&&(a={from:s.pathname}),i.jsx(tr,{to:o,state:a,className:Z("flex items-center gap-2.5 rounded-lg transition-colors hover:bg-white/[0.04]",n?"-mx-1 px-1 py-0.5":"px-1 py-0.5",t),children:l})}const vN=ig("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",outline:"text-foreground",success:"border-transparent bg-success/15 text-success",warn:"border-transparent bg-warn/15 text-warn",muted:"border-transparent bg-muted text-muted-foreground"}},defaultVariants:{variant:"default"}});function dv(e){return p.createElement("div",Object.assign({},ze(e,["className","variant"]),{className:Z(vN({variant:e.variant}),e.className)}))}const Ku="task-bridge.session.v2";function Jt(){try{const e=localStorage.getItem(Ku);if(!e)return null;const t=JSON.parse(e),n=t.token,r=t.userId;return n===null||n.trim()===""||r===null||r.trim()===""?null:Object.assign({},t,{mustChangePassword:t.mustChangePassword===!0})}catch{return null}}function bo(e){localStorage.setItem(Ku,JSON.stringify(e))}function Qu(){localStorage.removeItem(Ku)}function Ic(e,t){const n=Jt();n&&bo(Object.assign({},n,{projectId:e,projectName:t}))}function xN(){const e=Jt();e&&bo(Object.assign({},e,{projectId:null,projectName:null}))}const ml="empty";class Wn extends Error{constructor(n,r){super(n);ge(this,"status");this.status=r}}function yN(e){return{Accept:"application/json",Authorization:`Bearer ${e.token}`}}async function wN(e){try{const t=await e.json(),n=t.details;if(n!==null&&n.code==="PASSWORD_CHANGE_REQUIRED")return"PASSWORD_CHANGE_REQUIRED";if(t.error)return t.error}catch{return e.statusText||"Request failed"}return e.statusText||"Request failed"}async function ue(e,t,n=null){let r={};if(n!==null){const c=n.headers;typeof c<"u"&&c!==null&&(r=c)}let s={};n!==null&&(s=n);const o=Object.assign({},yN(e),r),l=await fetch(t,Object.assign({},s,{headers:o}));if(l.status===401)throw Qu(),window.location.href="/app/login",new Wn("Session expired",401);if(!l.ok){const c=await wN(l);if(c==="PASSWORD_CHANGE_REQUIRED"){const u=Jt();throw u&&bo(Object.assign({},u,{mustChangePassword:!0})),window.location.href="/app/change-password",new Wn("Password change required",403)}throw new Wn(c,l.status)}if(l.status===204)return null;const a=await l.text();return a?JSON.parse(a):null}async function fv(){const e=await fetch("/api/auth/status");if(!e.ok)throw new Wn("Failed to check status",e.status);return e.json()}async function bN(e){const t=await fetch("/api/auth/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));let r="Setup failed";throw n.error!==null&&(r=n.error),new Wn(r,t.status)}return t.json()}async function kN(e){const t=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));let r="Login failed";throw n.error!==null&&(r=n.error),new Wn(r,t.status)}return t.json()}async function SN(e,t){const n=await fetch("/api/auth/change-password",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({}));let s="Password change failed";throw r.error!==null&&(s=r.error),new Wn(s,n.status)}return n.json()}function NN(e){let t="";return typeof window<"u"&&(t=window.location.origin),`taskbridge://auth?server=${encodeURIComponent(t)}&token=${encodeURIComponent(e.token)}`}async function jN(e){const t=await ue(e,"/api/admin/users");return t.users!==null?t.users:[]}async function CN(e,t){return(await ue(e,"/api/admin/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).user}async function EN(e,t,n){return(await ue(e,`/api/admin/users/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).user}async function TN(e,t){await ue(e,`/api/admin/users/${t}`,{method:"DELETE"})}async function pv(e){const t=await ue(e,"/api/projects");return t.projects!==null?t.projects:[]}async function RN(e,t){return ue(e,"/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t.name,id:t.id.trim(),repoPath:t.repoPath,description:t.description.trim(),workflowTemplateId:t.workflowTemplateId.trim()||ml})})}async function IN(e,t,n){return ue(e,`/api/projects/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}async function Xu(e){const t=await ue(e,"/api/workflow-templates");return t.items!==null?t.items:[]}async function PN(e,t){return ue(e,`/api/workflow-templates/${t}`)}async function _N(e,t){return ue(e,"/api/workflow-templates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function LN(e,t,n){return ue(e,`/api/workflow-templates/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stages:n})})}async function MN(e,t){await ue(e,`/api/workflow-templates/${t}`,{method:"DELETE"})}const ya=new Set(["ai-sdlc"]);async function cp(e,t){const n=await fetch(`/api/workflow-templates/${t}/export`,{headers:{Authorization:`Bearer ${e.token}`}});if(!n.ok)throw new Wn("Export failed",n.status);const r=await n.blob(),s=n.headers.get("Content-Disposition");let o="";s!==null&&(o=s);const l=/filename="([^"]+)"/.exec(o);let a=`${t}.json`;if(l!==null&&l.length>1){const d=l[1];typeof d=="string"&&(a=d)}const c=URL.createObjectURL(r),u=document.createElement("a");u.href=c,u.download=a,u.click(),URL.revokeObjectURL(c)}async function ON(e,t){return ue(e,"/api/workflow-templates/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function AN(e,t){let n="";return t.description!==null&&(n=t.description),ue(e,"/api/epics",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:t.projectId,title:t.title,description:n})})}async function DN(e,t){let n="";return t.description!==null&&(n=t.description),ue(e,"/api/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parentId:t.parentId,title:t.title,description:n,stageId:t.stageId})})}async function Zu(e,t={projectId:null,commentsOnly:null,epicsOnly:null,cursor:null,limit:null}){const n=new URLSearchParams;t.projectId&&n.set("projectId",t.projectId),t.commentsOnly&&n.set("commentsOnly","true"),t.epicsOnly&&n.set("epicsOnly","true"),t.cursor&&n.set("cursor",t.cursor),t.limit&&n.set("limit",String(t.limit));let r="";return n.toString()&&(r=`?${n.toString()}`),ue(e,`/api/inbox${r}`)}async function up(e,t={projectId:null,commentsOnly:null,epicsOnly:null,limit:null}){const n=[];let r=null;do{let s=100;t.limit!==null&&(s=t.limit);const o=await Zu(e,Object.assign({},t,{cursor:r,limit:s}));for(const l of o.items)n.push(l);r=o.nextCursor}while(r);return n}async function dp(e,t){return ue(e,`/api/tasks/${t}`)}async function zN(e,t,n){return ue(e,`/api/tasks/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comment:{text:n,by:"web"}})})}async function $N(e,t,n){return ue(e,`/api/tasks/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:n})})}async function hv(e,t){return ue(e,`/api/projects/${t}/workflow`)}async function FN(e,t,n){return ue(e,`/api/projects/${t}/workflow`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}async function BN(e,t,n){return ue(e,`/api/projects/${t}/members`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n.name,role:n.role})})}async function UN(e,t,n){await ue(e,`/api/projects/${t}/members/${n}`,{method:"DELETE"})}async function mv(e){const t=await ue(e,"/api/libraries");return t.items!==null?t.items:[]}async function gv(e,t){return ue(e,`/api/libraries/${t}`)}async function WN(e,t){return ue(e,"/api/libraries",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function VN(e,t,n){return ue(e,`/api/libraries/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}async function HN(e,t){await ue(e,`/api/libraries/${t}`,{method:"DELETE"})}async function GN(e,t,n){return ue(e,`/api/libraries/${t}/documents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}async function YN(e,t){return ue(e,`/api/library-documents/${t}`)}async function KN(e,t,n,r){return ue(e,`/api/libraries/${t}/documents/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}async function QN(e,t,n){await ue(e,`/api/libraries/${t}/documents/${n}`,{method:"DELETE"})}async function XN(e,t,n){const r=await ue(e,`/api/library-documents/${t}/links`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:n})});return r.items!==null?r.items:[]}async function ZN(e,t,n){await ue(e,`/api/library-documents/${t}/links/${n}`,{method:"DELETE"})}async function fp(e,t,n,r){return ue(e,`/api/tasks/${t}/work-status`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({workStatus:n,claimedBy:r})})}const Pc="task-bridge.read-tasks",_c="task-bridge.notified-comments";function qN(e){if(Number.isInteger(e))return e;if(e===null)return null;const t=String(e).trim();if(t.length===0)return null;const n=Number(t);return Number.isInteger(n)?n:null}function Ti(e){try{const t=localStorage.getItem(e);if(!t)return[];const n=JSON.parse(t);if(!Array.isArray(n))return[];const r=[];for(const s of n){const o=qN(s);o!==null&&r.push(o)}return r}catch{return[]}}function vv(e,t){localStorage.setItem(e,JSON.stringify(Array.from(new Set(t))))}function Lc(e){return Ti(Pc).includes(e)}function xv(e){Number.isInteger(e)&&(vv(Pc,Ti(Pc).concat([e])),window.dispatchEvent(new CustomEvent("task-bridge:read")))}function JN(e){return Ti(_c).includes(e)}function pp(e){Number.isInteger(e)&&vv(_c,Ti(_c).concat([e]))}function ej(e){return e.filter(t=>t.status==="ready"&&!Lc(t.taskId)).length}function tj(e,t){const[n,r]=p.useState([]),[s,o]=p.useState(!0),l=p.useRef(!1),a=p.useCallback(async()=>{if(!(!e||!t)){o(!0);try{const d=await up(e,{projectId:t,commentsOnly:!0,epicsOnly:null,limit:100});for(const h of d){if(!l.current){pp(h.taskId);continue}JN(h.taskId)||(pp(h.taskId),Y.message("A comment was added to your task",{description:h.title||`Task #${h.taskId}`}))}l.current=!0;const f=await up(e,{projectId:t,commentsOnly:null,epicsOnly:null,limit:100});r(f)}finally{o(!1)}}},[e,t]);p.useEffect(()=>{a();const d=window.setInterval(()=>void a(),3e4),f=()=>void a();return window.addEventListener("task-bridge:read",f),()=>{window.clearInterval(d),window.removeEventListener("task-bridge:read",f)}},[a]);const c=n.filter(d=>d.status==="ready"),u=n.filter(d=>d.status==="sent");return{items:n,commentItems:c,openItems:u,loading:s,refresh:a}}function zt(){const[e]=p.useState(()=>Jt());return e}const hp={admin:"Admin","read-write":"Read & Write",read:"Read only"};function nj(){const e=qt(),t=yn(),n=zt(),r=Vl("/projects/:projectId/*",e.pathname);let s=null;if(r!==null){const y=r.params.projectId;typeof y=="string"&&y.length>0&&(s=y)}let o=s;o===null&&n!==null&&n.projectId!==null&&(o=n.projectId);const l=s;let a=l;n!==null&&n.projectName!==null?a=n.projectName:l===null&&o!==null&&(a=o);const{commentItems:c}=tj(n,l),u=ej(c);function d(){Qu(),t("/login",{replace:!0})}const f=n!==null&&n.userRole==="admin";let h="";if(n!==null){const y=n.userRole;if(y in hp){const x=hp[y];typeof x=="string"&&(h=x)}h===""&&(h=y)}return i.jsxs("aside",{className:"app-sidebar",children:[i.jsx("div",{className:"flex h-14 shrink-0 items-center border-b border-white/[0.07] px-4",children:i.jsx(Ei,{compact:!0})}),i.jsxs("nav",{className:"flex-1 space-y-4 overflow-y-auto px-2 py-3",children:[i.jsxs("div",{className:"space-y-0.5",children:[i.jsx(nn,{to:"/projects",label:"Projects",icon:ev,end:!0}),i.jsx(nn,{to:"/library",label:"Library",icon:Kl}),i.jsx(nn,{to:"/workflow-templates",label:"Workflow templates",icon:ip})]}),l?i.jsxs("div",{className:"space-y-0.5",children:[i.jsx("p",{className:"truncate px-3 pb-1 text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:a}),i.jsx(nn,{to:`/projects/${l}/tasks`,label:"Epics",icon:Rc}),i.jsx(nn,{to:`/projects/${l}/inbox`,label:"Inbox",icon:nN,badge:u}),i.jsx(nn,{to:`/projects/${l}/mobile`,label:"Mobile",icon:ov}),i.jsx(nn,{to:`/projects/${l}/workflow`,label:"Pipeline",icon:ip})]}):o?i.jsxs("div",{className:"space-y-0.5",children:[i.jsx("p",{className:"px-3 pb-1 text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:"Recent project"}),i.jsx(nn,{to:`/projects/${o}/tasks`,label:a!==null?a:"Open project",icon:Rc})]}):null,f?i.jsxs("div",{className:"space-y-0.5",children:[i.jsx("p",{className:"px-3 pb-1 text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:"Admin"}),i.jsx(nn,{to:"/admin/users",label:"Team members",icon:pN})]}):null]}),i.jsxs("div",{className:"shrink-0 border-t border-white/[0.07] p-2 space-y-1",children:[n?i.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg px-3 py-2",children:[i.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-primary/20 text-xs font-semibold text-primary uppercase",children:n.userName.charAt(0)}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"truncate text-sm font-medium text-foreground leading-none",children:n.userName}),i.jsx("p",{className:"truncate text-[11px] text-muted-foreground mt-0.5",children:h})]}),i.jsx(dv,{variant:"outline",className:"text-[10px] px-1.5 py-0 shrink-0 hidden sm:flex",children:h})]}):null,i.jsxs(H,{variant:"ghost",size:"sm",className:"h-9 w-full justify-start rounded-lg text-muted-foreground hover:bg-white/[0.05] hover:text-foreground",onClick:d,children:[i.jsx(sN,{className:"h-4 w-4"}),"Sign out"]})]})]})}function nn(e){let t=0;"badge"in e&&typeof e.badge=="number"&&(t=e.badge);let n=!1;"end"in e&&e.end===!0&&(n=!0);const{to:r,label:s,icon:o}=e;return i.jsxs(jw,{to:r,end:n,className:({isActive:l})=>Z("flex h-9 items-center gap-2.5 rounded-lg px-3 text-sm transition-colors",l?"bg-white/[0.09] font-medium text-white":"text-muted-foreground hover:bg-white/[0.04] hover:text-foreground"),children:[i.jsx(o,{className:"h-4 w-4 shrink-0 opacity-90"}),i.jsx("span",{className:"flex-1 truncate",children:s}),i.jsx("span",{className:Z("flex h-5 min-w-[1.25rem] items-center justify-center rounded-full px-1.5 text-[11px] font-medium",t>0?"bg-primary text-primary-foreground":"invisible"),"aria-hidden":t<=0,children:t>0?t:0})]})}function rj(){return i.jsxs("div",{className:"app-shell",children:[i.jsx(nj,{}),i.jsx("main",{className:"app-main flex min-h-0 flex-1 flex-col overflow-y-auto",children:i.jsx(ng,{})})]})}function sj(){const{projectId:e}=fs(),t=yn(),n=zt(),r=p.useRef(null);return p.useEffect(()=>{if(!n||!e||r.current===e)return;let s=!0;return pv(n).then(o=>{if(!s)return;const l=o.find(a=>a.id===e);if(!l){t("/projects",{replace:!0});return}Ic(l.id,l.name),r.current=e}),()=>{s=!1}},[n,e,t]),n?e?i.jsx(ng,{}):i.jsx(qe,{to:"/projects",replace:!0}):i.jsx(qe,{to:"/login",replace:!0})}function yv(e){let t=!1;"loading"in e&&(t=e.loading===!0);const{loaded:n,hasMore:r,onLoadMore:s}=e;return n===0&&!r?null:i.jsxs("div",{className:"flex flex-col items-center gap-2 pt-2",children:[i.jsxs("p",{className:"text-xs text-muted-foreground",children:[n," loaded"]}),r?i.jsxs(H,{variant:"outline",size:"sm",disabled:t,onClick:s,children:[t?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):null,"Load more"]}):n>0?i.jsx("p",{className:"text-xs text-muted-foreground",children:"End of list"}):null]})}function bn(e){let t=null;"breadcrumb"in e&&(e.breadcrumb===null?t=null:Array.isArray(e.breadcrumb)&&(t=e.breadcrumb));let n=null;"subtitle"in e&&(e.subtitle===null?n=null:typeof e.subtitle=="string"&&(n=e.subtitle));let r=null;"actions"in e&&e.actions!==null&&(r=e.actions);let s=null;"className"in e&&(e.className===null?s=null:typeof e.className=="string"&&(s=e.className));const{title:o}=e;return i.jsxs("div",{className:Z("page-toolbar flex-wrap",s),children:[i.jsxs("div",{className:"min-w-0",children:[t&&t.length>0?i.jsx(oj,{items:t}):null,i.jsx("h1",{className:"truncate text-lg font-semibold tracking-tight text-white",children:o}),n?i.jsx("p",{className:"text-xs text-muted-foreground",children:n}):null]}),r?i.jsx("div",{className:"flex flex-wrap items-center gap-2",children:r}):null]})}function oj({items:e}){return i.jsx("nav",{className:"mb-1 flex items-center gap-1 text-xs text-muted-foreground",children:e.map((t,n)=>{const r=n===e.length-1;return i.jsxs(p.Fragment,{children:[t.to&&!r?i.jsx(tr,{to:t.to,className:"max-w-[12rem] truncate transition-colors hover:text-foreground",children:t.label}):i.jsx("span",{className:Z("max-w-[12rem] truncate",r&&"text-foreground"),children:t.label}),r?null:i.jsx(yo,{className:"h-3 w-3 shrink-0 opacity-60"})]},`${t.label}-${n}`)})})}const Kt=p.forwardRef((e,t)=>p.createElement("div",Object.assign({},ze(e,["className"]),{ref:t,className:Z("panel-card text-card-foreground",e.className)})));Kt.displayName="Card";const Vn=p.forwardRef((e,t)=>p.createElement("div",Object.assign({},ze(e,["className"]),{ref:t,className:Z("flex flex-col space-y-1.5 p-5",e.className)})));Vn.displayName="CardHeader";const Hn=p.forwardRef((e,t)=>p.createElement("h3",Object.assign({},ze(e,["className"]),{ref:t,className:Z("text-lg font-semibold leading-none tracking-tight",e.className)})));Hn.displayName="CardTitle";const ko=p.forwardRef((e,t)=>p.createElement("p",Object.assign({},ze(e,["className"]),{ref:t,className:Z("text-sm text-muted-foreground",e.className)})));ko.displayName="CardDescription";const Qt=p.forwardRef((e,t)=>p.createElement("div",Object.assign({},ze(e,["className"]),{ref:t,className:Z("p-5 pt-0",e.className)})));Qt.displayName="CardContent";function dn(e){return p.createElement("div",Object.assign({},ze(e,["className"]),{className:Z("animate-pulse rounded-md bg-muted",e.className)}))}const lj=20;function ij(){const e=fs();let t=null;typeof e.projectId=="string"&&e.projectId.length>0&&(t=e.projectId);const n=zt(),[r,s]=p.useState([]),[o,l]=p.useState(null),[a,c]=p.useState(!1),[u,d]=p.useState(!0),[f,h]=p.useState(!1),y=p.useCallback(async(v,g)=>{if(!(!n||!t)){g?h(!0):d(!0);try{const k=await Zu(n,{projectId:t,commentsOnly:!0,epicsOnly:null,cursor:v,limit:lj});s(j=>g?j.concat(k.items):k.items),l(k.nextCursor),c(k.hasMore)}catch(k){Y.error(k instanceof Error?k.message:"Failed to load inbox")}finally{d(!1),h(!1)}}},[n,t]),x=p.useCallback(()=>{y(null,!1)},[y]);p.useEffect(()=>{y(null,!1)},[y]),p.useEffect(()=>{const v=()=>{s(g=>g.slice())};return window.addEventListener("task-bridge:read",v),()=>window.removeEventListener("task-bridge:read",v)},[]);const w=r.filter(v=>!Lc(v.taskId)).length;let b="Project";n!==null&&n.projectName!==null?b=n.projectName:t!==null&&(b=t);let m="/projects";return t!==null&&(m=`/projects/${t}/tasks`),i.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.jsx(bn,{breadcrumb:[{label:"Projects",to:"/projects"},{label:b,to:m},{label:"Inbox",to:null}],title:"Inbox",subtitle:w>0?`${w} unread`:"All caught up",actions:i.jsxs(H,{variant:"outline",size:"sm",onClick:x,disabled:u||f,children:[u?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(Ql,{className:"h-4 w-4"}),"Refresh"]})}),i.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:i.jsxs(Kt,{children:[i.jsxs(Vn,{children:[i.jsxs(Hn,{className:"flex items-center gap-2 text-lg",children:[i.jsx(lN,{className:"h-5 w-5 text-primary"}),"Notifications"]}),i.jsx(ko,{children:w>0?`${w} unread`:"You are all caught up."})]}),i.jsxs(Qt,{className:"space-y-3",children:[u&&r.length===0?i.jsxs(i.Fragment,{children:[i.jsx(dn,{className:"h-16 w-full"}),i.jsx(dn,{className:"h-16 w-full"})]}):r.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:"No comments yet."}):r.map(v=>{const g=!Lc(v.taskId);return i.jsxs(tr,{to:`/projects/${t}/tasks/${v.taskId}`,onClick:()=>{g&&xv(v.taskId)},className:Z("flex items-center justify-between rounded-xl border px-4 py-3 transition-colors",g?"border-primary/20 bg-primary/5 hover:border-primary/40 hover:bg-primary/10":"border-border/60 bg-background/40 opacity-80 hover:bg-accent/20"),children:[i.jsxs("div",{className:"min-w-0 pr-3",children:[i.jsx("p",{className:"text-sm font-medium",children:g?"A comment was added to your task":"Comment on your task"}),i.jsx("p",{className:"truncate text-sm text-muted-foreground",children:v.title||`Task #${v.taskId}`}),v.preview?i.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:v.preview}):null,i.jsx("p",{className:"text-xs text-muted-foreground",children:Bu(v.activityAt!==null?v.activityAt:v.updatedAt!==null?v.updatedAt:v.createdAt)})]}),i.jsx(yo,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},v.taskId)}),i.jsx(yv,{loaded:r.length,hasMore:a,loading:f,onLoadMore:()=>{y(o,!0)}})]})]})})]})}const Ne=p.forwardRef((e,t)=>p.createElement("input",Object.assign({},ze(e,["className","type"]),{type:e.type,className:Z("flex h-10 w-full rounded-xl border border-white/[0.1] bg-[#111111] px-3 py-2 text-sm text-foreground ring-offset-black file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:cursor-not-allowed disabled:opacity-50",e.className),ref:t})));Ne.displayName="Input";const xe=p.forwardRef((e,t)=>p.createElement("label",Object.assign({},ze(e,["className"]),{ref:t,className:Z("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e.className)})));xe.displayName="Label";function aj({session:e}){const t=yn(),[n,r]=p.useState(""),[s,o]=p.useState(""),[l,a]=p.useState(""),[c,u]=p.useState(""),[d,f]=p.useState(!1);async function h(x){if(x.preventDefault(),u(""),s.length<6){u("New password must be at least 6 characters");return}if(s!==l){u("New passwords do not match");return}f(!0);try{await SN(e,{currentPassword:n,newPassword:s}),bo(Object.assign({},e,{mustChangePassword:!1})),t("/projects",{replace:!0})}catch(w){u(w instanceof Error?w.message:"Password change failed")}finally{f(!1)}}function y(){Qu(),t("/login",{replace:!0})}return i.jsx("div",{className:"flex h-full items-center justify-center bg-background px-4",children:i.jsxs(Kt,{className:"w-full max-w-md border-white/[0.08] bg-card shadow-2xl",children:[i.jsxs(Vn,{className:"space-y-6 text-center",children:[i.jsx("div",{className:"flex justify-center",children:i.jsx(Ei,{})}),i.jsxs("div",{children:[i.jsx(Hn,{className:"text-2xl",children:"Change your password"}),i.jsx(ko,{className:"mt-2",children:"You must set a new password before using Task Bridge."})]})]}),i.jsxs(Qt,{className:"space-y-5",children:[i.jsxs("form",{onSubmit:x=>void h(x),className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(xe,{htmlFor:"current-password",children:"Current password"}),i.jsxs("div",{className:"relative",children:[i.jsx(tv,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),i.jsx(Ne,{id:"current-password",type:"password",className:"pl-10",value:n,onChange:x=>r(x.target.value),required:!0,disabled:d})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(xe,{htmlFor:"new-password",children:"New password"}),i.jsx(Ne,{id:"new-password",type:"password",value:s,onChange:x=>o(x.target.value),required:!0,disabled:d,minLength:6})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(xe,{htmlFor:"confirm-password",children:"Confirm new password"}),i.jsx(Ne,{id:"confirm-password",type:"password",value:l,onChange:x=>a(x.target.value),required:!0,disabled:d,minLength:6})]}),c&&i.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:c}),i.jsx(H,{type:"submit",className:"h-11 w-full",disabled:d,children:d?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):"Update password"})]}),i.jsx(H,{type:"button",variant:"ghost",className:"w-full",onClick:y,children:"Sign out"})]})]})})}function cj(){const e=Jt();return e?e.mustChangePassword?i.jsx(aj,{session:e}):i.jsx(qe,{to:"/projects",replace:!0}):i.jsx(qe,{to:"/login",replace:!0})}function uj(){const e=yn(),[t,n]=p.useState(""),[r,s]=p.useState(""),[o,l]=p.useState(""),[a,c]=p.useState(!1),[u,d]=p.useState(!0);p.useEffect(()=>{const h=Jt();if(h){if(h.mustChangePassword){e("/change-password",{replace:!0});return}e(h.projectId?`/projects/${h.projectId}/tasks`:"/projects",{replace:!0});return}fv().then(({hasUsers:y})=>{y||e("/setup",{replace:!0})}).catch(()=>{}).finally(()=>d(!1))},[e]);async function f(h){h.preventDefault(),l(""),c(!0);try{const y=await kN({email:t,password:r});if(bo({token:y.token,userId:y.user.id,userName:y.user.name,userEmail:y.user.email,userRole:y.user.role,isSystemAdmin:y.user.isSystemAdmin,mustChangePassword:y.user.mustChangePassword,projectId:null,projectName:null}),y.user.mustChangePassword){e("/change-password",{replace:!0});return}e("/projects",{replace:!0})}catch(y){l(y instanceof Error?y.message:"Login failed")}finally{c(!1)}}return u?i.jsx("div",{className:"flex h-full items-center justify-center",children:i.jsx(ve,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex h-full items-center justify-center bg-background px-4",children:i.jsxs(Kt,{className:"w-full max-w-md border-white/[0.08] bg-card shadow-2xl",children:[i.jsxs(Vn,{className:"space-y-6 text-center",children:[i.jsx("div",{className:"flex justify-center",children:i.jsx(Ei,{})}),i.jsxs("div",{children:[i.jsx(Hn,{className:"text-2xl",children:"Sign in"}),i.jsx(ko,{className:"mt-2",children:"Enter your email and password to continue"})]})]}),i.jsx(Qt,{className:"space-y-5",children:i.jsxs("form",{onSubmit:h=>void f(h),className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(xe,{htmlFor:"email",children:"Email"}),i.jsxs("div",{className:"relative",children:[i.jsx(oN,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),i.jsx(Ne,{id:"email",type:"email",className:"pl-10",value:t,onChange:h=>n(h.target.value),placeholder:"you@example.com",required:!0,disabled:a})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(xe,{htmlFor:"password",children:"Password"}),i.jsxs("div",{className:"relative",children:[i.jsx(tv,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),i.jsx(Ne,{id:"password",type:"password",className:"pl-10",value:r,onChange:h=>s(h.target.value),placeholder:"••••••••",required:!0,disabled:a,onKeyDown:h=>{if(h.key==="Enter"){h.preventDefault();const y=h.currentTarget.form;y&&y.requestSubmit()}}})]})]}),o&&i.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:o}),i.jsxs(H,{type:"submit",className:"h-11 w-full",disabled:a,children:[a?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(rN,{className:"h-4 w-4"}),"Sign in"]})]})})]})})}function dj(){const e=yn(),[t,n]=p.useState(""),[r,s]=p.useState(""),[o,l]=p.useState(""),[a,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(!1);p.useEffect(()=>{fv().then(({hasUsers:x})=>{x&&e("/login",{replace:!0})}).catch(()=>{})},[e]);async function y(x){if(x.preventDefault(),d(""),o!==a){d("Passwords do not match");return}if(o.length<6){d("Password must be at least 6 characters");return}h(!0);try{await bN({name:t,email:r,password:o}),e("/login",{replace:!0})}catch(w){d(w instanceof Error?w.message:"Setup failed")}finally{h(!1)}}return i.jsx("div",{className:"flex h-full items-center justify-center bg-background px-4",children:i.jsxs(Kt,{className:"w-full max-w-md border-white/[0.08] bg-card shadow-2xl",children:[i.jsxs(Vn,{className:"space-y-6 text-center",children:[i.jsx("div",{className:"flex justify-center",children:i.jsx(Ei,{})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-center gap-2 mb-1",children:[i.jsx(ap,{className:"h-5 w-5 text-primary"}),i.jsx(Hn,{className:"text-2xl",children:"Admin Setup"})]}),i.jsx(ko,{children:"Create the administrator account to get started"})]})]}),i.jsx(Qt,{children:i.jsxs("form",{onSubmit:x=>void y(x),className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(xe,{htmlFor:"name",children:"Full Name"}),i.jsx(Ne,{id:"name",type:"text",value:t,onChange:x=>n(x.target.value),placeholder:"John Doe",required:!0,disabled:f})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(xe,{htmlFor:"email",children:"Email"}),i.jsx(Ne,{id:"email",type:"email",value:r,onChange:x=>s(x.target.value),placeholder:"admin@example.com",required:!0,disabled:f})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(xe,{htmlFor:"password",children:"Password"}),i.jsx(Ne,{id:"password",type:"password",value:o,onChange:x=>l(x.target.value),placeholder:"Min. 6 characters",required:!0,disabled:f})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(xe,{htmlFor:"confirm",children:"Confirm Password"}),i.jsx(Ne,{id:"confirm",type:"password",value:a,onChange:x=>c(x.target.value),placeholder:"Repeat password",required:!0,disabled:f})]}),u&&i.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:u}),i.jsxs(H,{type:"submit",className:"h-11 w-full",disabled:f,children:[f?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(ap,{className:"h-4 w-4"}),"Create Admin Account"]})]})})]})})}const Zl=p.forwardRef((e,t)=>p.createElement("select",Object.assign({},ze(e,["className","style"]),{className:Z("flex h-10 w-full rounded-xl border border-white/[0.1] bg-[#111111] px-3 py-2 text-sm text-foreground ring-offset-black focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:cursor-not-allowed disabled:opacity-50",e.className),style:e.style,ref:t})));Zl.displayName="Select";const mp={admin:"Admin","read-write":"Read & Write",read:"Read only"},gp={admin:"default","read-write":"secondary",read:"outline"};function fj(){const e=zt(),[t,n]=p.useState([]),[r,s]=p.useState(!0),[o,l]=p.useState(!1),[a,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[y,x]=p.useState("read-write"),[w,b]=p.useState(!1),[m,v]=p.useState(""),g=p.useCallback(async()=>{if(e)try{s(!0),n(await jN(e))}catch{Y.error("Failed to load users")}finally{s(!1)}},[e]);p.useEffect(()=>{g()},[g]);async function k(S){if(S.preventDefault(),!!e){v(""),b(!0);try{const C=await CN(e,{name:a,email:u,password:f,role:y});n(U=>U.concat([C])),l(!1),c(""),d(""),h(""),x("read-write"),Y.success("User created")}catch(C){v(C instanceof Error?C.message:"Failed to create user")}finally{b(!1)}}}async function j(S,C){if(e&&confirm(`Remove ${C}? This cannot be undone.`))try{await TN(e,S),n(U=>U.filter(T=>T.id!==S)),Y.success("User removed")}catch(U){Y.error(U instanceof Error?U.message:"Failed to remove user")}}async function E(S,C){if(e)try{const U=await EN(e,S,{name:null,role:C});n(T=>T.map(V=>V.id===S?U:V)),Y.success("Role updated")}catch(U){Y.error(U instanceof Error?U.message:"Failed to update role")}}return e?i.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.jsx(bn,{title:"Team members",subtitle:"Manage who can sign in and what they can access",actions:i.jsxs(hs,{open:o,onOpenChange:l,children:[i.jsx(hN,{asChild:!0,children:i.jsxs(H,{size:"sm",children:[i.jsx(Ct,{className:"h-4 w-4"}),"Add member"]})}),i.jsxs(wr,{className:"border-white/[0.08] bg-[#111111]",children:[i.jsx(br,{children:i.jsx(kr,{children:"Add team member"})}),i.jsxs("form",{onSubmit:S=>void k(S),className:"space-y-4 pt-2",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(xe,{children:"Full name"}),i.jsx(Ne,{value:a,onChange:S=>c(S.target.value),placeholder:"Jane Smith",required:!0})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(xe,{children:"Email"}),i.jsx(Ne,{type:"email",value:u,onChange:S=>d(S.target.value),placeholder:"jane@example.com",required:!0})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(xe,{children:"Password"}),i.jsx(Ne,{type:"password",value:f,onChange:S=>h(S.target.value),placeholder:"Min. 6 characters",required:!0,minLength:6})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(xe,{children:"Role"}),i.jsxs(Zl,{value:y,onChange:S=>x(S.target.value),children:[i.jsx("option",{value:"read",children:"Read only"}),i.jsx("option",{value:"read-write",children:"Read & Write"}),i.jsx("option",{value:"admin",children:"Admin"})]})]}),m?i.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:m}):null,i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(H,{type:"button",variant:"ghost",onClick:()=>l(!1),children:"Cancel"}),i.jsxs(H,{type:"submit",disabled:w,children:[w?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):null,w?"Creating…":"Create"]})]})]})]})]})}),i.jsx("div",{className:"flex-1 overflow-y-auto px-8 py-6",children:r?i.jsx("div",{className:"flex items-center justify-center py-16",children:i.jsx(ve,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):t.length===0?i.jsx("div",{className:"panel-card p-10 text-center text-sm text-muted-foreground",children:"No team members yet. Add one to get started."}):i.jsx("div",{className:"panel-card divide-y divide-white/[0.06] overflow-hidden",children:t.map(S=>i.jsxs("div",{className:"flex items-center justify-between gap-4 px-5 py-4",children:[i.jsxs("div",{className:"min-w-0 space-y-0.5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary/15 text-xs font-semibold uppercase text-primary",children:S.name.charAt(0)}),i.jsx("span",{className:"truncate font-medium text-white",children:S.name}),S.isSystemAdmin?i.jsx("span",{title:"System admin — cannot be deleted",children:i.jsx(dN,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})}):null]}),i.jsx("p",{className:"truncate pl-10 text-sm text-muted-foreground",children:S.email})]}),i.jsxs("div",{className:"ml-4 flex shrink-0 items-center gap-3",children:[S.isSystemAdmin?i.jsx(dv,{variant:S.role in gp?gp[S.role]:"outline",children:S.role in mp?mp[S.role]:S.role}):i.jsxs(Zl,{value:S.role,onChange:C=>void E(S.id,C.target.value),className:"h-9 w-auto min-w-[9.5rem] py-1 text-xs",children:[i.jsx("option",{value:"read",children:"Read only"}),i.jsx("option",{value:"read-write",children:"Read & Write"}),i.jsx("option",{value:"admin",children:"Admin"})]}),S.isSystemAdmin?null:i.jsx(H,{size:"icon",variant:"ghost",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:()=>void j(S.id,S.name),title:"Remove user",children:i.jsx(gn,{className:"h-4 w-4"})})]})]},S.id))})})]}):null}var pj=Object.defineProperty,ql=Object.getOwnPropertySymbols,wv=Object.prototype.hasOwnProperty,bv=Object.prototype.propertyIsEnumerable,vp=(e,t,n)=>t in e?pj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mc=(e,t)=>{for(var n in t||(t={}))wv.call(t,n)&&vp(e,n,t[n]);if(ql)for(var n of ql(t))bv.call(t,n)&&vp(e,n,t[n]);return e},Oc=(e,t)=>{var n={};for(var r in e)wv.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ql)for(var r of ql(e))t.indexOf(r)<0&&bv.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
347
|
+
* @license QR Code generator library (TypeScript)
|
|
348
|
+
* Copyright (c) Project Nayuki.
|
|
349
|
+
* SPDX-License-Identifier: MIT
|
|
350
|
+
*/var gr;(e=>{const t=class ie{constructor(c,u,d,f){if(this.version=c,this.errorCorrectionLevel=u,this.modules=[],this.isFunction=[],c<ie.MIN_VERSION||c>ie.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let h=[];for(let x=0;x<this.size;x++)h.push(!1);for(let x=0;x<this.size;x++)this.modules.push(h.slice()),this.isFunction.push(h.slice());this.drawFunctionPatterns();const y=this.addEccAndInterleave(d);if(this.drawCodewords(y),f==-1){let x=1e9;for(let w=0;w<8;w++){this.applyMask(w),this.drawFormatBits(w);const b=this.getPenaltyScore();b<x&&(f=w,x=b),this.applyMask(w)}}s(0<=f&&f<=7),this.mask=f,this.applyMask(f),this.drawFormatBits(f),this.isFunction=[]}static encodeText(c,u){const d=e.QrSegment.makeSegments(c);return ie.encodeSegments(d,u)}static encodeBinary(c,u){const d=e.QrSegment.makeBytes(c);return ie.encodeSegments([d],u)}static encodeSegments(c,u,d=1,f=40,h=-1,y=!0){if(!(ie.MIN_VERSION<=d&&d<=f&&f<=ie.MAX_VERSION)||h<-1||h>7)throw new RangeError("Invalid value");let x,w;for(x=d;;x++){const g=ie.getNumDataCodewords(x,u)*8,k=l.getTotalBits(c,x);if(k<=g){w=k;break}if(x>=f)throw new RangeError("Data too long")}for(const g of[ie.Ecc.MEDIUM,ie.Ecc.QUARTILE,ie.Ecc.HIGH])y&&w<=ie.getNumDataCodewords(x,g)*8&&(u=g);let b=[];for(const g of c){n(g.mode.modeBits,4,b),n(g.numChars,g.mode.numCharCountBits(x),b);for(const k of g.getData())b.push(k)}s(b.length==w);const m=ie.getNumDataCodewords(x,u)*8;s(b.length<=m),n(0,Math.min(4,m-b.length),b),n(0,(8-b.length%8)%8,b),s(b.length%8==0);for(let g=236;b.length<m;g^=253)n(g,8,b);let v=[];for(;v.length*8<b.length;)v.push(0);return b.forEach((g,k)=>v[k>>>3]|=g<<7-(k&7)),new ie(x,u,v,h)}getModule(c,u){return 0<=c&&c<this.size&&0<=u&&u<this.size&&this.modules[u][c]}getModules(){return this.modules}drawFunctionPatterns(){for(let d=0;d<this.size;d++)this.setFunctionModule(6,d,d%2==0),this.setFunctionModule(d,6,d%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const c=this.getAlignmentPatternPositions(),u=c.length;for(let d=0;d<u;d++)for(let f=0;f<u;f++)d==0&&f==0||d==0&&f==u-1||d==u-1&&f==0||this.drawAlignmentPattern(c[d],c[f]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(c){const u=this.errorCorrectionLevel.formatBits<<3|c;let d=u;for(let h=0;h<10;h++)d=d<<1^(d>>>9)*1335;const f=(u<<10|d)^21522;s(f>>>15==0);for(let h=0;h<=5;h++)this.setFunctionModule(8,h,r(f,h));this.setFunctionModule(8,7,r(f,6)),this.setFunctionModule(8,8,r(f,7)),this.setFunctionModule(7,8,r(f,8));for(let h=9;h<15;h++)this.setFunctionModule(14-h,8,r(f,h));for(let h=0;h<8;h++)this.setFunctionModule(this.size-1-h,8,r(f,h));for(let h=8;h<15;h++)this.setFunctionModule(8,this.size-15+h,r(f,h));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let c=this.version;for(let d=0;d<12;d++)c=c<<1^(c>>>11)*7973;const u=this.version<<12|c;s(u>>>18==0);for(let d=0;d<18;d++){const f=r(u,d),h=this.size-11+d%3,y=Math.floor(d/3);this.setFunctionModule(h,y,f),this.setFunctionModule(y,h,f)}}drawFinderPattern(c,u){for(let d=-4;d<=4;d++)for(let f=-4;f<=4;f++){const h=Math.max(Math.abs(f),Math.abs(d)),y=c+f,x=u+d;0<=y&&y<this.size&&0<=x&&x<this.size&&this.setFunctionModule(y,x,h!=2&&h!=4)}}drawAlignmentPattern(c,u){for(let d=-2;d<=2;d++)for(let f=-2;f<=2;f++)this.setFunctionModule(c+f,u+d,Math.max(Math.abs(f),Math.abs(d))!=1)}setFunctionModule(c,u,d){this.modules[u][c]=d,this.isFunction[u][c]=!0}addEccAndInterleave(c){const u=this.version,d=this.errorCorrectionLevel;if(c.length!=ie.getNumDataCodewords(u,d))throw new RangeError("Invalid argument");const f=ie.NUM_ERROR_CORRECTION_BLOCKS[d.ordinal][u],h=ie.ECC_CODEWORDS_PER_BLOCK[d.ordinal][u],y=Math.floor(ie.getNumRawDataModules(u)/8),x=f-y%f,w=Math.floor(y/f);let b=[];const m=ie.reedSolomonComputeDivisor(h);for(let g=0,k=0;g<f;g++){let j=c.slice(k,k+w-h+(g<x?0:1));k+=j.length;const E=ie.reedSolomonComputeRemainder(j,m);g<x&&j.push(0),b.push(j.concat(E))}let v=[];for(let g=0;g<b[0].length;g++)b.forEach((k,j)=>{(g!=w-h||j>=x)&&v.push(k[g])});return s(v.length==y),v}drawCodewords(c){if(c.length!=Math.floor(ie.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let u=0;for(let d=this.size-1;d>=1;d-=2){d==6&&(d=5);for(let f=0;f<this.size;f++)for(let h=0;h<2;h++){const y=d-h,w=(d+1&2)==0?this.size-1-f:f;!this.isFunction[w][y]&&u<c.length*8&&(this.modules[w][y]=r(c[u>>>3],7-(u&7)),u++)}}s(u==c.length*8)}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let u=0;u<this.size;u++)for(let d=0;d<this.size;d++){let f;switch(c){case 0:f=(d+u)%2==0;break;case 1:f=u%2==0;break;case 2:f=d%3==0;break;case 3:f=(d+u)%3==0;break;case 4:f=(Math.floor(d/3)+Math.floor(u/2))%2==0;break;case 5:f=d*u%2+d*u%3==0;break;case 6:f=(d*u%2+d*u%3)%2==0;break;case 7:f=((d+u)%2+d*u%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[u][d]&&f&&(this.modules[u][d]=!this.modules[u][d])}}getPenaltyScore(){let c=0;for(let h=0;h<this.size;h++){let y=!1,x=0,w=[0,0,0,0,0,0,0];for(let b=0;b<this.size;b++)this.modules[h][b]==y?(x++,x==5?c+=ie.PENALTY_N1:x>5&&c++):(this.finderPenaltyAddHistory(x,w),y||(c+=this.finderPenaltyCountPatterns(w)*ie.PENALTY_N3),y=this.modules[h][b],x=1);c+=this.finderPenaltyTerminateAndCount(y,x,w)*ie.PENALTY_N3}for(let h=0;h<this.size;h++){let y=!1,x=0,w=[0,0,0,0,0,0,0];for(let b=0;b<this.size;b++)this.modules[b][h]==y?(x++,x==5?c+=ie.PENALTY_N1:x>5&&c++):(this.finderPenaltyAddHistory(x,w),y||(c+=this.finderPenaltyCountPatterns(w)*ie.PENALTY_N3),y=this.modules[b][h],x=1);c+=this.finderPenaltyTerminateAndCount(y,x,w)*ie.PENALTY_N3}for(let h=0;h<this.size-1;h++)for(let y=0;y<this.size-1;y++){const x=this.modules[h][y];x==this.modules[h][y+1]&&x==this.modules[h+1][y]&&x==this.modules[h+1][y+1]&&(c+=ie.PENALTY_N2)}let u=0;for(const h of this.modules)u=h.reduce((y,x)=>y+(x?1:0),u);const d=this.size*this.size,f=Math.ceil(Math.abs(u*20-d*10)/d)-1;return s(0<=f&&f<=9),c+=f*ie.PENALTY_N4,s(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return[];{const c=Math.floor(this.version/7)+2,u=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2;let d=[6];for(let f=this.size-7;d.length<c;f-=u)d.splice(1,0,f);return d}}static getNumRawDataModules(c){if(c<ie.MIN_VERSION||c>ie.MAX_VERSION)throw new RangeError("Version number out of range");let u=(16*c+128)*c+64;if(c>=2){const d=Math.floor(c/7)+2;u-=(25*d-10)*d-55,c>=7&&(u-=36)}return s(208<=u&&u<=29648),u}static getNumDataCodewords(c,u){return Math.floor(ie.getNumRawDataModules(c)/8)-ie.ECC_CODEWORDS_PER_BLOCK[u.ordinal][c]*ie.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let u=[];for(let f=0;f<c-1;f++)u.push(0);u.push(1);let d=1;for(let f=0;f<c;f++){for(let h=0;h<u.length;h++)u[h]=ie.reedSolomonMultiply(u[h],d),h+1<u.length&&(u[h]^=u[h+1]);d=ie.reedSolomonMultiply(d,2)}return u}static reedSolomonComputeRemainder(c,u){let d=u.map(f=>0);for(const f of c){const h=f^d.shift();d.push(0),u.forEach((y,x)=>d[x]^=ie.reedSolomonMultiply(y,h))}return d}static reedSolomonMultiply(c,u){if(c>>>8||u>>>8)throw new RangeError("Byte out of range");let d=0;for(let f=7;f>=0;f--)d=d<<1^(d>>>7)*285,d^=(u>>>f&1)*c;return s(d>>>8==0),d}finderPenaltyCountPatterns(c){const u=c[1];s(u<=this.size*3);const d=u>0&&c[2]==u&&c[3]==u*3&&c[4]==u&&c[5]==u;return(d&&c[0]>=u*4&&c[6]>=u?1:0)+(d&&c[6]>=u*4&&c[0]>=u?1:0)}finderPenaltyTerminateAndCount(c,u,d){return c&&(this.finderPenaltyAddHistory(u,d),u=0),u+=this.size,this.finderPenaltyAddHistory(u,d),this.finderPenaltyCountPatterns(d)}finderPenaltyAddHistory(c,u){u[0]==0&&(c+=this.size),u.pop(),u.unshift(c)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(a,c,u){if(c<0||c>31||a>>>c)throw new RangeError("Value out of range");for(let d=c-1;d>=0;d--)u.push(a>>>d&1)}function r(a,c){return(a>>>c&1)!=0}function s(a){if(!a)throw new Error("Assertion error")}const o=class Pe{constructor(c,u,d){if(this.mode=c,this.numChars=u,this.bitData=d,u<0)throw new RangeError("Invalid argument");this.bitData=d.slice()}static makeBytes(c){let u=[];for(const d of c)n(d,8,u);return new Pe(Pe.Mode.BYTE,c.length,u)}static makeNumeric(c){if(!Pe.isNumeric(c))throw new RangeError("String contains non-numeric characters");let u=[];for(let d=0;d<c.length;){const f=Math.min(c.length-d,3);n(parseInt(c.substring(d,d+f),10),f*3+1,u),d+=f}return new Pe(Pe.Mode.NUMERIC,c.length,u)}static makeAlphanumeric(c){if(!Pe.isAlphanumeric(c))throw new RangeError("String contains unencodable characters in alphanumeric mode");let u=[],d;for(d=0;d+2<=c.length;d+=2){let f=Pe.ALPHANUMERIC_CHARSET.indexOf(c.charAt(d))*45;f+=Pe.ALPHANUMERIC_CHARSET.indexOf(c.charAt(d+1)),n(f,11,u)}return d<c.length&&n(Pe.ALPHANUMERIC_CHARSET.indexOf(c.charAt(d)),6,u),new Pe(Pe.Mode.ALPHANUMERIC,c.length,u)}static makeSegments(c){return c==""?[]:Pe.isNumeric(c)?[Pe.makeNumeric(c)]:Pe.isAlphanumeric(c)?[Pe.makeAlphanumeric(c)]:[Pe.makeBytes(Pe.toUtf8ByteArray(c))]}static makeEci(c){let u=[];if(c<0)throw new RangeError("ECI assignment value out of range");if(c<128)n(c,8,u);else if(c<16384)n(2,2,u),n(c,14,u);else if(c<1e6)n(6,3,u),n(c,21,u);else throw new RangeError("ECI assignment value out of range");return new Pe(Pe.Mode.ECI,0,u)}static isNumeric(c){return Pe.NUMERIC_REGEX.test(c)}static isAlphanumeric(c){return Pe.ALPHANUMERIC_REGEX.test(c)}getData(){return this.bitData.slice()}static getTotalBits(c,u){let d=0;for(const f of c){const h=f.mode.numCharCountBits(u);if(f.numChars>=1<<h)return 1/0;d+=4+h+f.bitData.length}return d}static toUtf8ByteArray(c){c=encodeURI(c);let u=[];for(let d=0;d<c.length;d++)c.charAt(d)!="%"?u.push(c.charCodeAt(d)):(u.push(parseInt(c.substring(d+1,d+3),16)),d+=2);return u}};o.NUMERIC_REGEX=/^[0-9]*$/,o.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,o.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let l=o;e.QrSegment=o})(gr||(gr={}));(e=>{(t=>{const n=class{constructor(s,o){this.ordinal=s,this.formatBits=o}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(gr||(gr={}));(e=>{(t=>{const n=class{constructor(s,o){this.modeBits=s,this.numBitsCharCount=o}numCharCountBits(s){return this.numBitsCharCount[Math.floor((s+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(gr||(gr={}));var Wr=gr;/**
|
|
351
|
+
* @license qrcode.react
|
|
352
|
+
* Copyright (c) Paul O'Shannessy
|
|
353
|
+
* SPDX-License-Identifier: ISC
|
|
354
|
+
*/var hj={L:Wr.QrCode.Ecc.LOW,M:Wr.QrCode.Ecc.MEDIUM,Q:Wr.QrCode.Ecc.QUARTILE,H:Wr.QrCode.Ecc.HIGH},kv=128,Sv="L",Nv="#FFFFFF",jv="#000000",Cv=!1,Ev=1,mj=4,gj=0,vj=.1;function Tv(e,t=0){const n=[];return e.forEach(function(r,s){let o=null;r.forEach(function(l,a){if(!l&&o!==null){n.push(`M${o+t} ${s+t}h${a-o}v1H${o+t}z`),o=null;return}if(a===r.length-1){if(!l)return;o===null?n.push(`M${a+t},${s+t} h1v1H${a+t}z`):n.push(`M${o+t},${s+t} h${a+1-o}v1H${o+t}z`);return}l&&o===null&&(o=a)})}),n.join("")}function Rv(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((s,o)=>o<t.x||o>=t.x+t.w?s:!1))}function xj(e,t,n,r){if(r==null)return null;const s=e.length+n*2,o=Math.floor(t*vj),l=s/t,a=(r.width||o)*l,c=(r.height||o)*l,u=r.x==null?e.length/2-a/2:r.x*l,d=r.y==null?e.length/2-c/2:r.y*l,f=r.opacity==null?1:r.opacity;let h=null;if(r.excavate){let x=Math.floor(u),w=Math.floor(d),b=Math.ceil(a+u-x),m=Math.ceil(c+d-w);h={x,y:w,w:b,h:m}}const y=r.crossOrigin;return{x:u,y:d,h:c,w:a,excavation:h,opacity:f,crossOrigin:y}}function yj(e,t){return t!=null?Math.max(Math.floor(t),0):e?mj:gj}function Iv({value:e,level:t,minVersion:n,includeMargin:r,marginSize:s,imageSettings:o,size:l,boostLevel:a}){let c=L.useMemo(()=>{const x=(Array.isArray(e)?e:[e]).reduce((w,b)=>(w.push(...Wr.QrSegment.makeSegments(b)),w),[]);return Wr.QrCode.encodeSegments(x,hj[t],n,void 0,void 0,a)},[e,t,n,a]);const{cells:u,margin:d,numCells:f,calculatedImageSettings:h}=L.useMemo(()=>{let y=c.getModules();const x=yj(r,s),w=y.length+x*2,b=xj(y,l,x,o);return{cells:y,margin:x,numCells:w,calculatedImageSettings:b}},[c,l,o,r,s]);return{qrcode:c,margin:d,cells:u,numCells:f,calculatedImageSettings:h}}var wj=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),bj=L.forwardRef(function(t,n){const r=t,{value:s,size:o=kv,level:l=Sv,bgColor:a=Nv,fgColor:c=jv,includeMargin:u=Cv,minVersion:d=Ev,boostLevel:f,marginSize:h,imageSettings:y}=r,w=Oc(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:b}=w,m=Oc(w,["style"]),v=y==null?void 0:y.src,g=L.useRef(null),k=L.useRef(null),j=L.useCallback(J=>{g.current=J,typeof n=="function"?n(J):n&&(n.current=J)},[n]),[E,S]=L.useState(!1),{margin:C,cells:U,numCells:T,calculatedImageSettings:V}=Iv({value:s,level:l,minVersion:d,boostLevel:f,includeMargin:u,marginSize:h,imageSettings:y,size:o});L.useEffect(()=>{if(g.current!=null){const J=g.current,O=J.getContext("2d");if(!O)return;let A=U;const W=k.current,R=V!=null&&W!==null&&W.complete&&W.naturalHeight!==0&&W.naturalWidth!==0;R&&V.excavation!=null&&(A=Rv(U,V.excavation));const $=window.devicePixelRatio||1;J.height=J.width=o*$;const F=o/T*$;O.scale(F,F),O.fillStyle=a,O.fillRect(0,0,T,T),O.fillStyle=c,wj?O.fill(new Path2D(Tv(A,C))):U.forEach(function(X,ee){X.forEach(function(G,ne){G&&O.fillRect(ne+C,ee+C,1,1)})}),V&&(O.globalAlpha=V.opacity),R&&O.drawImage(W,V.x+C,V.y+C,V.w,V.h)}}),L.useEffect(()=>{S(!1)},[v]);const _=Mc({height:o,width:o},b);let K=null;return v!=null&&(K=L.createElement("img",{src:v,key:v,style:{display:"none"},onLoad:()=>{S(!0)},ref:k,crossOrigin:V==null?void 0:V.crossOrigin})),L.createElement(L.Fragment,null,L.createElement("canvas",Mc({style:_,height:o,width:o,ref:j,role:"img"},m)),K)});bj.displayName="QRCodeCanvas";var Pv=L.forwardRef(function(t,n){const r=t,{value:s,size:o=kv,level:l=Sv,bgColor:a=Nv,fgColor:c=jv,includeMargin:u=Cv,minVersion:d=Ev,boostLevel:f,title:h,marginSize:y,imageSettings:x}=r,w=Oc(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:b,cells:m,numCells:v,calculatedImageSettings:g}=Iv({value:s,level:l,minVersion:d,boostLevel:f,includeMargin:u,marginSize:y,imageSettings:x,size:o});let k=m,j=null;x!=null&&g!=null&&(g.excavation!=null&&(k=Rv(m,g.excavation)),j=L.createElement("image",{href:x.src,height:g.h,width:g.w,x:g.x+b,y:g.y+b,preserveAspectRatio:"none",opacity:g.opacity,crossOrigin:g.crossOrigin}));const E=Tv(k,b);return L.createElement("svg",Mc({height:o,width:o,viewBox:`0 0 ${v} ${v}`,ref:n,role:"img"},w),!!h&&L.createElement("title",null,h),L.createElement("path",{fill:a,d:`M0,0 h${v}v${v}H0z`,shapeRendering:"crispEdges"}),L.createElement("path",{fill:c,d:E,shapeRendering:"crispEdges"}),j)});Pv.displayName="QRCodeSVG";function xp(e){let t=null;"onCopy"in e&&(e.onCopy===null?t=null:typeof e.onCopy=="function"&&(t=e.onCopy));const{label:n,value:r}=e,[s,o]=p.useState(!1),l=r!=="—"&&!s;return i.jsxs("div",{className:"rounded-xl border border-white/[0.08] bg-[#0d0d0d] p-4",children:[i.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:n}),i.jsxs("div",{className:"mt-2 flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"relative min-w-0 flex-1 overflow-hidden rounded-lg",children:[s?i.jsx("code",{className:"break-all text-xs text-foreground",children:r}):i.jsx("code",{className:Z("block break-all text-xs text-foreground",l&&"select-none blur-lg brightness-75"),children:l?"████████████████":r}),l?i.jsx("div",{className:"pointer-events-none absolute inset-0 bg-background/60 backdrop-blur-sm"}):null]}),i.jsxs("div",{className:"flex shrink-0 gap-1",children:[r!=="—"?i.jsx(H,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>o(a=>!a),children:s?i.jsx(qg,{className:"h-4 w-4"}):i.jsx(Jg,{className:"h-4 w-4"})}):null,t!==null&&s?i.jsx(H,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:t,children:i.jsx(eN,{className:"h-4 w-4"})}):null]})]})]})}function kj(e){let t="Show";"label"in e&&typeof e.label=="string"&&(t=e.label);let n="Hide";"hideLabel"in e&&typeof e.hideLabel=="string"&&(n=e.hideLabel);const{children:r}=e,[s,o]=p.useState(!1);return s?i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"flex justify-end",children:i.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>o(!1),children:[i.jsx(qg,{className:"h-4 w-4"}),n]})}),r]}):i.jsxs("div",{className:"relative flex min-h-[240px] w-full items-center justify-center overflow-hidden rounded-2xl border border-white/[0.08] bg-[#0d0d0d]",children:[i.jsx("div",{className:"absolute inset-0 scale-110 bg-gradient-to-br from-muted via-muted-foreground/15 to-muted blur-2xl"}),i.jsx("div",{className:"absolute inset-0 bg-black/75 backdrop-blur-xl"}),i.jsxs(H,{variant:"secondary",className:"relative z-10",onClick:()=>o(!0),children:[i.jsx(Jg,{className:"h-4 w-4"}),t]})]})}function Sj(){const e=fs();let t=null;typeof e.projectId=="string"&&e.projectId.length>0&&(t=e.projectId);const n=zt(),r=n?NN(n):null,[s,o]=p.useState(null);p.useEffect(()=>{let h=!0;async function y(){try{const x=await fetch("/mobile/release");if(!x.ok)return;const w=await x.json();h&&o(w)}catch{h&&o({available:!1})}}return y(),()=>{h=!1}},[]);async function l(h){await navigator.clipboard.writeText(h)}let a=null,c=null,u=null;s!==null&&s.available&&(a=s.downloadUrl,c=s.fileName,u=s.sizeBytes);let d="Project";n!==null&&n.projectName!==null?d=n.projectName:t!==null&&(d=t);let f="/projects";return t!==null&&(f=`/projects/${t}/tasks`),i.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.jsx(bn,{breadcrumb:[{label:"Projects",to:"/projects"},{label:d,to:f},{label:"Mobile",to:null}],title:"Mobile",subtitle:"Connect the Android app"}),i.jsx("div",{className:"flex-1 overflow-y-auto p-8",children:i.jsxs("div",{className:"mx-auto max-w-xl space-y-8",children:[i.jsxs("div",{className:"panel-card space-y-6 p-6",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-primary/15",children:i.jsx(ov,{className:"h-5 w-5 text-primary"})}),i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold text-white",children:"Connect mobile app"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Scan the QR code in the Android app to sign in instantly."})]})]}),r?i.jsx(kj,{label:"Show QR code",hideLabel:"Hide QR",children:i.jsxs("div",{className:"flex flex-col items-center gap-4",children:[i.jsx("div",{className:"inline-flex rounded-2xl bg-white p-4 shadow-sm",children:i.jsx(Pv,{value:r,size:240,level:"L",includeMargin:!0})}),i.jsx("p",{className:"text-center text-xs leading-relaxed text-muted-foreground",children:"Scan with the Task Bridge Android app. The QR encodes your personal token — keep it private."})]})}):null,i.jsxs("div",{className:"space-y-3",children:[i.jsx(xp,{label:"Your token",value:function(){return n!==null?n.token:"-"}(),onCopy:n?()=>void l(n.token):null}),i.jsx(xp,{label:"Deep link",value:r!==null?r:"-",onCopy:r?()=>void l(r):null})]})]}),a!==null&&c!==null?i.jsx("div",{className:"panel-card space-y-4 p-6",children:i.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[i.jsx(H,{asChild:!0,children:i.jsxs("a",{href:a,download:c,children:[i.jsx(Tc,{className:"mr-2 h-4 w-4"}),"Download APK"]})}),u!==null&&u>0?i.jsxs("span",{className:"text-sm text-muted-foreground",children:[(u/(1024*1024)).toFixed(1)," MB"]}):null]})}):null]})})]})}const Kn=p.forwardRef((e,t)=>p.createElement("textarea",Object.assign({},ze(e,["className"]),{className:Z("flex min-h-[80px] w-full rounded-xl border border-white/[0.1] bg-[#111111] px-3 py-2 text-sm text-foreground ring-offset-black placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:cursor-not-allowed disabled:opacity-50",e.className),ref:t})));Kn.displayName="Textarea";function Nj({session:e,onCreated:t,onCancel:n}){const[r,s]=p.useState(!1),[o,l]=p.useState(""),[a,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState([]),[y,x]=p.useState("");p.useEffect(()=>{Xu(e).then(m=>{h(m),x(v=>{if(m.some(g=>g.id===v))return v;for(const g of m)if(g.id===ml)return g.id;if(m.length>0){const g=m[0];if(g)return g.id}return ml})}).catch(()=>h([]))},[e]);async function w(){const m=o.trim(),v=a.trim();if(!(!m||!v)){s(!0);try{const g=await RN(e,{name:m,id:"",repoPath:v,description:u.trim(),workflowTemplateId:y.trim()||ml});t(g)}catch(g){Y.error(g instanceof Error?g.message:"Failed to create project")}finally{s(!1)}}}const b=!!(o.trim()&&a.trim());return i.jsxs("div",{className:"mx-auto w-full max-w-lg space-y-8",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-white",children:"New project"}),i.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Choose a workspace path and starting workflow template."})]}),i.jsxs("div",{className:"panel-card space-y-5 p-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(xe,{htmlFor:"project-name",children:"Name"}),i.jsx(Ne,{id:"project-name",value:o,onChange:m=>l(m.target.value),placeholder:"My App",disabled:r,autoFocus:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(xe,{htmlFor:"project-repo",children:"Repo path"}),i.jsx(Ne,{id:"project-repo",value:a,onChange:m=>c(m.target.value),placeholder:"C:\\dev\\my-app",disabled:r})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(xe,{htmlFor:"project-description",children:"Description"}),i.jsx(Kn,{id:"project-description",value:u,onChange:m=>d(m.target.value),placeholder:"Optional notes about this project",rows:3,disabled:r})]}),f.length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(xe,{children:"Workflow template"}),i.jsx("div",{className:"grid gap-2",children:f.map(m=>i.jsxs("button",{type:"button",disabled:r,onClick:()=>x(m.id),className:Z("rounded-xl border px-4 py-3 text-left transition-colors",y===m.id?"border-primary bg-primary/10":"border-white/[0.08] hover:border-white/[0.14]"),children:[i.jsx("p",{className:"text-sm font-medium text-white",children:m.title}),i.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:m.description})]},m.id))})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[i.jsx(H,{variant:"outline",onClick:n,disabled:r,children:"Cancel"}),i.jsxs(H,{disabled:r||!b,onClick:()=>void w(),children:[r?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(Ct,{className:"h-4 w-4"}),"Create"]})]})]})]})}function jj({session:e,project:t,open:n,onOpenChange:r,onSaved:s}){const[o,l]=p.useState(!1),[a,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[y,x]=p.useState(""),[w,b]=p.useState([]);p.useEffect(()=>{!n||!t||(c(t.name),d(t.repoPath.trim()),h(t.description.trim()),x(""),Xu(e).then(b).catch(()=>b([])))},[n,t,e]);async function m(){if(!t)return;const S=a.trim(),C=u.trim();if(!S||!C){Y.error("Name and folder path are required");return}const U=t.workflowTemplateId.trim(),T=y.trim(),V=T!==""?T:U;l(!0);try{const _=await IN(e,t.id,{name:S,repoPath:C,description:f.trim(),workflowTemplateId:V});s(_),r(!1),Y.success("Project updated")}catch(_){Y.error(_ instanceof Error?_.message:"Failed to update project")}finally{l(!1)}}const v=!!(a.trim()&&u.trim()),g=t!==null?w.find(S=>S.id===t.workflowTemplateId):null,k=y.trim(),j=k!==""&&t!==null&&k!==t.workflowTemplateId.trim(),E=w.find(S=>S.id===k);return i.jsx(hs,{open:n,onOpenChange:r,children:i.jsxs(wr,{className:"max-w-lg gap-0 overflow-hidden p-0 sm:rounded-xl",children:[i.jsxs(br,{className:"border-b border-white/[0.06] px-6 py-4",children:[i.jsx(kr,{children:"Edit project"}),t?i.jsx("p",{className:"text-xs text-muted-foreground",children:t.id}):null]}),i.jsxs("div",{className:"space-y-4 px-6 py-5",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(xe,{htmlFor:"edit-project-name",children:"Name"}),i.jsx(Ne,{id:"edit-project-name",value:a,onChange:S=>c(S.target.value),disabled:o})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(xe,{htmlFor:"edit-project-repo",children:"Folder path"}),i.jsx(Ne,{id:"edit-project-repo",value:u,onChange:S=>d(S.target.value),disabled:o})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(xe,{htmlFor:"edit-project-description",children:"Description"}),i.jsx(Kn,{id:"edit-project-description",value:f,onChange:S=>h(S.target.value),rows:3,disabled:o})]}),w.length>0?i.jsxs("div",{className:"space-y-2",children:[i.jsx(xe,{htmlFor:"edit-project-workflow",children:"Pipeline template"}),g?i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Current: ",g.title]}):t!==null&&t.workflowTemplateId?i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Current: ",t.workflowTemplateId]}):null,i.jsxs(Zl,{id:"edit-project-workflow",value:y,onChange:S=>x(S.target.value),disabled:o,children:[i.jsx("option",{value:"",children:"Keep current pipeline"}),w.map(S=>i.jsx("option",{value:S.id,children:S.title},S.id))]}),j?i.jsxs("p",{className:"text-xs text-amber-400/90",children:["Switching to ",E?E.title:k," resets existing epic workflows and removes their spawned subtasks."]}):null]}):null]}),i.jsxs(wo,{className:"border-t border-white/[0.06] px-6 py-4",children:[i.jsx(H,{variant:"outline",onClick:()=>r(!1),disabled:o,children:"Cancel"}),i.jsxs(H,{disabled:o||!v,onClick:()=>void m(),children:[o?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):null,"Save"]})]})]})})}function Cj(){const e=yn(),t=qt(),n=zt(),[r,s]=p.useState([]),[o,l]=p.useState(!0),[a,c]=p.useState(null),[u,d]=p.useState(!1),[f,h]=p.useState(null),y=p.useCallback(async()=>{if(n){l(!0),c(null);try{s(await pv(n))}catch(g){const k=g instanceof Error?g.message:"Failed to load projects";c(k),Y.error(k)}finally{l(!1)}}},[n]);if(p.useEffect(()=>{xN()},[]),p.useEffect(()=>{y()},[y,t.key]),!n)return null;const x=n,w=x.userRole==="admin"||x.userRole==="read-write";function b(g){Ic(g.id,g.name),e(`/projects/${g.id}/tasks`)}function m(g){d(!1),y(),Y.success(`Project "${g.name}" created`),b(g)}function v(g){s(k=>k.map(j=>j.id===g.id?g:j)),x.projectId===g.id&&Ic(g.id,g.name)}return i.jsx("div",{className:"flex h-full min-h-0 flex-col",children:u?i.jsx("div",{className:"flex-1 overflow-y-auto p-8",children:i.jsx(Nj,{session:x,onCreated:m,onCancel:()=>d(!1)})}):i.jsxs(i.Fragment,{children:[i.jsx(bn,{title:"Projects",subtitle:o?"Loading workspaces…":r.length>0?`${r.length} workspace${r.length===1?"":"s"}`:"Create your first workspace to get started",actions:i.jsxs(i.Fragment,{children:[i.jsxs(H,{variant:"outline",size:"sm",onClick:()=>void y(),disabled:o,children:[o?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(Ql,{className:"h-4 w-4"}),"Refresh"]}),i.jsxs(H,{size:"sm",onClick:()=>d(!0),children:[i.jsx(Ct,{className:"h-4 w-4"}),"New project"]})]})}),i.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:o&&r.length===0?i.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[i.jsx(dn,{className:"h-28 rounded-2xl"}),i.jsx(dn,{className:"h-28 rounded-2xl"}),i.jsx(dn,{className:"h-28 rounded-2xl"})]}):a?i.jsxs("div",{className:"panel-card mx-auto max-w-md space-y-4 p-6 text-center",children:[i.jsx("p",{className:"text-sm text-destructive",children:a}),i.jsxs(H,{variant:"outline",size:"sm",onClick:()=>void y(),children:[i.jsx(Ql,{className:"h-4 w-4"}),"Retry"]})]}):r.length===0?i.jsxs("div",{className:"panel-card flex flex-col items-center justify-center px-6 py-16 text-center",children:[i.jsx(ev,{className:"mb-4 h-10 w-10 text-muted-foreground/60"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"No projects yet. Create one to start building epics."}),i.jsxs(H,{className:"mt-4",size:"sm",onClick:()=>d(!0),children:[i.jsx(Ct,{className:"h-4 w-4"}),"New project"]})]}):i.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:r.map(g=>i.jsxs("article",{className:"panel-card group relative transition-colors hover:border-white/[0.14] hover:bg-[#141414]",children:[w?i.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"absolute right-2 top-2 z-10 h-8 w-8 text-muted-foreground hover:text-foreground",onClick:k=>{k.stopPropagation(),h(g)},children:i.jsx(tN,{className:"h-4 w-4"})}):null,i.jsxs("button",{type:"button",onClick:()=>b(g),className:"flex min-h-[7rem] w-full flex-col justify-between p-4 pr-12 text-left",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"}),i.jsx("span",{className:"text-[11px] text-muted-foreground",children:g.id})]}),i.jsx("p",{className:"line-clamp-2 text-sm font-semibold text-white group-hover:text-primary",children:g.name}),g.repoPath?i.jsx("p",{className:"line-clamp-1 text-xs text-muted-foreground",children:g.repoPath}):null,g.description.trim()?i.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground/80",children:g.description.trim()}):null]}),i.jsx("div",{className:"mt-3 flex items-center justify-end text-xs text-muted-foreground",children:i.jsx(yo,{className:"h-4 w-4 opacity-0 transition-opacity group-hover:opacity-100"})})]})]},g.id))})}),i.jsx(jj,{session:x,project:f,open:f!==null,onOpenChange:g=>{g||h(null)},onSaved:v})]})})}const Ej=30;function Tj(e){return e==="ready"?"bg-emerald-500":e==="sent"?"bg-sky-500":"bg-amber-500"}function Rj(){const e=fs();let t=null;typeof e.projectId=="string"&&e.projectId.length>0&&(t=e.projectId);const n=zt(),[r,s]=p.useState(""),[o,l]=p.useState(""),[a,c]=p.useState(!1),[u,d]=p.useState([]),[f,h]=p.useState(null),[y,x]=p.useState(!1),[w,b]=p.useState(!0),[m,v]=p.useState(!1),[g,k]=p.useState(!1),j=p.useCallback(async(T,V)=>{if(!(!n||!t)){V?v(!0):b(!0);try{const _=await Zu(n,{projectId:t,epicsOnly:!0,commentsOnly:null,cursor:T,limit:Ej});d(K=>V?K.concat(_.items):_.items),h(_.nextCursor),x(_.hasMore)}catch(_){Y.error(_ instanceof Error?_.message:"Failed to load tasks")}finally{b(!1),v(!1)}}},[n,t]),E=p.useCallback(()=>{j(null,!1)},[j]);p.useEffect(()=>{j(null,!1)},[j]);async function S(){if(!n||!t)return;const T=r.trim();if(T){c(!0);try{await AN(n,{projectId:t,title:T,description:o.trim()}),s(""),l(""),k(!1),Y.success("Epic created"),E()}catch(V){Y.error(V instanceof Error?V.message:"Failed to create task")}finally{c(!1)}}}let C="Project";n!==null&&n.projectName!==null?C=n.projectName:t!==null&&(C=t);let U="/projects";return t!==null&&(U=`/projects/${t}/tasks`),i.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.jsx(bn,{breadcrumb:[{label:"Projects",to:"/projects"},{label:C,to:U},{label:"Epics",to:null}],title:"Epics",subtitle:u.length>0?`${u.length}${y?"+":""} active`:"No epics yet",actions:i.jsxs(i.Fragment,{children:[i.jsxs(H,{variant:"outline",size:"sm",onClick:E,disabled:w||m,children:[w?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(Ql,{className:"h-4 w-4"}),"Refresh"]}),i.jsxs(H,{size:"sm",onClick:()=>k(T=>!T),children:[i.jsx(Ct,{className:"h-4 w-4"}),"New epic"]})]})}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[g?i.jsxs("section",{className:"panel-card mb-5 space-y-4 p-5",children:[i.jsx(Ne,{value:r,onChange:T=>s(T.target.value),placeholder:"Epic title",disabled:a,autoFocus:!0}),i.jsx(Kn,{value:o,onChange:T=>l(T.target.value),placeholder:"Description (optional)",rows:3,disabled:a,className:"resize-y rounded-xl border-white/[0.1] bg-[#111111]"}),i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(H,{variant:"ghost",size:"sm",onClick:()=>k(!1),children:"Cancel"}),i.jsxs(H,{disabled:a||!r.trim(),onClick:()=>void S(),children:[a?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(uN,{className:"h-4 w-4"}),"Create"]})]})]}):null,w&&u.length===0?i.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[i.jsx(dn,{className:"h-28 rounded-2xl"}),i.jsx(dn,{className:"h-28 rounded-2xl"}),i.jsx(dn,{className:"h-28 rounded-2xl"})]}):u.length===0?i.jsxs("div",{className:"panel-card flex flex-col items-center justify-center px-6 py-16 text-center",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Create your first epic to start the pipeline."}),i.jsxs(H,{className:"mt-4",size:"sm",onClick:()=>k(!0),children:[i.jsx(Ct,{className:"h-4 w-4"}),"New epic"]})]}):i.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:u.map(T=>i.jsxs(tr,{to:`/projects/${t}/tasks/${T.taskId}`,className:"panel-card group flex min-h-[7rem] flex-col justify-between p-4 transition-colors hover:border-white/[0.14] hover:bg-[#141414]",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`h-2 w-2 rounded-full ${Tj(T.status)}`}),i.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["#",T.taskId]}),T.stageTitle?i.jsx("span",{className:"rounded-md bg-white/[0.06] px-2 py-0.5 text-[10px] font-medium",children:T.stageTitle}):null]}),i.jsx("p",{className:"line-clamp-2 text-sm font-semibold text-white group-hover:text-primary",children:T.title||`Task #${T.taskId}`})]}),i.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs text-muted-foreground",children:[i.jsx("span",{children:Bu(T.activityAt!==null?T.activityAt:T.updatedAt!==null?T.updatedAt:T.createdAt)}),i.jsx(yo,{className:"h-4 w-4 opacity-0 transition-opacity group-hover:opacity-100"})]})]},T.taskId))}),i.jsx(yv,{loaded:u.length,hasMore:y,loading:m,onLoadMore:()=>{j(f,!0)}})]})]})}function Ij({open:e,onOpenChange:t,targetLabel:n,saving:r=!1,onCreate:s}){const[o,l]=p.useState(""),[a,c]=p.useState("");p.useEffect(()=>{e&&(l(""),c(""))},[e]);const u=r===!0,d=o.trim().length>0&&!u;let f="this epic";return n!==null&&(f=n),i.jsx(hs,{open:e,onOpenChange:t,children:i.jsxs(wr,{className:"max-w-lg gap-0 overflow-hidden p-0 sm:rounded-xl",children:[i.jsxs(br,{className:"border-b border-white/[0.06] px-6 py-4",children:[i.jsx(kr,{children:"New task"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Adding to"," ",i.jsx("span",{className:"font-medium text-foreground",children:f})]})]}),i.jsxs("div",{className:"space-y-4 px-6 py-5",children:[i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Title"}),i.jsx(Ne,{value:o,onChange:h=>l(h.target.value),placeholder:"Task title",disabled:u,autoFocus:!0,onKeyDown:h=>{h.key==="Enter"&&!h.shiftKey&&d&&(h.preventDefault(),s(o.trim(),a.trim()))}})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Description"}),i.jsx(Kn,{value:a,onChange:h=>c(h.target.value),placeholder:"What needs to happen? (optional)",rows:5,disabled:u,className:"resize-y rounded-xl border-white/[0.1] bg-[#111111]"})]})]}),i.jsxs(wo,{className:"border-t border-white/[0.06] px-6 py-4",children:[i.jsx(H,{type:"button",variant:"outline",disabled:u,onClick:()=>t(!1),children:"Cancel"}),i.jsxs(H,{type:"button",disabled:!d,onClick:()=>s(o.trim(),a.trim()),children:[u?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):null,"Create task"]})]})]})})}function qu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Sr=qu();function _v(e){Sr=e}var Bs={exec:()=>null};function he(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(s,o)=>{let l=typeof o=="string"?o:o.source;return l=l.replace(tt.caret,"$1"),n=n.replace(s,l),r},getRegex:()=>new RegExp(n,t)};return r}var tt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Pj=/^(?:[ \t]*(?:\n|$))+/,_j=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Lj=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,So=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Mj=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ju=/(?:[*+-]|\d{1,9}[.)])/,Lv=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Mv=he(Lv).replace(/bull/g,Ju).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Oj=he(Lv).replace(/bull/g,Ju).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ed=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Aj=/^[^\n]+/,td=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Dj=he(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",td).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),zj=he(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ju).getRegex(),Ri="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",nd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$j=he("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",nd).replace("tag",Ri).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ov=he(ed).replace("hr",So).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ri).getRegex(),Fj=he(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ov).getRegex(),rd={blockquote:Fj,code:_j,def:Dj,fences:Lj,heading:Mj,hr:So,html:$j,lheading:Mv,list:zj,newline:Pj,paragraph:Ov,table:Bs,text:Aj},yp=he("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",So).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ri).getRegex(),Bj={...rd,lheading:Oj,table:yp,paragraph:he(ed).replace("hr",So).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",yp).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ri).getRegex()},Uj={...rd,html:he(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",nd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Bs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:he(ed).replace("hr",So).replace("heading",` *#{1,6} *[^
|
|
355
|
+
]`).replace("lheading",Mv).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Wj=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Vj=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Av=/^( {2,}|\\)\n(?!\s*$)/,Hj=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ii=/[\p{P}\p{S}]/u,sd=/[\s\p{P}\p{S}]/u,Dv=/[^\s\p{P}\p{S}]/u,Gj=he(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,sd).getRegex(),zv=/(?!~)[\p{P}\p{S}]/u,Yj=/(?!~)[\s\p{P}\p{S}]/u,Kj=/(?:[^\s\p{P}\p{S}]|~)/u,Qj=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,$v=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Xj=he($v,"u").replace(/punct/g,Ii).getRegex(),Zj=he($v,"u").replace(/punct/g,zv).getRegex(),Fv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",qj=he(Fv,"gu").replace(/notPunctSpace/g,Dv).replace(/punctSpace/g,sd).replace(/punct/g,Ii).getRegex(),Jj=he(Fv,"gu").replace(/notPunctSpace/g,Kj).replace(/punctSpace/g,Yj).replace(/punct/g,zv).getRegex(),e2=he("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Dv).replace(/punctSpace/g,sd).replace(/punct/g,Ii).getRegex(),t2=he(/\\(punct)/,"gu").replace(/punct/g,Ii).getRegex(),n2=he(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),r2=he(nd).replace("(?:-->|$)","-->").getRegex(),s2=he("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",r2).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Jl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,o2=he(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Jl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Bv=he(/^!?\[(label)\]\[(ref)\]/).replace("label",Jl).replace("ref",td).getRegex(),Uv=he(/^!?\[(ref)\](?:\[\])?/).replace("ref",td).getRegex(),l2=he("reflink|nolink(?!\\()","g").replace("reflink",Bv).replace("nolink",Uv).getRegex(),od={_backpedal:Bs,anyPunctuation:t2,autolink:n2,blockSkip:Qj,br:Av,code:Vj,del:Bs,emStrongLDelim:Xj,emStrongRDelimAst:qj,emStrongRDelimUnd:e2,escape:Wj,link:o2,nolink:Uv,punctuation:Gj,reflink:Bv,reflinkSearch:l2,tag:s2,text:Hj,url:Bs},i2={...od,link:he(/^!?\[(label)\]\((.*?)\)/).replace("label",Jl).getRegex(),reflink:he(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jl).getRegex()},Ac={...od,emStrongRDelimAst:Jj,emStrongLDelim:Zj,url:he(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},a2={...Ac,br:he(Av).replace("{2,}","*").getRegex(),text:he(Ac.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qo={normal:rd,gfm:Bj,pedantic:Uj},js={normal:od,gfm:Ac,breaks:a2,pedantic:i2},c2={"&":"&","<":"<",">":">",'"':""","'":"'"},wp=e=>c2[e];function Bt(e,t){if(t){if(tt.escapeTest.test(e))return e.replace(tt.escapeReplace,wp)}else if(tt.escapeTestNoEncode.test(e))return e.replace(tt.escapeReplaceNoEncode,wp);return e}function bp(e){try{e=encodeURI(e).replace(tt.percentDecode,"%")}catch{return null}return e}function kp(e,t){var o;const n=e.replace(tt.findPipe,(l,a,c)=>{let u=!1,d=a;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),r=n.split(tt.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!((o=r.at(-1))!=null&&o.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(tt.slashPipe,"|");return r}function Cs(e,t,n){const r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function u2(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Sp(e,t,n,r,s){const o=t.href,l=t.title||null,a=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const c={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:o,title:l,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,c}function d2(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const s=r[1];return t.split(`
|
|
356
|
+
`).map(o=>{const l=o.match(n.other.beginningSpace);if(l===null)return o;const[a]=l;return a.length>=s.length?o.slice(s.length):o}).join(`
|
|
357
|
+
`)}var ei=class{constructor(e){ge(this,"options");ge(this,"rules");ge(this,"lexer");this.options=e||Sr}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Cs(n,`
|
|
358
|
+
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=d2(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const r=Cs(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Cs(t[0],`
|
|
359
|
+
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=Cs(t[0],`
|
|
360
|
+
`).split(`
|
|
361
|
+
`),r="",s="";const o=[];for(;n.length>0;){let l=!1;const a=[];let c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))a.push(n[c]),l=!0;else if(!l)a.push(n[c]);else break;n=n.slice(c);const u=a.join(`
|
|
362
|
+
`),d=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
363
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
364
|
+
${u}`:u,s=s?`${s}
|
|
365
|
+
${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,o,!0),this.lexer.state.top=f,n.length===0)break;const h=o.at(-1);if((h==null?void 0:h.type)==="code")break;if((h==null?void 0:h.type)==="blockquote"){const y=h,x=y.raw+`
|
|
366
|
+
`+n.join(`
|
|
367
|
+
`),w=this.blockquote(x);o[o.length-1]=w,r=r.substring(0,r.length-y.raw.length)+w.raw,s=s.substring(0,s.length-y.text.length)+w.text;break}else if((h==null?void 0:h.type)==="list"){const y=h,x=y.raw+`
|
|
368
|
+
`+n.join(`
|
|
369
|
+
`),w=this.list(x);o[o.length-1]=w,r=r.substring(0,r.length-h.raw.length)+w.raw,s=s.substring(0,s.length-y.raw.length)+w.raw,n=x.substring(o.at(-1).raw.length).split(`
|
|
370
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:o,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=this.rules.other.listItemRegex(n);let l=!1;for(;e;){let c=!1,u="",d="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let f=t[2].split(`
|
|
371
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,m=>" ".repeat(3*m.length)),h=e.split(`
|
|
372
|
+
`,1)[0],y=!f.trim(),x=0;if(this.options.pedantic?(x=2,d=f.trimStart()):y?x=t[1].length+1:(x=t[2].search(this.rules.other.nonSpaceChar),x=x>4?1:x,d=f.slice(x),x+=t[1].length),y&&this.rules.other.blankLine.test(h)&&(u+=h+`
|
|
373
|
+
`,e=e.substring(h.length+1),c=!0),!c){const m=this.rules.other.nextBulletRegex(x),v=this.rules.other.hrRegex(x),g=this.rules.other.fencesBeginRegex(x),k=this.rules.other.headingBeginRegex(x),j=this.rules.other.htmlBeginRegex(x);for(;e;){const E=e.split(`
|
|
374
|
+
`,1)[0];let S;if(h=E,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),S=h):S=h.replace(this.rules.other.tabCharGlobal," "),g.test(h)||k.test(h)||j.test(h)||m.test(h)||v.test(h))break;if(S.search(this.rules.other.nonSpaceChar)>=x||!h.trim())d+=`
|
|
375
|
+
`+S.slice(x);else{if(y||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||g.test(f)||k.test(f)||v.test(f))break;d+=`
|
|
376
|
+
`+h}!y&&!h.trim()&&(y=!0),u+=E+`
|
|
377
|
+
`,e=e.substring(E.length+1),f=S.slice(x)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(l=!0));let w=null,b;this.options.gfm&&(w=this.rules.other.listIsTask.exec(d),w&&(b=w[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:u,task:!!w,checked:b,loose:!1,text:d,tokens:[]}),s.raw+=u}const a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){const u=s.items[c].tokens.filter(f=>f.type==="space"),d=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:s}}}table(e){var l;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=kp(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(l=t[3])!=null&&l.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
378
|
+
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const a of r)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<n.length;a++)o.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:o.align[a]});for(const a of s)o.rows.push(kp(a,o.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[u]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
|
|
379
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const o=Cs(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=u2(t[2],"()");if(o===-2)return;if(o>-1){const a=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Sp(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return Sp(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...r[0]].length-1;let l,a,c=o,u=0;const d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+o);(r=d.exec(t))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(a=[...l].length,r[3]||r[4]){c+=a;continue}else if((r[5]||r[6])&&o%3&&!((o+a)%3)){u+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+u);const f=[...r[0]][0].length,h=e.slice(0,o+r.index+f+a);if(Math.min(o,a)%2){const x=h.slice(1,-1);return{type:"em",raw:h,text:x,tokens:this.lexer.inlineTokens(x)}}const y=h.slice(2,-2);return{type:"strong",raw:h,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,s;if(t[2]==="@")r=t[0],s="mailto:"+r;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},an=class Dc{constructor(t){ge(this,"tokens");ge(this,"options");ge(this,"state");ge(this,"tokenizer");ge(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Sr,this.options.tokenizer=this.options.tokenizer||new ei,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:tt,block:qo.normal,inline:js.normal};this.options.pedantic?(n.block=qo.pedantic,n.inline=js.pedantic):this.options.gfm&&(n.block=qo.gfm,this.options.breaks?n.inline=js.breaks:n.inline=js.gfm),this.tokenizer.rules=n}static get rules(){return{block:qo,inline:js}}static lex(t,n){return new Dc(n).lex(t)}static lexInline(t,n){return new Dc(n).inlineTokens(t)}lex(t){t=t.replace(tt.carriageReturn,`
|
|
380
|
+
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var s,o,l;for(this.options.pedantic&&(t=t.replace(tt.tabCharGlobal," ").replace(tt.spaceLine,""));t;){let a;if((o=(s=this.options.extensions)==null?void 0:s.block)!=null&&o.some(u=>(a=u.call({lexer:this},t,n))?(t=t.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);const u=n.at(-1);a.raw.length===1&&u!==void 0?u.raw+=`
|
|
381
|
+
`:n.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
382
|
+
`+a.raw,u.text+=`
|
|
383
|
+
`+a.text,this.inlineQueue.at(-1).src=u.text):n.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
384
|
+
`+a.raw,u.text+=`
|
|
385
|
+
`+a.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),n.push(a);continue}let c=t;if((l=this.options.extensions)!=null&&l.startBlock){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startBlock.forEach(h=>{f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(this.state.top&&(a=this.tokenizer.paragraph(c))){const u=n.at(-1);r&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=`
|
|
386
|
+
`+a.raw,u.text+=`
|
|
387
|
+
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(a),r=c.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
388
|
+
`+a.raw,u.text+=`
|
|
389
|
+
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(a);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var a,c,u;let r=t,s=null;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let o=!1,l="";for(;t;){o||(l=""),o=!1;let d;if((c=(a=this.options.extensions)==null?void 0:a.inline)!=null&&c.some(h=>(d=h.call({lexer:this},t,n))?(t=t.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);const h=n.at(-1);d.type==="text"&&(h==null?void 0:h.type)==="text"?(h.raw+=d.raw,h.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(t,r,l)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.del(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),n.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),n.push(d);continue}let f=t;if((u=this.options.extensions)!=null&&u.startInline){let h=1/0;const y=t.slice(1);let x;this.options.extensions.startInline.forEach(w=>{x=w.call({lexer:this},y),typeof x=="number"&&x>=0&&(h=Math.min(h,x))}),h<1/0&&h>=0&&(f=t.substring(0,h+1))}if(d=this.tokenizer.inlineText(f)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(l=d.raw.slice(-1)),o=!0;const h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=d.raw,h.text+=d.text):n.push(d);continue}if(t){const h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}},ti=class{constructor(e){ge(this,"options");ge(this,"parser");this.options=e||Sr}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const r=(o=(t||"").match(tt.notSpaceStart))==null?void 0:o[0],s=e.replace(tt.endingNewline,"")+`
|
|
390
|
+
`;return r?'<pre><code class="language-'+Bt(r)+'">'+(n?s:Bt(s,!0))+`</code></pre>
|
|
391
|
+
`:"<pre><code>"+(n?s:Bt(s,!0))+`</code></pre>
|
|
392
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
393
|
+
${this.parser.parse(e)}</blockquote>
|
|
394
|
+
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
395
|
+
`}hr(e){return`<hr>
|
|
396
|
+
`}list(e){const t=e.ordered,n=e.start;let r="";for(let l=0;l<e.items.length;l++){const a=e.items[l];r+=this.listitem(a)}const s=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+s+o+`>
|
|
397
|
+
`+r+"</"+s+`>
|
|
398
|
+
`}listitem(e){var n;let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Bt(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
399
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
400
|
+
`}table(e){let t="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);t+=this.tablerow({text:n});let r="";for(let s=0;s<e.rows.length;s++){const o=e.rows[s];n="";for(let l=0;l<o.length;l++)n+=this.tablecell(o[l]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
401
|
+
<thead>
|
|
402
|
+
`+t+`</thead>
|
|
403
|
+
`+r+`</table>
|
|
404
|
+
`}tablerow({text:e}){return`<tr>
|
|
405
|
+
${e}</tr>
|
|
406
|
+
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
407
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Bt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),s=bp(e);if(s===null)return r;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+Bt(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const s=bp(e);if(s===null)return Bt(n);e=s;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${Bt(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Bt(e.text)}},ld=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},cn=class zc{constructor(t){ge(this,"options");ge(this,"renderer");ge(this,"textRenderer");this.options=t||Sr,this.options.renderer=this.options.renderer||new ti,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ld}static parse(t,n){return new zc(n).parse(t)}static parseInline(t,n){return new zc(n).parseInline(t)}parse(t,n=!0){var s,o;let r="";for(let l=0;l<t.length;l++){const a=t[l];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[a.type]){const u=a,d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){r+=d||"";continue}}const c=a;switch(c.type){case"space":{r+=this.renderer.space(c);continue}case"hr":{r+=this.renderer.hr(c);continue}case"heading":{r+=this.renderer.heading(c);continue}case"code":{r+=this.renderer.code(c);continue}case"table":{r+=this.renderer.table(c);continue}case"blockquote":{r+=this.renderer.blockquote(c);continue}case"list":{r+=this.renderer.list(c);continue}case"html":{r+=this.renderer.html(c);continue}case"paragraph":{r+=this.renderer.paragraph(c);continue}case"text":{let u=c,d=this.renderer.text(u);for(;l+1<t.length&&t[l+1].type==="text";)u=t[++l],d+=`
|
|
408
|
+
`+this.renderer.text(u);n?r+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):r+=d;continue}default:{const u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(t,n=this.renderer){var s,o;let r="";for(let l=0;l<t.length;l++){const a=t[l];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[a.type]){const u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=u||"";continue}}const c=a;switch(c.type){case"escape":{r+=n.text(c);break}case"html":{r+=n.html(c);break}case"link":{r+=n.link(c);break}case"image":{r+=n.image(c);break}case"strong":{r+=n.strong(c);break}case"em":{r+=n.em(c);break}case"codespan":{r+=n.codespan(c);break}case"br":{r+=n.br(c);break}case"del":{r+=n.del(c);break}case"text":{r+=n.text(c);break}default:{const u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},Ca,gl=(Ca=class{constructor(e){ge(this,"options");ge(this,"block");this.options=e||Sr}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?an.lex:an.lexInline}provideParser(){return this.block?cn.parse:cn.parseInline}},ge(Ca,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Ca),f2=class{constructor(...e){ge(this,"defaults",qu());ge(this,"options",this.setOptions);ge(this,"parse",this.parseMarkdown(!0));ge(this,"parseInline",this.parseMarkdown(!1));ge(this,"Parser",cn);ge(this,"Renderer",ti);ge(this,"TextRenderer",ld);ge(this,"Lexer",an);ge(this,"Tokenizer",ei);ge(this,"Hooks",gl);this.use(...e)}walkTokens(e,t){var r,s;let n=[];for(const o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{const l=o;for(const a of l.header)n=n.concat(this.walkTokens(a.tokens,t));for(const a of l.rows)for(const c of a)n=n.concat(this.walkTokens(c.tokens,t));break}case"list":{const l=o;n=n.concat(this.walkTokens(l.items,t));break}default:{const l=o;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[l.type]?this.defaults.extensions.childTokens[l.type].forEach(a=>{const c=l[a].flat(1/0);n=n.concat(this.walkTokens(c,t))}):l.tokens&&(n=n.concat(this.walkTokens(l.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const o=t.renderers[s.name];o?t.renderers[s.name]=function(...l){let a=s.renderer.apply(this,l);return a===!1&&(a=o.apply(this,l)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){const s=this.defaults.renderer||new ti(this.defaults);for(const o in n.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const l=o,a=n.renderer[l],c=s[l];s[l]=(...u)=>{let d=a.apply(s,u);return d===!1&&(d=c.apply(s,u)),d||""}}r.renderer=s}if(n.tokenizer){const s=this.defaults.tokenizer||new ei(this.defaults);for(const o in n.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const l=o,a=n.tokenizer[l],c=s[l];s[l]=(...u)=>{let d=a.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}r.tokenizer=s}if(n.hooks){const s=this.defaults.hooks||new gl;for(const o in n.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const l=o,a=n.hooks[l],c=s[l];gl.passThroughHooks.has(o)?s[l]=u=>{if(this.defaults.async)return Promise.resolve(a.call(s,u)).then(f=>c.call(s,f));const d=a.call(s,u);return c.call(s,d)}:s[l]=(...u)=>{let d=a.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}r.hooks=s}if(n.walkTokens){const s=this.defaults.walkTokens,o=n.walkTokens;r.walkTokens=function(l){let a=[];return a.push(o.call(this,l)),s&&(a=a.concat(s.call(this,l))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return an.lex(e,t??this.defaults)}parser(e,t){return cn.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{const s={...r},o={...this.defaults,...s},l=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const a=o.hooks?o.hooks.provideLexer():e?an.lex:an.lexInline,c=o.hooks?o.hooks.provideParser():e?cn.parse:cn.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(u=>a(u,o)).then(u=>o.hooks?o.hooks.processAllTokens(u):u).then(u=>o.walkTokens?Promise.all(this.walkTokens(u,o.walkTokens)).then(()=>u):u).then(u=>c(u,o)).then(u=>o.hooks?o.hooks.postprocess(u):u).catch(l);try{o.hooks&&(n=o.hooks.preprocess(n));let u=a(n,o);o.hooks&&(u=o.hooks.processAllTokens(u)),o.walkTokens&&this.walkTokens(u,o.walkTokens);let d=c(u,o);return o.hooks&&(d=o.hooks.postprocess(d)),d}catch(u){return l(u)}}}onError(e,t){return n=>{if(n.message+=`
|
|
409
|
+
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+Bt(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},vr=new f2;function pe(e,t){return vr.parse(e,t)}pe.options=pe.setOptions=function(e){return vr.setOptions(e),pe.defaults=vr.defaults,_v(pe.defaults),pe};pe.getDefaults=qu;pe.defaults=Sr;pe.use=function(...e){return vr.use(...e),pe.defaults=vr.defaults,_v(pe.defaults),pe};pe.walkTokens=function(e,t){return vr.walkTokens(e,t)};pe.parseInline=vr.parseInline;pe.Parser=cn;pe.parser=cn.parse;pe.Renderer=ti;pe.TextRenderer=ld;pe.Lexer=an;pe.lexer=an.lex;pe.Tokenizer=ei;pe.Hooks=gl;pe.parse=pe;pe.options;pe.setOptions;pe.use;pe.walkTokens;pe.parseInline;cn.parse;an.lex;pe.setOptions({gfm:!0,breaks:!0});function ao(e){let t=null;"className"in e&&(e.className===null?t=null:typeof e.className=="string"&&(t=e.className));let n="default";"variant"in e&&e.variant==="comment"&&(n="comment");const{content:r}=e,s=p.useMemo(()=>{const l=r!==null?r.trim():"";return l?pe.parse(l):""},[r]);if(!s)return null;const o=n==="comment";return i.jsx("div",{className:Z("markdown-body w-full max-w-none text-foreground",o?"text-sm leading-normal [&_h1]:mb-1 [&_h1]:mt-2 [&_h1]:text-sm [&_h1]:font-semibold [&_h2]:mb-1 [&_h2]:mt-2 [&_h2]:text-sm [&_h2]:font-semibold [&_h3]:mb-0.5 [&_h3]:mt-2 [&_h3]:text-sm [&_h3]:font-medium [&_p]:my-1 [&_ul]:my-1 [&_ul]:list-disc [&_ul]:pl-4 [&_ol]:my-1 [&_ol]:list-decimal [&_ol]:pl-4 [&_li]:my-0.5":"text-sm leading-relaxed [&_h1]:mb-3 [&_h1]:mt-4 [&_h1]:text-xl [&_h1]:font-semibold [&_h2]:mb-2 [&_h2]:mt-4 [&_h2]:text-base [&_h2]:font-semibold [&_h3]:mb-2 [&_h3]:mt-3 [&_h3]:text-sm [&_h3]:font-semibold [&_p]:my-2 [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_li]:my-1","[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-[0.85em]","[&_pre]:my-2 [&_pre]:overflow-x-auto [&_pre]:rounded [&_pre]:bg-muted [&_pre]:p-2 [&_pre]:text-xs",t),dangerouslySetInnerHTML:{__html:s}})}function p2({value:e,onChange:t,placeholder:n="Write in markdown…",minRows:r=10,className:s=null}){const[o,l]=p.useState("write"),a=e.trim(),c=r!==null?r:10;let u="Write in markdown…";return n!==null&&(u=n),i.jsxs("div",{className:Z("overflow-hidden rounded-lg border border-white/[0.08] bg-[#0f0f0f]",s),children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-white/[0.06] px-2 py-1.5",children:[i.jsxs("div",{className:"flex gap-0.5",children:[i.jsx(Np,{active:o==="write",onClick:()=>l("write"),children:"Write"}),i.jsx(Np,{active:o==="preview",onClick:()=>l("preview"),children:"Preview"})]}),i.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Markdown"})]}),o==="write"?i.jsx("textarea",{value:e,onChange:d=>t(d.target.value),placeholder:u,rows:c,className:"w-full resize-y border-0 bg-transparent px-3 py-2.5 text-sm leading-relaxed text-foreground outline-none placeholder:text-muted-foreground/60"}):i.jsx("div",{className:"min-h-[8rem] px-3 py-2.5",children:a?i.jsx(ao,{content:e}):i.jsx("p",{className:"text-sm italic text-muted-foreground",children:"Nothing to preview yet."})})]})}function Np({active:e,onClick:t,children:n}){return i.jsx("button",{type:"button",onClick:t,className:Z("rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors",e?"bg-white/[0.08] text-foreground":"text-muted-foreground hover:bg-white/[0.04] hover:text-foreground"),children:n})}function Wv(e){const{open:t,onOpenChange:n,title:r,value:s,onSave:o}=e;let l=null;e.placeholder!==null&&(l=e.placeholder);const a=e.saving===!0,[c,u]=p.useState(s),d=a;return p.useEffect(()=>{t&&u(s)},[t,s]),i.jsx(hs,{open:t,onOpenChange:n,children:i.jsxs(wr,{className:"max-h-[90vh] max-w-3xl gap-0 overflow-hidden p-0 sm:rounded-xl",children:[i.jsx(br,{className:"border-b border-white/[0.06] px-6 py-4",children:i.jsx(kr,{children:r})}),i.jsx("div",{className:"max-h-[calc(90vh-8rem)] overflow-y-auto px-6 py-4",children:i.jsx(p2,{value:c,onChange:u,placeholder:l,minRows:18,className:"min-h-[20rem]"})}),i.jsxs(wo,{className:"border-t border-white/[0.06] px-6 py-4",children:[i.jsx(H,{type:"button",variant:"outline",disabled:d,onClick:()=>n(!1),children:"Cancel"}),i.jsx(H,{type:"button",disabled:d,onClick:()=>{o(c)},children:d?"Saving…":"Save"})]})]})})}function h2({session:e,taskId:t,links:n,onChange:r}){const[s,o]=p.useState(!1),[l,a]=p.useState([]),[c,u]=p.useState(null),[d,f]=p.useState(null),[h,y]=p.useState(!1),[x,w]=p.useState(!1),[b,m]=p.useState(""),v=p.useCallback(async()=>{y(!0);try{const S=await mv(e);a(S),!c&&S[0]&&u(S[0].id)}catch(S){Y.error(S instanceof Error?S.message:"Failed to load libraries")}finally{y(!1)}},[e,c]);p.useEffect(()=>{s&&v()},[s,v]),p.useEffect(()=>{if(!s||!c){f(null);return}let S=!0;return gv(e,c).then(C=>{S&&f(C)}),()=>{S=!1}},[s,c,e]);const g=p.useMemo(()=>new Set(n.map(S=>S.documentId)),[n]),k=p.useMemo(()=>{const S=d!==null?d.documents:[],C=b.trim().toLowerCase();return C?S.filter(U=>U.title.toLowerCase().includes(C)||U.description.toLowerCase().includes(C)):S},[d,b]);async function j(S){w(!0);try{const C=await XN(e,S,t);r(C),o(!1),Y.success("Document linked")}catch(C){Y.error(C instanceof Error?C.message:"Failed to link document")}finally{w(!1)}}async function E(S){try{await ZN(e,S,t),r(n.filter(C=>C.documentId!==S))}catch(C){Y.error(C instanceof Error?C.message:"Failed to unlink document")}}return i.jsxs("section",{className:"panel-card p-4",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Kl,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("h2",{className:"text-sm font-semibold text-white",children:"Linked documents"})]}),i.jsxs(H,{type:"button",size:"sm",variant:"outline",onClick:()=>o(!0),children:[i.jsx(Ct,{className:"h-4 w-4"}),"Link document"]})]}),n.length===0?i.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"No linked documents yet."}):i.jsx("ul",{className:"mt-3 space-y-2",children:n.map(S=>i.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-xl border border-white/[0.08] bg-[#111111] px-3 py-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs(tr,{to:`/library?doc=${S.documentId}`,className:"inline-flex items-center gap-1.5 text-sm font-medium text-primary hover:underline",children:[i.jsx(nv,{className:"h-3.5 w-3.5 shrink-0"}),i.jsx("span",{className:"truncate",children:S.documentTitle}),i.jsx(Zg,{className:"h-3 w-3 shrink-0 opacity-60"})]}),i.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:S.libraryTitle})]}),i.jsx(H,{type:"button",size:"icon",variant:"ghost",className:"h-8 w-8 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>void E(S.documentId),children:i.jsx(gn,{className:"h-4 w-4"})})]},S.documentId))}),i.jsx(hs,{open:s,onOpenChange:o,children:i.jsxs(wr,{className:"max-w-lg border-white/10 bg-[#111111]",children:[i.jsx(br,{children:i.jsx(kr,{children:"Link a library document"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(xe,{htmlFor:"library-select",children:"Library"}),i.jsx("select",{id:"library-select",value:c!==null?c:"",onChange:S=>u(S.target.value||null),className:"h-10 w-full rounded-md border border-white/10 bg-[#0d0d0d] px-3 text-sm",disabled:h,children:l.map(S=>i.jsx("option",{value:S.id,children:S.title},S.id))})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(xe,{htmlFor:"doc-search",children:"Search documents"}),i.jsx(Ne,{id:"doc-search",value:b,onChange:S=>m(S.target.value),placeholder:"Filter by title"})]}),i.jsx("div",{className:"max-h-64 space-y-1 overflow-y-auto",children:k.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:"No documents in this library."}):k.map(S=>{const C=g.has(S.id);return i.jsxs("button",{type:"button",disabled:C||x,onClick:()=>void j(S.id),className:"flex w-full items-start justify-between gap-3 rounded-lg border border-white/[0.08] px-3 py-2 text-left transition-colors hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[i.jsxs("span",{children:[i.jsx("span",{className:"block text-sm font-medium text-white",children:S.title}),S.description?i.jsx("span",{className:"mt-0.5 block line-clamp-2 text-xs text-muted-foreground",children:S.description}):null]}),i.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:C?"Linked":"Add"})]},S.id)})})]})]})})]})}const Vv=28;function m2(e,t){let n=`${e} task ${t+1}`;return t===0&&(n="New task"),{id:`task-${crypto.randomUUID()}`,title:n,description:"",assigneeRole:null,dependsOn:[],children:[]}}function Qn(e){const t=e.children.map(Qn);let n=e.description;n===null&&(n="");let r=e.assigneeRole;r===null&&(r=null);let s=e.dependsOn;return s===null&&(s=[]),{id:e.id,title:e.title,description:n,assigneeRole:r,dependsOn:s,children:t}}function Ye(e){return e.map(Qn)}function id(e){const t=[];for(const n of Ye(e))if(t.push(n),n.children.length>0)for(const r of id(n.children))t.push(r);return t}function Hv(e){return id(e).length}function Gv(e,t,n){return e.map(r=>r.id===t?Qn(Object.assign({},r,n)):r.children.length===0?r:Object.assign({},r,{children:Gv(r.children,t,n)}))}function Yv(e,t){return Ye(e.filter(n=>n.id!==t).map(n=>n.children.length>0?Object.assign({},n,{children:Yv(n.children,t)}):n))}function ad(e,t,n){return e.map(r=>r.id===t?Qn(Object.assign({},r,{children:r.children.concat([Qn(n)])})):r.children.length===0?r:Object.assign({},r,{children:ad(r.children,t,n)}))}function Kv(e,t){return Qn(m2(e,t))}function Qv(e,t){let n=`${e} subtask ${t+1}`;return t===0&&(n=`${e} subtask`),Qn({id:`task-${crypto.randomUUID()}`,title:n,description:"",assigneeRole:null,dependsOn:[],children:[]})}function cd(e,t,n=null){const r=Ye(e);for(let s=0;s<r.length;s+=1){const o=r[s];if(o){if(o.id===t)return{parentId:n,index:s,siblingCount:r.length};if(o.children.length>0){const l=cd(o.children,t,o.id);if(l)return l}}}return null}function $c(e,t,n){const r=cd(e,t);if(!r)return!1;const s=r.index+n;return s>=0&&s<r.siblingCount}function Xv(e,t,n,r){const s=n+r;if(t===null){const o=Ye(e);if(s<0||s>=o.length)return e;const l=o.slice(),a=l[n],c=l[s];return!a||!c?e:(l[n]=c,l[s]=a,l)}return e.map(o=>{if(o.id===t){const l=Ye(o.children);if(s<0||s>=l.length)return o;const a=l.slice(),c=a[n],u=a[s];return!c||!u?o:(a[n]=u,a[s]=c,Qn(Object.assign({},o,{children:a})))}return o.children.length===0?o:Object.assign({},o,{children:Xv(o.children,t,n,r)})})}function Zv(e,t,n){const r=cd(e,t);return!r||!$c(e,t,n)?e:Xv(e,r.parentId,r.index,n)}function Pi(e,t,n=0){for(const r of Ye(e)){if(r.id===t)return{template:r,depth:n};if(r.children.length>0){const s=Pi(r.children,t,n+1);if(s)return s}}return null}const jp=40,qv=8;function Jv(e){const t=Ye(e);return t.length===0?0:t.reduce((n,r,s)=>{let o=0;return s>0&&(o=qv),n+o+g2(r)},0)}function g2(e){const t=Ye(e.children),n=Jv(t);return n===0?jp:jp+qv+n}function ex(e){return Jv(e)}function No(e){const{title:t,onClick:n}=e;let r=null;"className"in e&&(typeof e.className=="string"?r=e.className:e.className===null&&(r=null));let s=!1;"disabled"in e&&e.disabled===!0&&(s=!0);let o={};if("style"in e){const u=e.style;typeof u<"u"&&u!==null&&(o=u)}let l=null;"dataEpicAdd"in e&&typeof e.dataEpicAdd=="string"&&(l=e.dataEpicAdd);let a=null;"dataNodeInsert"in e&&typeof e.dataNodeInsert=="string"&&(a=e.dataNodeInsert);let c=null;return"dataStageInsert"in e&&typeof e.dataStageInsert=="string"&&(c=e.dataStageInsert),i.jsx(H,{type:"button",variant:"outline",size:"icon",title:t,disabled:s,onClick:u=>{u.stopPropagation(),n()},className:Z("pointer-events-auto relative z-10 h-7 w-7 shrink-0 rounded-md border-white/[0.12] bg-[#111111] p-0 text-muted-foreground shadow-sm hover:border-primary/40 hover:bg-primary/10 hover:text-primary",r),style:o,"data-epic-add":l,"data-node-insert":a,"data-stage-insert":c,children:i.jsx(Ct,{className:"h-3.5 w-3.5"})})}const v2=24,x2=28,y2=20,w2=16+Vv;function b2(e){let t=0;return e>0&&(t=x2),e*fd+t+v2+dd+y2+Vv}function tx(e){let t=0;function n(r,s){t=Math.max(t,b2(s));for(const o of Ye(r.children))n(o,s+1)}for(const r of Ye(e))n(r,0);return t}function k2(e,t){const n=e.taskTemplates;return n.length===0?t:Math.max(t,tx(n))}function nx(e){return e.map(t=>{const n=t.taskTemplates;return[t.id,Hv(n),tx(n),ex(n)].join(":")}).join("|")}const Xn=280,Zn=88,Cp=56,ud=20,S2=40,dd=248,fd=22,co=4800,uo=3200;function rx(e){const t=e.slice().sort((a,c)=>a.position-c.position),n=t.map(a=>k2(a,Xn)),r=n.reduce((a,c)=>a+c,0)+Math.max(0,t.length-1)*Cp;let s=Math.max(80,(co-r)/2);const o=t.reduce((a,c)=>Math.max(a,ri(c)),Zn),l=Math.max(48,(uo-o)/2);return t.map((a,c)=>{let u=Xn;if(c>=0&&c<n.length){const f=n[c];typeof f=="number"&&(u=f)}const d=s;return s+=u+Cp,Object.assign({},a,{displayX:d,displayY:l,columnWidth:u})})}function N2(e){return`${e}-${crypto.randomUUID()}`}function ni(e){return{id:N2("stage"),title:"New step",description:"",position:e,autoAssignRole:null,layoutX:null,layoutY:null,spawnTaskCount:0,taskTemplates:[],activeTaskCount:null}}function sx(e,t,n){const r=e.slice().sort((l,a)=>l.position-a.position);let s=0;return t!==null&&(s=t+1),r.slice(0,s).concat([n],r.slice(s)).map((l,a)=>Object.assign({},l,{position:a}))}function ox(e,t,n){const r=e.slice().sort((c,u)=>c.position-u.position),s=t+n;if(s<0||s>=r.length)return e;const o=r.slice(),l=o[t],a=o[s];return!l||!a?e:(o[t]=a,o[s]=l,o.map((c,u)=>Object.assign({},c,{position:u})))}function Ht(e){const t=Ye(e.taskTemplates);return Object.assign({},e,{taskTemplates:t,spawnTaskCount:Hv(t)})}function ri(e){const t=e.taskTemplates,n=Zn+w2;return t.length===0?n:n+ud+ex(t)}function lx(e,t,n,r){function s(o){if(!o.ctrlKey&&!o.metaKey)return;o.preventDefault();const l=e.getBoundingClientRect(),a=o.clientX-l.left,c=o.clientY-l.top,u=t.getZoom(),d=t.getPan();let f=.92;o.deltaY<0&&(f=1.08);const h=Math.min(r,Math.max(n,u*f)),y=h/u;t.setPan({x:a-(a-d.x)*y,y:c-(c-d.y)*y}),t.setZoom(h)}return e.addEventListener("wheel",s,{passive:!1}),()=>e.removeEventListener("wheel",s)}function ix(e){e.preventDefault(),e.currentTarget instanceof HTMLElement&&e.currentTarget.setPointerCapture(e.pointerId)}function ax(e,t){const n=document.body.style.userSelect;document.body.style.userSelect="none";function r(o){o.preventDefault(),e(o)}function s(){t()}return window.addEventListener("pointermove",r),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s),()=>{document.body.style.userSelect=n,window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)}}const Jo=.35,wa=1.6;function ba(e,t,n){return Math.min(n,Math.max(t,e))}function j2(e,t){return{start:{x:e.displayX+Xn,y:e.displayY+Zn/2},end:{x:t.displayX,y:t.displayY+Zn/2}}}function C2(e,t){const{start:n,end:r}=j2(e,t);return`M ${n.x} ${n.y} L ${r.x} ${r.y}`}function E2(e,t,n){if(!t)return"upcoming";const r=n.findIndex(o=>o.id===t),s=n.findIndex(o=>o.id===e.id);return r<0||s<0?"upcoming":s<r?"complete":s===r?"current":"upcoming"}function _i(e){let t=e.workStatus;t===null&&(t=e.done?"done":"todo");let n=e.workStatusLabel;return n===null&&(n=t),{taskId:e.taskId,workStatus:t,workStatusLabel:n}}function T2(e){return{taskId:e.taskId,workStatus:e.workStatus,workStatusLabel:e.workStatusLabel}}function cx(e,t,n){if(t.stageId)return t.stageId;if(!t.parentId||t.parentId===n)return null;const r=e.find(s=>s.taskId===t.parentId);return r?cx(e,r,n):null}function R2(e,t,n,r){const s=new Set(e.map(l=>l.id));let o=null;if(t&&s.has(t)&&(o=t),o===null){const l=e.find(a=>a.taskTemplates.length>0);l&&(o=l.id)}if(o===null&&e.length>0){const l=e[0];l&&(o=l.id)}return n.map(l=>{let a=cx(n,l,r);return a===null&&(a=l.stageId),a&&!s.has(a)&&o&&(a=o),!a&&o&&(a=o),a===l.stageId?l:Object.assign({},l,{stageId:a})})}function I2(e,t,n,r,s){let o=t.parentId!==null?t.parentId:null;for(;o&&o!==r;){if(s.has(o)){const a=e.find(c=>c.taskId===o);if(a&&a.stageId===n)return!0}const l=e.find(a=>a.taskId===o);l?o=l.parentId:o=null}return!1}function P2(e,t,n){const r=new Map;for(const s of n)s.stageId===t&&r.set(s.templateId,T2(s));for(const s of e)s.stageId===t&&s.templateId&&r.set(s.templateId,_i(s));return r}function ux(e,t,n,r){const s=r.get(e);if(s)return s;const o=n.find(l=>l.templateId===e&&l.stageId===t);return o?_i(o):null}function _2(e,t,n,r,s){return t.filter(o=>!(o.stageId!==e||r.has(o.taskId)||s.has(o.taskId)||I2(t,o,e,n,s)))}function L2(e,t,n,r){const s=new Set;function o(l){for(const a of l){const c=ux(a.id,t,n,r);c!==null&&c.taskId!==null&&s.add(c.taskId),a.children.length>0&&o(Ye(a.children))}}return o(e),s}function M2(e,t,n,r){return e.filter(s=>s.parentId!==t||s.templateId||n.has(s.taskId)||r.has(s.taskId)?!1:(r.add(s.taskId),!0))}function O2(e,t,n,r,s){return t.filter(o=>o.stageId===e&&o.parentId===n&&!r.has(o.taskId)&&!s.has(o.taskId))}function A2(e,t,n,r){return t.filter(s=>s.stageId===e&&!n.has(s.taskId)&&!r.has(s.taskId))}function D2(e,t){const n=t.filter(o=>o.stageId===e),r=n.filter(o=>o.done).length,s=n.filter(o=>o.workStatus==="in_progress").length;return{total:n.length,done:r,inProgress:s}}function z2(e,t,n){return n?"border-blue-500/70 bg-blue-500/15 text-blue-50 shadow-[0_0_0_1px_rgba(59,130,246,0.45)]":t?e==="done"?"border-emerald-500/35 bg-emerald-500/10 text-emerald-100 hover:border-emerald-500/50":e==="in_progress"?"border-yellow-500/45 bg-yellow-500/10 text-yellow-50 hover:border-yellow-500/60":"border-zinc-500/35 bg-zinc-500/10 text-zinc-200 hover:border-zinc-400/45":"border-dashed border-white/[0.14] bg-white/[0.02] text-muted-foreground"}function $2({workStatus:e,spawned:t}){return t?e==="done"?i.jsx(JS,{className:"h-3.5 w-3.5 shrink-0 text-emerald-400"}):e==="in_progress"?i.jsx(ve,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-yellow-400"}):i.jsx(lp,{className:"h-3 w-3 shrink-0 text-zinc-400"}):i.jsx(lp,{className:"h-3 w-3 shrink-0 text-white/25"})}function F2({stage:e,flowIndex:t,phase:n,stats:r}){return i.jsxs("div",{className:Z("relative flex w-full shrink-0 select-none flex-col overflow-hidden rounded-2xl border bg-[#161616] shadow-lg",n==="current"&&"border-primary/50 shadow-[0_0_0_1px_rgba(96,165,250,0.25)]",n==="complete"&&"border-emerald-500/25",n==="upcoming"&&"border-white/[0.08] opacity-80"),style:{height:Zn},children:[i.jsx("div",{className:"flex items-center justify-center border-b border-white/[0.06] bg-white/[0.02] px-3 py-2",children:i.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:t+1})}),i.jsxs("div",{className:"flex min-h-0 flex-1 items-center justify-between gap-2 px-4 py-2",children:[i.jsx("p",{className:"min-w-0 flex-1 truncate text-[15px] font-semibold leading-snug text-white",children:e.title||"Untitled"}),i.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[n==="current"?i.jsx("span",{className:"rounded-md bg-primary/15 px-2 py-0.5 text-[10px] font-medium text-primary",children:"Active"}):null,r.total>0?i.jsxs("span",{className:"rounded-md bg-white/[0.06] px-2 py-0.5 text-[10px] text-muted-foreground",children:[r.done,"/",r.total," done",r.inProgress>0?` · ${r.inProgress} active`:""]}):null]})]})]})}function vl(e={}){let t=null;return"className"in e&&(e.className===null?t=null:typeof e.className=="string"&&(t=e.className)),i.jsx("div",{className:Z("shrink-0 bg-white/[0.14]",t)})}function pd({title:e,depth:t,runtime:n,selected:r,adHoc:s,onSelect:o,onAddSubtask:l}){const a=n!==null&&n.taskId!==null,c=n!==null?n.workStatus:null,u=t*fd;return i.jsx("div",{className:"pointer-events-auto flex flex-col gap-2",children:i.jsxs("div",{className:"flex items-center",style:{paddingLeft:u},children:[t>0?i.jsxs("div",{className:"relative mr-1 h-10 w-6 shrink-0",children:[i.jsx(vl,{className:"absolute right-0 top-1/2 h-px w-4 -translate-y-1/2"}),i.jsx(vl,{className:"absolute right-3 top-0 h-1/2 w-px"})]}):null,i.jsxs("button",{type:"button","data-epic-task":"true",disabled:!a,onClick:d=>{d.stopPropagation(),a&&o!==null&&o()},className:Z("pointer-events-auto flex shrink-0 items-center gap-2 rounded-lg border px-3 py-2 text-left transition-colors",z2(c,a,r),a?"cursor-pointer":"cursor-default"),style:{width:dd,minHeight:40},children:[i.jsx($2,{workStatus:c,spawned:a}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium",children:e}),i.jsx("span",{className:"shrink-0 text-[10px] opacity-80",children:s?"Ad-hoc":a||c?n!==null&&n.workStatusLabel!==null?n.workStatusLabel:"Todo":"Pending"})]}),a&&l?i.jsxs(i.Fragment,{children:[i.jsx(vl,{className:"mx-1 h-px w-3"}),i.jsx(No,{title:"Add subtask",dataEpicAdd:"true",onClick:l,className:null,disabled:null,style:null,dataNodeInsert:null,dataStageInsert:null})]}):null]})})}function hd({parentTaskId:e,depth:t,subtasks:n,excludeTaskIds:r,renderedTaskIds:s,selectedTaskId:o,onSelectTask:l,onAddSubtask:a}){const c=M2(n,e,r,s);return c.length===0?null:i.jsx("div",{className:"flex flex-col gap-2",children:c.map(u=>{const d=_i(u);return i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx(pd,{title:u.title,depth:t,runtime:d,selected:u.taskId===o,adHoc:!0,onSelect:()=>{l!==null&&l(u.taskId)},onAddSubtask:a?()=>a(u.taskId,u.title):null}),i.jsx(hd,{parentTaskId:u.taskId,depth:t+1,subtasks:n,excludeTaskIds:r,renderedTaskIds:s,selectedTaskId:o,onSelectTask:l,onAddSubtask:a})]},u.taskId)})})}function dx({templates:e,depth:t,stageId:n,subtasks:r,excludeTaskIds:s,renderedTaskIds:o,statusByTemplateId:l,selectedTaskId:a,onSelectTask:c,onAddSubtask:u}){return e.map(d=>{const f=ux(d.id,n,r,l);f!==null&&f.taskId!==null&&o.add(f.taskId);let h=null;if(f!==null&&f.taskId!==null&&u!==null){const y=f.taskId;h=()=>u(y,d.title)}return i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx(pd,{title:d.title,depth:t,runtime:f,selected:f!==null&&f.taskId===a,adHoc:null,onSelect:()=>{f!==null&&f.taskId!==null&&c!==null&&c(f.taskId)},onAddSubtask:h}),f!==null&&f.taskId!==null?i.jsx(hd,{parentTaskId:f.taskId,depth:t+1,subtasks:r,excludeTaskIds:s,renderedTaskIds:o,selectedTaskId:a,onSelectTask:c,onAddSubtask:u}):null,d.children.length>0?dx({templates:Ye(d.children),depth:t+1,stageId:n,subtasks:r,excludeTaskIds:s,renderedTaskIds:o,statusByTemplateId:l,selectedTaskId:a,onSelectTask:c,onAddSubtask:u}):null]},d.id)})}function ka(e,t,n,r,s,o,l,a,c){s.add(e.taskId);const u=_i(e);return i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx(pd,{title:e.title,depth:t,runtime:u,selected:e.taskId===o,adHoc:c,onSelect:()=>{l!==null&&l(e.taskId)},onAddSubtask:a?()=>a(e.taskId,e.title):null}),i.jsx(hd,{parentTaskId:e.taskId,depth:t+1,subtasks:n,excludeTaskIds:r,renderedTaskIds:s,selectedTaskId:o,onSelectTask:l,onAddSubtask:a})]},e.taskId)}function B2({stage:e,flowIndex:t,phase:n,epicId:r,subtasks:s,workflowState:o,renderedTaskIds:l,selectedTaskId:a,onSelectTask:c,onAddTaskToStage:u,onAddSubtask:d}){const f=Ye(e.taskTemplates),h=P2(s,e.id,o),y=L2(f,e.id,s,h),x=O2(e.id,s,r,y,l),w=D2(e.id,s),b=e.columnWidth!==null?e.columnWidth:Xn,m=f.length>0,v=s.some(T=>T.stageId===e.id),g=m||x.length>0||v,k=g?dx({templates:f,depth:0,stageId:e.id,subtasks:s,excludeTaskIds:y,renderedTaskIds:l,statusByTemplateId:h,selectedTaskId:a,onSelectTask:c,onAddSubtask:d}):[],j=g?_2(e.id,s,r,y,l):[],E=g?A2(e.id,s,l,y):[],S=x.map(T=>ka(T,0,s,y,l,a,c,d,!T.templateId)),C=j.map(T=>ka(T,T.parentId===r?0:1,s,y,l,a,c,d,!T.templateId)),U=E.map(T=>ka(T,T.parentId===r?0:1,s,y,l,a,c,d,!T.templateId));return i.jsxs("div",{className:"pointer-events-none absolute flex flex-col items-start",style:{left:e.displayX,top:e.displayY,width:b},children:[i.jsxs("div",{className:"relative z-10 shrink-0",style:{width:Xn},children:[i.jsx(F2,{stage:e,flowIndex:t,phase:n,stats:w}),u?i.jsxs("div",{className:"pointer-events-auto flex flex-col items-center",children:[i.jsx(vl,{className:"h-4 w-px"}),i.jsx(No,{title:"Add task to this step",dataEpicAdd:"true",onClick:u,className:null,disabled:null,style:null,dataNodeInsert:null,dataStageInsert:null})]}):null]}),g?i.jsxs("div",{className:"pointer-events-auto relative z-20 flex w-full flex-col gap-2",style:{marginTop:ud},children:[k,S,C,U]}):null]})}function U2(e){const{stages:t,epicId:n,epicStageId:r,subtasks:s,selectedTaskId:o,onSelectTask:l,onAddTaskToStage:a,onAddSubtask:c,className:u}=e;let d=[];e.workflowState!==null&&(d=e.workflowState);const f=p.useRef(null),h=p.useRef({x:48,y:48}),y=p.useRef(.85),[x,w]=p.useState({x:48,y:48}),[b,m]=p.useState(.85),[v,g]=p.useState(null);h.current=x,y.current=b;const k=p.useMemo(()=>t.slice().sort((_,K)=>_.position-K.position),[t]),j=p.useMemo(()=>rx(t),[t]),E=p.useMemo(()=>nx(t),[t]),S=p.useMemo(()=>R2(t,r,s,n),[t,r,s,n]),C=new Set,U=p.useMemo(()=>{const _=[];for(let K=0;K<j.length-1;K+=1){const J=j[K],O=j[K+1];J&&O&&_.push(C2(J,O))}return _},[j]),T=p.useCallback(()=>{const _=f.current;if(!_||j.length===0)return;let K=1/0,J=1/0,O=-1/0,A=-1/0;for(const G of j)K=Math.min(K,G.displayX),J=Math.min(J,G.displayY),O=Math.max(O,G.displayX+G.columnWidth),A=Math.max(A,G.displayY+ri(G));const W=80,R=O-K+W*2,$=A-J+W*2,F=ba(Math.min(_.clientWidth/R,_.clientHeight/$),Jo,1),X=R*F,ee=$*F;m(F),w({x:(_.clientWidth-X)/2-(K-W)*F,y:(_.clientHeight-ee)/2-(J-W)*F})},[j]);p.useEffect(()=>{j.length>0&&T()},[E,j.length,T]),p.useEffect(()=>{if(!v)return;const _=v;return ax(K=>{w({x:_.panX+(K.clientX-_.startX),y:_.panY+(K.clientY-_.startY)})},()=>{g(null)})},[v]),p.useEffect(()=>{const _=f.current;if(_)return lx(_,{getZoom:()=>y.current,getPan:()=>h.current,setZoom:m,setPan:w},Jo,wa)},[]);const V=p.useMemo(()=>k.reduce((_,K)=>_+id(K.taskTemplates).length,0),[k]);return i.jsxs("div",{className:Z("relative flex min-h-0 flex-1 flex-col bg-[#080808]",u),children:[i.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b border-white/[0.06] px-4 py-2.5",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-xs text-foreground",children:"Click a task for the panel · Drag to pan · Ctrl+scroll to zoom"}),i.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-3 text-[11px] text-muted-foreground",children:[i.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[i.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-400"})," Done"]}),i.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[i.jsx("span",{className:"h-2 w-2 rounded-full bg-yellow-400"})," In progress"]}),i.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[i.jsx("span",{className:"h-2 w-2 rounded-full bg-zinc-400"})," Todo"]}),i.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[i.jsx("span",{className:"h-2 w-2 rounded-full bg-blue-500"})," Selected"]}),i.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[i.jsx("span",{className:"h-2 w-2 rounded-full border border-dashed border-white/30"})," Pending"]})]})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(_=>ba(_*.9,Jo,wa)),children:i.jsx(iv,{className:"h-4 w-4"})}),i.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(_=>ba(_*1.1,Jo,wa)),children:i.jsx(lv,{className:"h-4 w-4"})}),i.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>T(),children:i.jsx(rv,{className:"h-4 w-4"})})]})]}),i.jsx("div",{ref:f,className:"relative min-h-[420px] flex-1 cursor-grab select-none overflow-hidden active:cursor-grabbing",onPointerDown:_=>{_.button!==0&&_.button!==1||_.target.closest("[data-epic-task]")||(ix(_),g({startX:_.clientX,startY:_.clientY,panX:x.x,panY:x.y}))},children:i.jsxs("div",{className:"absolute left-0 top-0 origin-top-left",style:{transform:`translate(${x.x}px, ${x.y}px) scale(${b})`,width:co,height:uo},children:[j.map((_,K)=>i.jsx(B2,{stage:_,flowIndex:K,phase:E2(_,r,k),epicId:n,subtasks:S,workflowState:d,renderedTaskIds:C,selectedTaskId:o,onSelectTask:l,onAddTaskToStage:a?()=>a(_.id,_.title):null,onAddSubtask:c?(J,O)=>c(J,O,_.id):null},_.id)),i.jsx("svg",{className:"pointer-events-none absolute inset-0 z-[5]",width:co,height:uo,"aria-hidden":!0,children:U.map((_,K)=>i.jsx("path",{d:_,fill:"none",stroke:"rgba(96,165,250,0.35)",strokeWidth:"2"},`connector-${K}`))})]})}),V===0?i.jsx("p",{className:"border-t border-white/[0.06] px-4 py-3 text-xs text-muted-foreground",children:"No pipeline template configured. Set up tasks on the Pipeline page first."}):null]})}function W2(e,t,n){if(!e.parentId||e.parentId===t)return!1;const r=n.find(s=>s.taskId===e.parentId);return r?!r.done:!1}const V2=[{value:"todo",label:"Todo"},{value:"in_progress",label:"In progress"},{value:"done",label:"Done"}];function H2({projectId:e,epicId:t,subtasks:n,selected:r,members:s,actAsMemberId:o,updatingStatus:l,onActAsMemberChange:a,onClose:c,onStatusChange:u}){const d=r?W2(r,t,n):!1;let f=null;if(o){for(const h of s)if(h.id===o){f=h;break}}return i.jsxs("aside",{className:"flex w-[340px] shrink-0 flex-col border-l border-white/[0.06] bg-[#0c0c0c]",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-white/[0.06] px-4 py-3",children:[i.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:r?"Task":"Details"}),r?i.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:c,children:i.jsx(Gu,{className:"h-4 w-4"})}):null]}),r?i.jsxs("div",{className:"flex flex-1 flex-col gap-5 overflow-y-auto px-4 py-4",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-sm font-semibold leading-snug text-white",children:r.title}),i.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Step: ",r.stageTitle!==null?r.stageTitle:r.stageId!==null?r.stageId:"—",r.templateId?null:" · Ad-hoc"]}),r.claimedBy?i.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Claimed by ",r.claimedBy]}):null]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs text-muted-foreground",children:"Act as"}),i.jsx("select",{value:o,onChange:h=>a(h.target.value),className:"h-10 w-full rounded-xl border border-white/[0.1] bg-[#111] px-3 text-sm",disabled:s.length===0,children:s.length===0?i.jsx("option",{value:"",children:"Add a member on Pipeline → Team"}):s.map(h=>i.jsx("option",{value:h.id,children:h.name},h.id))})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-xs font-medium text-foreground",children:"Work status"}),d?i.jsx("p",{className:"text-xs text-amber-400/90",children:"Parent task must be done first."}):null,i.jsx("div",{className:"grid grid-cols-1 gap-2",children:V2.map(h=>i.jsx(H,{type:"button",size:"sm",variant:r.workStatus===h.value?"default":"outline",disabled:l||!f||d&&h.value!=="todo"&&r.workStatus!==h.value,className:Z("justify-start",r.workStatus===h.value&&h.value==="done"&&"bg-emerald-600 hover:bg-emerald-600/90",r.workStatus===h.value&&h.value==="in_progress"&&"bg-yellow-600 hover:bg-yellow-600/90",r.workStatus===h.value&&h.value==="todo"&&"bg-zinc-600 hover:bg-zinc-600/90"),onClick:()=>u(r.taskId,h.value),children:h.label},h.value))})]}),i.jsx(H,{type:"button",variant:"outline",size:"sm",asChild:!0,className:"w-full justify-start",children:i.jsxs(tr,{to:`/projects/${e}/tasks/${r.taskId}`,children:[i.jsx(Zg,{className:"mr-2 h-4 w-4"}),"Open task page"]})})]}):i.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 py-8 text-center",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a task on the canvas to view and update its status."}),i.jsxs("p",{className:"text-xs text-muted-foreground/70",children:["Use the ",i.jsx("span",{className:"font-medium text-foreground",children:"+ Task"})," button under any step to add one."]})]})]})}function Ep(e){if(!e)return 0;const t=Date.parse(e);return Number.isNaN(t)?0:t}function G2(e){return e.slice().sort((t,n)=>Ep(t.at)-Ep(n.at))}function Y2(e){return e.authorId.trim()?e.authorId.trim():e.by.trim()?e.by.trim():e.role==="system"?"System":"User"}function K2(){const{projectId:e="",taskId:t}=fs(),n=Number(t),r=zt(),[s,o]=p.useState(null),[l,a]=p.useState([]),[c,u]=p.useState([]),[d,f]=p.useState(""),[h,y]=p.useState(!0),[x,w]=p.useState(""),[b,m]=p.useState(!1),[v,g]=p.useState(!1),[k,j]=p.useState(!1),[E,S]=p.useState(null),[C,U]=p.useState(!1),[T,V]=p.useState(!1),[_,K]=p.useState(!1),[J,O]=p.useState(null);p.useEffect(()=>{if(!r||!Number.isFinite(n))return;const P=r;let N=!0;async function I(){y(!0);try{const B=await dp(P,n);if(!N)return;if(B.status==="ready"&&xv(n),o(B),B.isEpic){const q=B.projectId!==null?B.projectId:e;if(q){const ce=await hv(P,q);N&&(a(ce.stages),u(ce.members),f(fe=>{if(fe&&ce.members.some(en=>en.id===fe))return fe;const Ce=ce.members[0];return Ce?Ce.id:""}))}}}catch(B){Y.error(B instanceof Error?B.message:"Failed to load task")}finally{N&&y(!1)}}return I(),()=>{N=!1}},[r,n,e]);const A=p.useMemo(()=>G2(s!==null?s.comments:[]),[s]),W=s!==null&&s.description.trim()!==""?s.description:null,R=s!==null?s.subtasks:[],$=p.useMemo(()=>{const P=R.find(N=>N.taskId===J);return P||null},[R,J]),F=p.useMemo(()=>{const P=R.length,N=R.filter(B=>B.done).length,I=R.filter(B=>B.workStatus==="in_progress").length;return{total:P,done:N,active:I}},[R]);async function X(){if(!r||!Number.isFinite(n))return;const P=await dp(r,n);return o(P),P}async function ee(P){if(!r||!Number.isFinite(n))return;const N=c.find(I=>I.id===d);if(!N){Y.error("Pick a project member on the epic canvas first");return}g(!0);try{const I=await fp(r,n,P,N.name);o(I),Y.success("Status updated")}catch(I){Y.error(I instanceof Error?I.message:"Failed to update status")}finally{g(!1)}}async function G(P,N){if(!r)return;const I=c.find(B=>B.id===d);j(!0);try{const B=I?I.name:"web";await fp(r,P,N,B);const q=await X();q&&q.subtasks.find(fe=>fe.taskId===P)&&O(P),Y.success("Status updated")}catch(B){Y.error(B instanceof Error?B.message:"Failed to update status")}finally{j(!1)}}async function ne(P,N){if(!r||!E)return;const I=P.trim();if(I){U(!0);try{const B=await DN(r,{parentId:E.parentId,title:I,description:N.trim()||null,stageId:E.stageId}),q=await X(),ce=Number(B.id);if(Number.isFinite(ce))O(ce);else if(q&&q.subtasks.length>0){const fe=q.subtasks.find(Ce=>Ce.title===I);fe&&O(fe.taskId)}Y.success(`Added to ${E.label}`),S(null)}catch(B){Y.error(B instanceof Error?B.message:"Failed to create task")}finally{U(!1)}}}async function oe(P){if(!(!r||!Number.isFinite(n))){K(!0);try{const N=await $N(r,n,P);o(N),V(!1),Y.success("Description saved")}catch(N){Y.error(N instanceof Error?N.message:"Failed to save description")}finally{K(!1)}}}async function le(){if(!r||!Number.isFinite(n))return;const P=x.trim();if(P){m(!0);try{const N=await zN(r,n,P);o(N),w(""),Y.success("Comment added")}catch(N){Y.error(N instanceof Error?N.message:"Failed to send comment")}finally{m(!1)}}}const we=`/projects/${e}/tasks`,M=[{label:"Projects",to:"/projects"},{label:r!==null&&r.projectName!==null?r.projectName:e!==null?e:"Project",to:we},{label:"Epics",to:we}];s!==null&&s.parent!==null&&M.push({label:s.parent.title,to:`${we}/${s.parent.taskId}`});let D="Task";return!h&&s!==null&&(D=s.title),i.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.jsx(bn,{breadcrumb:M,title:h?"Loading…":D}),i.jsx("div",{className:"flex-1 overflow-y-auto px-8 py-5 pb-10",children:i.jsx("div",{className:"flex flex-col gap-5",children:h?i.jsx(dn,{className:"h-96 w-full rounded-xl"}):s?i.jsxs(i.Fragment,{children:[i.jsx("header",{className:"space-y-3 border-b border-border pb-4",children:i.jsxs("div",{className:"flex flex-wrap gap-2 text-sm text-muted-foreground",children:[s.parent?i.jsxs(tr,{to:`/projects/${e}/tasks/${s.parent.taskId}`,className:"rounded-full border px-2 py-0.5 hover:text-foreground",children:["Parent: ",s.parent.title]}):null,s.isEpic&&s.stage!==null&&s.stage.title.length>0?i.jsxs("span",{className:"rounded-full border border-primary/30 bg-primary/10 px-2 py-0.5 text-primary",children:["Active step: ",s.stage.title]}):null,s.isEpic&&F.total>0?i.jsxs("span",{className:"rounded-full border px-2 py-0.5 text-foreground",children:[F.done,"/",F.total," tasks done",F.active>0?` · ${F.active} in progress`:""]}):null,!s.isEpic&&s.workStatusLabel?i.jsx("span",{className:"rounded-full border px-2 py-0.5 text-foreground",children:s.workStatusLabel}):null,s.assignee?i.jsxs("span",{children:["Assignee: ",s.assignee]}):null]})}),s.isEpic?i.jsxs("section",{className:"panel-card p-5",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsx("h2",{className:"text-sm font-semibold text-white",children:"Description"}),i.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:()=>V(!0),children:[i.jsx(sv,{className:"mr-1.5 h-3.5 w-3.5"}),W?"Edit":"Add"]})]}),i.jsx("div",{className:"mt-3",children:W?i.jsx(ao,{content:W}):i.jsx("p",{className:"text-sm text-muted-foreground",children:"No description yet — add goals, scope, or acceptance notes."})})]}):null,r&&s.isEpic?i.jsx(h2,{session:r,taskId:n,links:s.libraryLinks!==null?s.libraryLinks:[],onChange:P=>o(N=>N&&Object.assign({},N,{libraryLinks:P}))}):null,s.isEpic?i.jsxs("div",{className:"flex min-h-[min(72vh,680px)] overflow-hidden rounded-xl border border-white/[0.06] bg-[#080808]",children:[i.jsx(U2,{stages:l,epicId:n,epicStageId:s.stageId,subtasks:R,workflowState:s.workflowState,selectedTaskId:J,onSelectTask:O,onAddTaskToStage:(P,N)=>S({parentId:n,stageId:P,label:`step "${N}"`}),onAddSubtask:(P,N,I)=>S({parentId:P,stageId:I,label:`subtask of "${N}"`}),className:null}),i.jsx(H2,{projectId:e,epicId:n,subtasks:R,selected:$,members:c,actAsMemberId:d,updatingStatus:k,onActAsMemberChange:f,onClose:()=>O(null),onStatusChange:(P,N)=>void G(P,N)})]}):null,s.isEpic?null:i.jsxs(Kt,{children:[i.jsx(Vn,{className:"pb-2",children:i.jsx(Hn,{className:"text-base font-semibold",children:"Work status"})}),i.jsxs(Qt,{className:"space-y-3 pt-0",children:[i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Step: ",function(){const P=s.stage!==null?s.stage.title:null;return P!==null?P:s.stageId!==null?s.stageId:"-"}()]}),i.jsx("div",{className:"flex flex-wrap gap-2",children:["todo","in_progress","done"].map(P=>i.jsx(H,{size:"sm",variant:s.workStatus===P?"default":"outline",disabled:v,onClick:()=>void ee(P),children:P==="in_progress"?"In progress":P==="done"?"Done":"Todo"},P))})]})]}),!s.isEpic&&W?i.jsxs(Kt,{children:[i.jsx(Vn,{className:"pb-2",children:i.jsx(Hn,{className:"text-base font-semibold",children:"Description"})}),i.jsx(Qt,{className:"pt-0",children:i.jsx(ao,{content:W})})]}):null,s.isEpic?i.jsx(Wv,{open:T,onOpenChange:V,title:"Epic description",value:s!==null?s.description:"",onSave:P=>void oe(P),placeholder:"Goals, scope, links, acceptance notes…",saving:_}):null,s.isEpic?i.jsx(Ij,{open:E!==null,onOpenChange:P=>{P||S(null)},targetLabel:E!==null?E.label:null,saving:C,onCreate:(P,N)=>void ne(P,N)}):null,s.isEpic?null:i.jsxs(Kt,{children:[i.jsx(Vn,{className:"pb-2",children:i.jsx(Hn,{className:"text-base font-semibold",children:"Comments"})}),i.jsxs(Qt,{className:"space-y-4 pt-0",children:[A.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:"No comments yet."}):i.jsx("div",{className:"divide-y divide-border",children:A.map(P=>i.jsx(Q2,{comment:P},P.id))}),i.jsxs("div",{className:"border-t border-border pt-4",children:[i.jsx(Kn,{value:x,onChange:P=>w(P.target.value),placeholder:"Add a comment…",rows:2,disabled:b,className:"min-h-[56px] resize-y",onKeyDown:P=>{P.key==="Enter"&&(P.metaKey||P.ctrlKey)&&(P.preventDefault(),le())}}),i.jsx("div",{className:"mt-2 flex justify-end",children:i.jsxs(H,{type:"button",size:"sm",variant:"secondary",onClick:()=>void le(),disabled:b||!x.trim(),children:[b?i.jsx(ve,{className:"mr-2 h-4 w-4 animate-spin"}):null,b?"Saving…":"Comment"]})})]})]})]})]}):i.jsx("p",{className:"text-sm text-muted-foreground",children:"Task not found."})})})]})}function Q2({comment:e}){const t=Y2(e);let n=e.body;n===null&&(n=e.text);const r=e.tags;return i.jsxs("article",{className:"w-full py-3 first:pt-0 last:pb-0",children:[i.jsxs("p",{className:"text-xs text-muted-foreground",children:[i.jsx("span",{className:"font-medium text-foreground",children:t}),r.length>0?i.jsxs(i.Fragment,{children:[" · ",r.join(", ")]}):null,e.at?i.jsxs(i.Fragment,{children:[" · ",Bu(e.at)]}):null]}),i.jsx("div",{className:"mt-1 w-full",children:i.jsx(ao,{content:n})})]})}function X2(e){return e<=0?"Task":"Subtask"}function Tp({label:e,value:t,onChange:n,placeholder:r}){const[s,o]=p.useState(!1),l=t.trim();return i.jsxs("div",{className:"space-y-2",children:[i.jsx(xe,{children:e}),i.jsx("div",{className:"min-h-[4.5rem] rounded-lg border border-white/[0.08] bg-[#0f0f0f] px-3 py-2.5",children:l?i.jsx(ao,{content:t,className:"text-sm"}):i.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No description yet."})}),i.jsxs(H,{type:"button",variant:"outline",size:"sm",onClick:()=>o(!0),children:[i.jsx(sv,{className:"mr-2 h-3.5 w-3.5"}),"Edit description"]}),i.jsx(Wv,{open:s,onOpenChange:o,title:e,value:t,onSave:a=>{n(a),o(!1)},placeholder:r,saving:null})]})}function fx({stage:e,stageCount:t,selectedTaskTemplateId:n,onChange:r,onSelectTaskTemplate:s,onDeleteStage:o,onClose:l}){const{confirmDestructive:a}=Yu(),c=e.activeTaskCount!==null?e.activeTaskCount:0,u=t>1&&c===0,d=e.taskTemplates,f=n?Pi(d,n):null,h=f!==null?f.template:null,y=f!==null?f.depth:0;function x(m){r(Ht(Object.assign({},e,m)))}function w(m){r(Ht(Object.assign({},e,{taskTemplates:m})))}function b(m,v){w(Gv(d,m,v))}return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:h?X2(y):"Pipeline step"}),i.jsx("p",{className:"mt-1 truncate text-sm font-semibold text-white",children:h?h.title:e.title||"Untitled"}),h?i.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:["Step: ",e.title||"Untitled",y>0?` · nested level ${y}`:""]}):i.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Use + on the canvas to add tasks"})]}),i.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:l,children:i.jsx(Gu,{className:"h-4 w-4"})})]}),h?i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(xe,{htmlFor:"task-title",children:"Title"}),i.jsx(Ne,{id:"task-title",value:h.title,onChange:m=>b(h.id,{title:m.target.value})})]}),i.jsx(Tp,{label:"Description",value:h.description,onChange:m=>b(h.id,{description:m}),placeholder:"What should happen in this task?"}),i.jsxs(H,{type:"button",variant:"ghost",className:"w-full justify-start text-destructive hover:text-destructive",onClick:()=>{(async()=>await a(`Delete "${h.title}"?`,null)&&(w(Yv(d,h.id)),s(null)))()},children:[i.jsx(gn,{className:"mr-2 h-4 w-4"}),"Delete node"]})]}):i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(xe,{htmlFor:"stage-title",children:"Title"}),i.jsx(Ne,{id:"stage-title",value:e.title,onChange:m=>x({title:m.target.value})})]}),i.jsx(Tp,{label:"Description",value:e.description,onChange:m=>x({description:m}),placeholder:"Step context, expectations, notes…"}),t<=1?i.jsx("p",{className:"text-xs text-muted-foreground",children:"At least one pipeline step is required."}):c>0?i.jsxs("p",{className:"text-xs text-muted-foreground",children:[c," epic(s) are on this step and it cannot be deleted."]}):null,i.jsxs(H,{type:"button",variant:"ghost",disabled:!u,className:"w-full justify-start text-destructive hover:text-destructive disabled:opacity-40",onClick:()=>{u&&(async()=>await a(`Delete step "${e.title||"Untitled"}"?`,null)&&o())()},children:[i.jsx(gn,{className:"mr-2 h-4 w-4"}),"Delete step"]})]})]})}const el=.35,Sa=1.6;function Na(e,t,n){return Math.min(n,Math.max(t,e))}function px(e,t){const n={x:e.displayX+Xn,y:e.displayY+Zn/2},r={x:t.displayX,y:t.displayY+Zn/2};return{start:n,end:r}}function Z2(e,t){const{start:n,end:r}=px(e,t);return`M ${n.x} ${n.y} L ${r.x} ${r.y}`}function q2(e,t){const{start:n,end:r}=px(e,t);return{x:(n.x+r.x)/2,y:(n.y+r.y)/2}}function J2({stage:e,flowIndex:t,selected:n,canMoveLeft:r,canMoveRight:s,onSelect:o,onMoveLeft:l,onMoveRight:a}){const c=Ye(e.taskTemplates).length;return i.jsxs("div",{"data-stage-card":"true",className:Z("pointer-events-auto relative flex w-full shrink-0 select-none flex-col overflow-hidden rounded-2xl border bg-[#161616] shadow-lg transition-[border-color,box-shadow] duration-150",n?"border-white/25 shadow-[0_0_0_1px_rgba(255,255,255,0.08)]":"border-white/[0.08]"),style:{height:Zn},children:[i.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-white/[0.06] bg-white/[0.02] px-3 py-2",children:[i.jsx("button",{type:"button",disabled:!r,onClick:u=>{u.stopPropagation(),l()},className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-white/[0.08] hover:text-foreground disabled:pointer-events-none disabled:opacity-25","aria-label":"Move left",children:i.jsx(ZS,{className:"h-4 w-4"})}),i.jsx("span",{className:"min-w-0 flex-1 truncate px-1 text-center text-[11px] font-medium text-muted-foreground",children:t+1}),i.jsx("button",{type:"button",disabled:!s,onClick:u=>{u.stopPropagation(),a()},className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-white/[0.08] hover:text-foreground disabled:pointer-events-none disabled:opacity-25","aria-label":"Move right",children:i.jsx(yo,{className:"h-4 w-4"})})]}),i.jsxs("button",{type:"button","data-stage-select":"true",onClick:u=>{u.stopPropagation(),o()},className:"flex min-h-0 flex-1 items-center justify-between gap-2 px-4 py-2 text-left transition-colors hover:bg-white/[0.03]",children:[i.jsx("p",{className:"min-w-0 flex-1 truncate text-[15px] font-semibold leading-snug text-white",children:e.title||"Untitled"}),i.jsx("div",{className:"flex shrink-0 flex-wrap justify-end gap-1",children:c>0?i.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-emerald-500/15 px-2 py-1 text-[10px] font-medium text-emerald-400",children:[i.jsx(Rc,{className:"h-2.5 w-2.5"}),c," tasks"]}):null})]})]})}function xl(e={}){let t=null;return"className"in e&&(e.className===null?t=null:typeof e.className=="string"&&(t=e.className)),i.jsx("div",{className:Z("shrink-0 bg-white/[0.14]",t)})}function Rp({direction:e,disabled:t,onClick:n}){const r=e==="up"?qS:XS;return i.jsx("button",{type:"button","data-task-reorder":"true",disabled:t,onClick:s=>{s.stopPropagation(),n()},className:"flex h-[18px] w-5 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-white/[0.08] hover:text-foreground disabled:pointer-events-none disabled:opacity-25","aria-label":e==="up"?"Move up":"Move down",children:i.jsx(r,{className:"h-3.5 w-3.5"})})}function hx({template:e,depth:t,stageTemplates:n,selectedTaskTemplateId:r,onSelectTaskTemplate:s,onAddSubtask:o,onMoveTaskTemplate:l}){const a=r===e.id,c=t>0,u=Ye(e.children),d=t*fd,f=$c(n,e.id,-1),h=$c(n,e.id,1);return i.jsxs("div",{className:"pointer-events-auto flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center",style:{paddingLeft:d},children:[t>0?i.jsxs("div",{className:"relative mr-1 h-10 w-6 shrink-0",children:[i.jsx(xl,{className:"absolute right-0 top-1/2 h-px w-4 -translate-y-1/2"}),i.jsx(xl,{className:"absolute right-3 top-0 h-1/2 w-px"})]}):null,i.jsxs("div",{className:"flex items-center",children:[i.jsxs("div",{className:"mr-1 flex shrink-0 flex-col",children:[i.jsx(Rp,{direction:"up",disabled:!f,onClick:()=>l(e.id,-1)}),i.jsx(Rp,{direction:"down",disabled:!h,onClick:()=>l(e.id,1)})]}),i.jsx("button",{type:"button","data-task-template":"true",onClick:y=>{y.stopPropagation(),s(e.id)},className:Z("relative flex shrink-0 items-center rounded-lg border px-3 text-left transition-[border-color,background-color] duration-150 hover:bg-[#151515]",a?"border-emerald-500/30 bg-[#141a16]":"border-white/[0.07] bg-[#111111]"),style:{width:dd,minHeight:S2},children:i.jsxs("div",{className:"flex w-full items-center gap-2",children:[i.jsx("span",{className:Z("h-1.5 w-1.5 shrink-0 rounded-full",c?"bg-sky-500/80":"bg-emerald-500/80")}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-white/90",children:e.title})]})}),i.jsx(xl,{className:"mx-1 h-px w-3"}),i.jsx(No,{title:"Add subtask",dataNodeInsert:"true",onClick:()=>o(e.id),className:null,disabled:null,style:null,dataEpicAdd:null,dataStageInsert:null})]})]}),u.length>0?i.jsx("div",{className:"flex flex-col gap-2",children:u.map(y=>i.jsx(hx,{template:y,depth:t+1,stageTemplates:n,selectedTaskTemplateId:r,onSelectTaskTemplate:s,onAddSubtask:o,onMoveTaskTemplate:l},y.id))}):null]})}function eC({stage:e,flowIndex:t,templates:n,selectedStageId:r,selectedTaskTemplateId:s,canMoveLeft:o,canMoveRight:l,onSelectStage:a,onSelectTaskTemplate:c,onAddStageTask:u,onAddSubtask:d,onMoveTaskTemplate:f,onMoveLeft:h,onMoveRight:y}){const x=Ye(n),w=e.columnWidth!==null?e.columnWidth:Xn;return i.jsxs("div",{className:"pointer-events-none absolute flex flex-col items-start",style:{left:e.displayX,top:e.displayY,width:w},children:[i.jsxs("div",{className:"relative z-10 shrink-0",style:{width:Xn},children:[i.jsx(J2,{stage:e,flowIndex:t,selected:r===e.id&&!s,canMoveLeft:o,canMoveRight:l,onSelect:a,onMoveLeft:h,onMoveRight:y}),i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx(xl,{className:"h-4 w-px"}),i.jsx(No,{title:"Add task to step",dataNodeInsert:"true",onClick:u,className:null,disabled:null,style:null,dataEpicAdd:null,dataStageInsert:null})]})]}),i.jsx("div",{className:"pointer-events-auto relative z-0 flex w-full flex-col gap-2",style:{marginTop:ud},children:x.map(b=>i.jsx(hx,{template:b,depth:0,stageTemplates:n,selectedTaskTemplateId:r===e.id?s:null,onSelectTaskTemplate:c,onAddSubtask:d,onMoveTaskTemplate:f},b.id))})]})}function mx({stages:e,selectedStageId:t=null,selectedTaskTemplateId:n=null,onAddStage:r,onInsertStageAfter:s,onMoveStage:o,onSelectStage:l,onSelectTaskTemplate:a,onAddStageTask:c,onAddSubtask:u,onMoveTaskTemplate:d,className:f}){const h=p.useRef(null),y=p.useRef({x:48,y:48}),x=p.useRef(.85),[w,b]=p.useState({x:48,y:48}),[m,v]=p.useState(.85),[g,k]=p.useState(null);y.current=w,x.current=m;const j=p.useMemo(()=>rx(e),[e]),E=p.useMemo(()=>nx(e),[e]),S=p.useMemo(()=>{const O=[];for(let A=0;A<j.length-1;A+=1){const W=j[A],R=j[A+1];W&&R&&O.push(Z2(W,R))}return O},[j]),C=p.useCallback(()=>{const O=h.current;if(!O||j.length===0||O.clientWidth===0||O.clientHeight===0)return;let A=1/0,W=1/0,R=-1/0,$=-1/0;for(const le of j)A=Math.min(A,le.displayX),W=Math.min(W,le.displayY),R=Math.max(R,le.displayX+le.columnWidth),$=Math.max($,le.displayY+ri(le));const F=80,X=R-A+F*2,ee=$-W+F*2,G=Na(Math.min(O.clientWidth/X,O.clientHeight/ee),el,1),ne=X*G,oe=ee*G;v(G),b({x:(O.clientWidth-ne)/2-(A-F)*G,y:(O.clientHeight-oe)/2-(W-F)*G})},[j]),U=p.useCallback(()=>{const O=h.current;if(!O||j.length===0||O.clientWidth===0||O.clientHeight===0)return;let A=1/0,W=1/0,R=-1/0,$=-1/0;for(const G of j)A=Math.min(A,G.displayX),W=Math.min(W,G.displayY),R=Math.max(R,G.displayX+G.columnWidth),$=Math.max($,G.displayY+ri(G));const F=(A+R)/2,X=(W+$)/2,ee=x.current;b({x:O.clientWidth/2-F*ee,y:O.clientHeight/2-X*ee})},[j]),T=p.useRef(!1),V=p.useRef({width:0,height:0});p.useEffect(()=>{const O=h.current;if(!O||j.length===0)return;function A(){if(O===null)return;const R=O.clientWidth,$=O.clientHeight;if(R===0||$===0)return;const F=V.current.width===0||V.current.height===0;if(V.current={width:R,height:$},!T.current||F){T.current=!0,C();return}U()}const W=new ResizeObserver(()=>A());return W.observe(O),A(),()=>W.disconnect()},[E,j.length,C,U]),p.useEffect(()=>{if(!g)return;const O=g;return ax(A=>{b({x:O.panX+(A.clientX-O.startX),y:O.panY+(A.clientY-O.startY)})},()=>{k(null)})},[g]),p.useEffect(()=>{const O=h.current;if(O)return lx(O,{getZoom:()=>x.current,getPan:()=>y.current,setZoom:v,setPan:b},el,Sa)},[]);function _(O){return!!O.closest("[data-stage-card], [data-stage-insert], [data-node-insert], [data-task-template], [data-task-reorder]")}function K(O){return O.button===1?!0:O.button!==0?!1:!_(O.target)}function J(O){K(O)&&(ix(O),k({startX:O.clientX,startY:O.clientY,panX:w.x,panY:w.y}))}return i.jsxs("div",{className:Z("relative flex min-h-0 flex-col bg-[#080808]",f),children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-white/[0.06] px-4 py-2",children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Drag to pan · Ctrl+scroll to zoom · Click nodes for details"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>v(O=>Na(O*.9,el,Sa)),children:i.jsx(iv,{className:"h-4 w-4"})}),i.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>v(O=>Na(O*1.1,el,Sa)),children:i.jsx(lv,{className:"h-4 w-4"})}),i.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>C(),children:i.jsx(rv,{className:"h-4 w-4"})}),i.jsxs(H,{type:"button",variant:"outline",size:"sm",onClick:r,children:[i.jsx(Ct,{className:"h-4 w-4"}),"Add stage"]})]})]}),i.jsx("div",{ref:h,className:"relative min-h-0 flex-1 cursor-grab select-none overflow-hidden active:cursor-grabbing",onPointerDown:J,children:i.jsxs("div",{className:"absolute left-0 top-0 origin-top-left",style:{transform:`translate(${w.x}px, ${w.y}px) scale(${m})`,width:co,height:uo},children:[j.map((O,A)=>i.jsx(eC,{stage:O,flowIndex:A,templates:O.taskTemplates,selectedStageId:t,selectedTaskTemplateId:n,canMoveLeft:A>0,canMoveRight:A<j.length-1,onSelectStage:()=>{l!==null&&l(A)},onSelectTaskTemplate:W=>{a!==null&&a(A,W)},onAddStageTask:()=>{c!==null&&c(A)},onAddSubtask:W=>{u!==null&&u(A,W)},onMoveTaskTemplate:(W,R)=>{d!==null&&d(A,W,R)},onMoveLeft:()=>o(A,-1),onMoveRight:()=>o(A,1)},O.id)),i.jsx("svg",{className:"pointer-events-none absolute inset-0 z-[5]",width:co,height:uo,"aria-hidden":!0,children:S.map((O,A)=>i.jsx("path",{d:O,fill:"none",stroke:"rgba(96,165,250,0.35)",strokeWidth:"2"},`connector-${A}`))}),j.map((O,A)=>{const W=j[A+1];if(!W)return null;const R=q2(O,W);return i.jsx(No,{title:"Insert stage",dataStageInsert:"true",onClick:()=>s(A),className:"pointer-events-auto absolute -translate-x-1/2 -translate-y-1/2",style:{left:R.x,top:R.y},disabled:null,dataEpicAdd:null,dataNodeInsert:null},`insert-${O.id}`)})]})})]})}function tC(e){let t=0;"pulseKey"in e&&typeof e.pulseKey=="number"&&(t=e.pulseKey);const{open:n,onOpenChange:r,children:s}=e;return i.jsxs("aside",{className:Z("relative flex shrink-0 flex-col border-l border-white/[0.07] bg-[#0a0a0a] transition-[width] duration-200 ease-out",n?"w-[380px]":"w-11"),children:[i.jsx("div",{className:"absolute -left-3 top-4 z-10",children:i.jsx(H,{type:"button",variant:"outline",size:"icon",className:"h-7 w-7 rounded-full border-white/[0.12] bg-[#141414] shadow-lg",onClick:()=>r(!n),"aria-label":n?"Collapse panel":"Expand panel",children:n?i.jsx(iN,{className:"h-3.5 w-3.5"}):i.jsx(aN,{className:"h-3.5 w-3.5"})})}),n?i.jsx("div",{className:Z("inspector-reveal flex-1 overflow-y-auto p-4 pl-5",t>0&&"inspector-reveal-active"),children:s},t):null]})}function nC({members:e,onCreateMember:t,onDeleteMember:n}){const{confirmDestructive:r}=Yu(),[s,o]=p.useState("");async function l(){const a=s.trim();a&&(await t({name:a,role:""}),o(""))}return i.jsx("div",{className:"mx-auto w-full max-w-3xl space-y-6 px-8 py-5",children:i.jsxs("section",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-white",children:"Members"}),i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Anyone on the team can claim and update any task."})]}),i.jsx(Kt,{children:i.jsxs(Qt,{className:"flex flex-wrap gap-2 pt-6",children:[i.jsx(Ne,{value:s,onChange:a=>o(a.target.value),placeholder:"Member name",className:"min-w-[10rem] flex-1",onKeyDown:a=>{a.key==="Enter"&&s.trim()&&(a.preventDefault(),l())}}),i.jsx(H,{disabled:!s.trim(),onClick:()=>void l(),children:"Add"})]})}),e.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:"No members yet."}):i.jsx("div",{className:"space-y-3",children:e.map(a=>i.jsx(Kt,{children:i.jsxs(Qt,{className:"flex flex-wrap items-center gap-4 pt-6 sm:flex-nowrap",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"font-medium text-white",children:a.name}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.openTasks," open tasks"]})]}),i.jsx(H,{variant:"ghost",size:"icon",className:"shrink-0 text-destructive hover:text-destructive",onClick:()=>{(async()=>await r(`Delete member "${a.name}"?`,null)&&await n(a.id,a.name))()},children:i.jsx(gn,{className:"h-4 w-4"})})]})},a.id))})]})})}function Ip(e){const t=rC(e),n=p.forwardRef((r,s)=>{const{children:o,...l}=r,a=p.Children.toArray(o),c=a.find(oC);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return i.jsx(t,{...l,ref:s,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return i.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function rC(e){const t=p.forwardRef((n,r)=>{const{children:s,...o}=n;if(p.isValidElement(s)){const l=iC(s),a=lC(o,s.props);return s.type!==p.Fragment&&(a.ref=r?wn(r,l):l),p.cloneElement(s,a)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sC=Symbol("radix.slottable");function oC(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sC}function lC(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function iC(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function aC(e){const t=e+"CollectionProvider",[n,r]=Ni(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=w=>{const{scope:b,children:m}=w,v=L.useRef(null),g=L.useRef(new Map).current;return i.jsx(s,{scope:b,itemMap:g,collectionRef:v,children:m})};l.displayName=t;const a=e+"CollectionSlot",c=Ip(a),u=L.forwardRef((w,b)=>{const{scope:m,children:v}=w,g=o(a,m),k=Xt(b,g.collectionRef);return i.jsx(c,{ref:k,children:v})});u.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Ip(d),y=L.forwardRef((w,b)=>{const{scope:m,children:v,...g}=w,k=L.useRef(null),j=Xt(b,k),E=o(d,m);return L.useEffect(()=>(E.itemMap.set(k,{ref:k,...g}),()=>void E.itemMap.delete(k))),i.jsx(h,{[f]:"",ref:j,children:v})});y.displayName=d;function x(w){const b=o(e+"CollectionConsumer",w);return L.useCallback(()=>{const v=b.collectionRef.current;if(!v)return[];const g=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((E,S)=>g.indexOf(E.ref.current)-g.indexOf(S.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:l,Slot:u,ItemSlot:y},x,r]}function cC(e){const t=uC(e),n=p.forwardRef((r,s)=>{const{children:o,...l}=r,a=p.Children.toArray(o),c=a.find(fC);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return i.jsx(t,{...l,ref:s,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return i.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function uC(e){const t=p.forwardRef((n,r)=>{const{children:s,...o}=n;if(p.isValidElement(s)){const l=hC(s),a=pC(o,s.props);return s.type!==p.Fragment&&(a.ref=r?wn(r,l):l),p.cloneElement(s,a)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dC=Symbol("radix.slottable");function fC(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dC}function pC(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function hC(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gx=mC.reduce((e,t)=>{const n=cC(`Primitive.${t}`),r=p.forwardRef((s,o)=>{const{asChild:l,...a}=s,c=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),gC=p.createContext(void 0);function vx(e){const t=p.useContext(gC);return e||t||"ltr"}var ja="rovingFocusGroup.onEntryFocus",vC={bubbles:!1,cancelable:!0},jo="RovingFocusGroup",[Fc,xx,xC]=aC(jo),[yC,yx]=Ni(jo,[xC]),[wC,bC]=yC(jo),wx=p.forwardRef((e,t)=>i.jsx(Fc.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Fc.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(kC,{...e,ref:t})})}));wx.displayName=jo;var kC=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=p.useRef(null),y=Xt(t,h),x=vx(o),[w,b]=Uu({prop:l,defaultProp:a??null,onChange:c,caller:jo}),[m,v]=p.useState(!1),g=ls(u),k=xx(n),j=p.useRef(!1),[E,S]=p.useState(0);return p.useEffect(()=>{const C=h.current;if(C)return C.addEventListener(ja,g),()=>C.removeEventListener(ja,g)},[g]),i.jsx(wC,{scope:n,orientation:r,dir:x,loop:s,currentTabStopId:w,onItemFocus:p.useCallback(C=>b(C),[b]),onItemShiftTab:p.useCallback(()=>v(!0),[]),onFocusableItemAdd:p.useCallback(()=>S(C=>C+1),[]),onFocusableItemRemove:p.useCallback(()=>S(C=>C-1),[]),children:i.jsx(gx.div,{tabIndex:m||E===0?-1:0,"data-orientation":r,...f,ref:y,style:{outline:"none",...e.style},onMouseDown:He(e.onMouseDown,()=>{j.current=!0}),onFocus:He(e.onFocus,C=>{const U=!j.current;if(C.target===C.currentTarget&&U&&!m){const T=new CustomEvent(ja,vC);if(C.currentTarget.dispatchEvent(T),!T.defaultPrevented){const V=k().filter(A=>A.focusable),_=V.find(A=>A.active),K=V.find(A=>A.id===w),O=[_,K,...V].filter(Boolean).map(A=>A.ref.current);Sx(O,d)}}j.current=!1}),onBlur:He(e.onBlur,()=>v(!1))})})}),bx="RovingFocusGroupItem",kx=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:l,...a}=e,c=Fs(),u=o||c,d=bC(bx,n),f=d.currentTabStopId===u,h=xx(n),{onFocusableItemAdd:y,onFocusableItemRemove:x,currentTabStopId:w}=d;return p.useEffect(()=>{if(r)return y(),()=>x()},[r,y,x]),i.jsx(Fc.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:i.jsx(gx.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:He(e.onMouseDown,b=>{r?d.onItemFocus(u):b.preventDefault()}),onFocus:He(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:He(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const m=jC(b,d.orientation,d.dir);if(m!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let g=h().filter(k=>k.focusable).map(k=>k.ref.current);if(m==="last")g.reverse();else if(m==="prev"||m==="next"){m==="prev"&&g.reverse();const k=g.indexOf(b.currentTarget);g=d.loop?CC(g,k+1):g.slice(k+1)}setTimeout(()=>Sx(g))}}),children:typeof l=="function"?l({isCurrentTabStop:f,hasTabStop:w!=null}):l})})});kx.displayName=bx;var SC={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function NC(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function jC(e,t,n){const r=NC(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return SC[r]}function Sx(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function CC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var EC=wx,TC=kx;function RC(e){const t=IC(e),n=p.forwardRef((r,s)=>{const{children:o,...l}=r,a=p.Children.toArray(o),c=a.find(_C);if(c){const u=c.props.children,d=a.map(f=>f===c?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:f);return i.jsx(t,{...l,ref:s,children:p.isValidElement(u)?p.cloneElement(u,void 0,d):null})}return i.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function IC(e){const t=p.forwardRef((n,r)=>{const{children:s,...o}=n;if(p.isValidElement(s)){const l=MC(s),a=LC(o,s.props);return s.type!==p.Fragment&&(a.ref=r?wn(r,l):l),p.cloneElement(s,a)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var PC=Symbol("radix.slottable");function _C(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===PC}function LC(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function MC(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var OC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Li=OC.reduce((e,t)=>{const n=RC(`Primitive.${t}`),r=p.forwardRef((s,o)=>{const{asChild:l,...a}=s,c=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Mi="Tabs",[AC]=Ni(Mi,[yx]),Nx=yx(),[DC,md]=AC(Mi),jx=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:l="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=vx(a),[f,h]=Uu({prop:r,onChange:s,defaultProp:o??"",caller:Mi});return i.jsx(DC,{scope:n,baseId:Fs(),value:f,onValueChange:h,orientation:l,dir:d,activationMode:c,children:i.jsx(Li.div,{dir:d,"data-orientation":l,...u,ref:t})})});jx.displayName=Mi;var Cx="TabsList",Ex=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=md(Cx,n),l=Nx(n);return i.jsx(EC,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:i.jsx(Li.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});Ex.displayName=Cx;var Tx="TabsTrigger",Rx=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,l=md(Tx,n),a=Nx(n),c=_x(l.baseId,r),u=Lx(l.baseId,r),d=r===l.value;return i.jsx(TC,{asChild:!0,...a,focusable:!s,active:d,children:i.jsx(Li.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...o,ref:t,onMouseDown:He(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?l.onValueChange(r):f.preventDefault()}),onKeyDown:He(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&l.onValueChange(r)}),onFocus:He(e.onFocus,()=>{const f=l.activationMode!=="manual";!d&&!s&&f&&l.onValueChange(r)})})})});Rx.displayName=Tx;var Ix="TabsContent",Px=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...l}=e,a=md(Ix,n),c=_x(a.baseId,r),u=Lx(a.baseId,r),d=r===a.value,f=p.useRef(d);return p.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),i.jsx(vo,{present:s||d,children:({present:h})=>i.jsx(Li.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&o})})});Px.displayName=Ix;function _x(e,t){return`${e}-trigger-${t}`}function Lx(e,t){return`${e}-content-${t}`}var zC=jx,Mx=Ex,Ox=Rx,Ax=Px;const $C=zC,Dx=p.forwardRef((e,t)=>p.createElement(Mx,Object.assign({},ze(e,["className"]),{ref:t,className:Z("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e.className)})));Dx.displayName=Mx.displayName;const Bc=p.forwardRef((e,t)=>p.createElement(Ox,{ref:t,value:e.value,disabled:e.disabled,className:Z("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e.className)}));Bc.displayName=Ox.displayName;const FC=p.forwardRef((e,t)=>p.createElement(Ax,{ref:t,value:e.value,className:Z("mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e.className)}));FC.displayName=Ax.displayName;function BC(){const e=fs();let t="";typeof e.projectId=="string"&&e.projectId.length>0&&(t=e.projectId);const n=zt(),[r,s]=p.useState(!0),[o,l]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState([]),[f,h]=p.useState([]),[y,x]=p.useState(null),[w,b]=p.useState(null),[m,v]=p.useState(!1),[g,k]=p.useState(0),[j,E]=p.useState("stages"),S=p.useRef(null),C=p.useCallback(async()=>{if(!(!n||!t)){s(!0);try{const D=await hv(n,t);d(D.stages),h(D.members),c(!1)}catch(D){Y.error(D instanceof Error?D.message:"Failed to load workflow")}finally{s(!1)}}},[n,t]);p.useEffect(()=>{C()},[C]),p.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]),p.useEffect(()=>{j!=="stages"&&v(!1)},[j]);function U(){S.current&&clearTimeout(S.current),v(!1),S.current=setTimeout(()=>{v(!0),k(D=>D+1),S.current=null},130)}function T(D){d(D.slice().sort((P,N)=>P.position-N.position)),c(!0)}function V(D,P,N=null){T(D),x(P),b(N),U()}function _(){const D=u.concat([ni(u.length)]);V(D,D.length-1)}function K(D){const P=ni(D+1),N=sx(u,D,P);V(N,D+1)}function J(D,P){const N=ox(u,D,P);if(N===u)return;T(N);const I=D+P;x(I)}async function O(){if(n){l(!0);try{const D=await FN(n,t,{stages:u,roles:[]});d(D.stages),c(!1),Y.success("Workflow saved")}catch(D){Y.error(D instanceof Error?D.message:"Failed to save workflow")}finally{l(!1)}}}function A(D,P){T(u.map((N,I)=>I===D?Ht(P):N))}function W(D){if(u.length<=1){Y.error("At least one pipeline step is required");return}const P=u[D];if(!P)return;const N=P.activeTaskCount!==null?P.activeTaskCount:0;if(N>0){Y.error(`${N} epic(s) are on this step and it cannot be deleted`);return}T(u.filter((I,B)=>B!==D).map((I,B)=>Object.assign({},I,{position:B}))),x(null),b(null),v(!1)}async function R(D){if(!n)return;const P=await BN(n,t,D);h(N=>N.concat([P]).sort((I,B)=>I.name.localeCompare(B.name))),Y.success("Member added")}let $=null;if(y!==null&&y>=0&&y<u.length){const D=u[y];D&&($=D)}function F(D,P=null){if(D===null){x(null),b(null);return}const I=u.slice().sort((q,ce)=>q.position-ce.position)[D];if(!I)return;const B=u.findIndex(q=>q.id===I.id);x(B>=0?B:null),b(P)}function X(D,P=null){F(D,P),U()}function ee(){x(null),b(null),v(!1)}function G(D){const N=u.slice().sort((B,q)=>B.position-q.position)[D];if(!N)return null;const I=u.findIndex(B=>B.id===N.id);return I<0?null:{stage:N,index:I}}function ne(D){const P=G(D);if(!P)return;const N=P.stage.taskTemplates,I=Kv(P.stage.title,N.length),B=u.map((q,ce)=>ce===P.index?Ht(Object.assign({},q,{taskTemplates:N.concat([I])})):q);V(B,P.index,I.id)}function oe(D,P,N){const I=G(D);if(!I)return;const B=I.stage.taskTemplates,q=u.map((ce,fe)=>fe===I.index?Ht(Object.assign({},ce,{taskTemplates:Zv(B,P,N)})):ce);T(q)}function le(D,P){const N=G(D);if(!N)return;const I=N.stage.taskTemplates,B=Pi(I,P);if(!B)return;const q=Qv(B.template.title,B.template.children.length),ce=u.map((fe,Ce)=>Ce===N.index?Ht(Object.assign({},fe,{taskTemplates:ad(I,P,q)})):fe);V(ce,N.index,q.id)}if(!n)return null;if(r)return i.jsx("div",{className:"flex justify-center py-20",children:i.jsx(ve,{className:"h-6 w-6 animate-spin text-muted-foreground"})});let we="Project";n!==null&&n.projectName!==null?we=n.projectName:t.length>0&&(we=t);let M="/projects";return t.length>0&&(M=`/projects/${t}/tasks`),i.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[i.jsx(bn,{breadcrumb:[{label:"Projects",to:"/projects"},{label:we,to:M},{label:"Pipeline",to:null}],title:"Pipeline",subtitle:"Pipeline steps and task templates · epics run this workflow",actions:i.jsxs(i.Fragment,{children:[a?i.jsx("span",{className:"rounded-full border border-warn/30 bg-warn/10 px-2.5 py-1 text-xs font-medium text-warn",children:"Unsaved changes"}):null,i.jsxs(H,{onClick:()=>void O(),disabled:o||!a,children:[o?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(Xl,{className:"h-4 w-4"}),"Save workflow"]})]})}),i.jsxs($C,{value:j,onValueChange:E,className:"flex min-h-0 flex-1 flex-col",children:[i.jsx("div",{className:"shrink-0 border-b border-white/[0.06] px-5",children:i.jsxs(Dx,{className:"h-10 bg-transparent p-0",children:[i.jsx(Bc,{value:"stages",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",children:"Pipeline"}),i.jsx(Bc,{value:"members",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent",children:"Team"})]})}),i.jsxs("div",{className:Z("flex min-h-0 flex-1",j!=="stages"&&"hidden"),children:[i.jsx(mx,{className:"min-h-0 flex-1",stages:u,selectedStageId:$!==null?$.id:null,selectedTaskTemplateId:w,onAddStage:_,onInsertStageAfter:K,onMoveStage:J,onSelectStage:D=>X(D,null),onSelectTaskTemplate:(D,P)=>X(D,P),onAddStageTask:D=>ne(D),onAddSubtask:(D,P)=>le(D,P),onMoveTaskTemplate:(D,P,N)=>oe(D,P,N)}),i.jsx(tC,{open:m&&($!==null||w!==null),pulseKey:g,onOpenChange:D=>{D?$&&v(!0):ee()},children:$?i.jsx(fx,{stage:$,stageCount:u.length,selectedTaskTemplateId:w,onChange:D=>{y!==null&&A(y,D)},onSelectTaskTemplate:b,onDeleteStage:()=>{y!==null&&W(y)},onClose:ee}):null})]}),i.jsx("div",{className:Z("min-h-0 flex-1 overflow-y-auto",j!=="members"&&"hidden"),children:i.jsx(nC,{members:f,onCreateMember:async D=>{try{await R(D)}catch(P){Y.error(P instanceof Error?P.message:"Failed to add member")}},onDeleteMember:async(D,P)=>{if(n)try{await UN(n,t,D),h(N=>N.filter(I=>I.id!==D)),Y.success(`Deleted "${P}"`)}catch(N){Y.error(N instanceof Error?N.message:"Failed to delete member")}}})})]})]})}function UC(){const e=zt(),{confirmDestructive:t}=Yu(),[n,r]=p.useState(!0),[s,o]=p.useState(!1),[l,a]=p.useState(!1),[c,u]=p.useState(!1),[d,f]=p.useState([]),[h,y]=p.useState(null),[x,w]=p.useState([]),[b,m]=p.useState(null),[v,g]=p.useState(null),[k,j]=p.useState(""),[E,S]=p.useState(!1),[C,U]=p.useState(!1),T=p.useRef(null),V=p.useCallback(async()=>{if(!e)return;const N=await Xu(e);if(f(N),N.length>0&&!h){const I=N[0];I&&y(I.id)}},[e,h]),_=p.useCallback(async()=>{if(!(!e||!h)){r(!0);try{const N=await PN(e,h);w(N.stages),u(!1),m(null),g(null)}catch(N){Y.error(N instanceof Error?N.message:"Failed to load template")}finally{r(!1)}}},[e,h]);p.useEffect(()=>{V().catch(N=>{Y.error(N instanceof Error?N.message:"Failed to load templates")})},[V]),p.useEffect(()=>{h&&_()},[_,h]);function K(N){w(N.slice().sort((I,B)=>I.position-B.position)),u(!0)}function J(N,I,B=null){K(N),m(I),g(B)}function O(){const N=x.concat([ni(x.length)]);J(N,N.length-1)}function A(N){const I=ni(N+1),B=sx(x,N,I);J(B,N+1)}function W(N,I){const B=ox(x,N,I);B!==x&&(K(B),m(N+I))}async function R(){if(!(!e||!k.trim())&&!(c&&!window.confirm("You have unsaved changes. Continue anyway?"))){S(!0);try{const N=await _N(e,{title:k.trim(),id:null,description:null});f(I=>I.concat([{id:N.id,title:N.title,description:N.description}]).sort((B,q)=>B.title.localeCompare(q.title))),y(N.id),w(N.stages),u(!1),m(null),g(null),j(""),Y.success("Template created")}catch(N){Y.error(N instanceof Error?N.message:"Failed to create template")}finally{S(!1)}}}async function $(){if(!(!e||!h))try{await cp(e,h)}catch{Y.error("Export failed")}}async function F(N){if(e){U(!0);try{const I=await N.text(),B=JSON.parse(I),q=await ON(e,B);f(ce=>ce.concat([{id:q.id,title:q.title,description:q.description}]).sort((fe,Ce)=>fe.title.localeCompare(Ce.title))),y(q.id),w(q.stages),u(!1),m(null),g(null),Y.success(`Imported "${q.title}"`)}catch(I){Y.error(I instanceof Error?I.message:"Import failed — check file format")}finally{U(!1),T.current&&(T.current.value="")}}}async function X(N){if(!(!e||ya.has(N.id))&&await t(`Delete template "${N.title}"? This cannot be undone.`,null)){a(!0);try{await MN(e,N.id);const I=d.filter(B=>B.id!==N.id);if(f(I),h===N.id){let B=null;if(I.length>0){const q=I[0];q&&(B=q.id)}y(B),w([]),u(!1),m(null),g(null)}Y.success(`Deleted "${N.title}"`)}catch(I){Y.error(I instanceof Error?I.message:"Failed to delete template")}finally{a(!1)}}}const ee=function(){const N=d.find(I=>I.id===h);return N||null}(),G=ee!==null&&!ya.has(ee.id);async function ne(){if(!(!e||!h)){o(!0);try{const N=await LN(e,h,x);w(N.stages),u(!1),Y.success("Template saved")}catch(N){Y.error(N instanceof Error?N.message:"Failed to save template")}finally{o(!1)}}}let oe=null;if(b!==null&&b>=0&&b<x.length){const N=x[b];N&&(oe=N)}function le(N,I=null){if(N===null){m(null),g(null);return}const q=x.slice().sort((fe,Ce)=>fe.position-Ce.position)[N];if(!q)return;const ce=x.findIndex(fe=>fe.id===q.id);m(ce>=0?ce:null),g(I)}function we(N){const B=x.slice().sort((ce,fe)=>ce.position-fe.position)[N];if(!B)return null;const q=x.findIndex(ce=>ce.id===B.id);return q<0?null:{stage:B,index:q}}function M(N){const I=we(N);if(!I)return;const B=I.stage.taskTemplates,q=Kv(I.stage.title,B.length),ce=x.map((fe,Ce)=>Ce===I.index?Ht(Object.assign({},fe,{taskTemplates:B.concat([q])})):fe);J(ce,I.index,q.id)}function D(N,I,B){const q=we(N);if(!q)return;const ce=q.stage.taskTemplates,fe=x.map((Ce,en)=>en===q.index?Ht(Object.assign({},Ce,{taskTemplates:Zv(ce,I,B)})):Ce);K(fe)}function P(N,I){const B=we(N);if(!B)return;const q=B.stage.taskTemplates,ce=Pi(q,I);if(!ce)return;const fe=Qv(ce.template.title,ce.template.children.length),Ce=x.map((en,Et)=>Et===B.index?Ht(Object.assign({},en,{taskTemplates:ad(q,I,fe)})):en);J(Ce,B.index,fe.id)}return e?i.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[i.jsxs("aside",{className:"flex w-[240px] shrink-0 flex-col border-r border-white/[0.07] bg-black",children:[i.jsxs("div",{className:"space-y-2 border-b border-white/[0.06] px-3 py-3",children:[i.jsx("p",{className:"px-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Templates"}),i.jsxs("div",{className:"flex h-9 w-full overflow-hidden rounded-lg border border-white/[0.1] bg-[#111111] shadow-sm ring-offset-black focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 focus-within:ring-offset-black",children:[i.jsx("input",{value:k,onChange:N=>j(N.target.value),placeholder:"New template",disabled:E,className:"min-w-0 flex-1 border-0 bg-transparent px-3 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",onKeyDown:N=>{N.key==="Enter"&&k.trim()&&(N.preventDefault(),R())}}),i.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-full w-9 shrink-0 rounded-none border-l border-white/[0.1] hover:bg-white/[0.06]",disabled:!k.trim()||E,onClick:()=>void R(),children:E?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(Ct,{className:"h-4 w-4"})})]}),i.jsx("input",{ref:T,type:"file",accept:".json,application/json",className:"hidden",onChange:N=>{const I=N.target.files!==null?N.target.files[0]:null;I&&F(I)}}),i.jsxs(H,{type:"button",variant:"outline",size:"sm",className:"h-9 w-full",disabled:C,onClick:()=>{T.current!==null&&T.current.click()},children:[C?i.jsx(ve,{className:"h-3.5 w-3.5 animate-spin"}):i.jsx(fN,{className:"h-3.5 w-3.5"}),"Import JSON"]})]}),i.jsx("div",{className:"flex-1 space-y-0.5 overflow-y-auto p-2",children:d.map(N=>i.jsxs("div",{className:"group relative",children:[i.jsxs("button",{type:"button",onClick:()=>{c&&!window.confirm("Discard unsaved changes?")||y(N.id)},className:Z("w-full rounded-lg px-3 py-2.5 pr-16 text-left transition-colors",h===N.id?"bg-white/[0.08] text-foreground":"text-muted-foreground hover:bg-white/[0.04] hover:text-foreground"),children:[i.jsx("p",{className:"text-sm font-medium",children:N.title}),i.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:N.description})]}),i.jsxs("div",{className:"absolute right-2 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[i.jsx("button",{type:"button",title:"Export as JSON",onClick:I=>{I.stopPropagation(),y(N.id),cp(e,N.id).catch(()=>Y.error("Export failed"))},className:Z("rounded p-1 transition-opacity","text-muted-foreground hover:text-foreground",h===N.id?"opacity-100":"opacity-0 group-hover:opacity-100"),children:i.jsx(Tc,{className:"h-3.5 w-3.5"})}),ya.has(N.id)?null:i.jsx("button",{type:"button",title:"Delete template",disabled:l,onClick:I=>{I.stopPropagation(),X(N)},className:Z("rounded p-1 transition-opacity","text-muted-foreground hover:text-destructive",h===N.id?"opacity-100":"opacity-0 group-hover:opacity-100"),children:i.jsx(gn,{className:"h-3.5 w-3.5"})})]})]},N.id))})]}),i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[i.jsx(bn,{title:ee!==null?ee.title:"Template",subtitle:"Stages and task templates",actions:i.jsxs(i.Fragment,{children:[c?i.jsx("span",{className:"rounded-full border border-warn/30 bg-warn/10 px-2.5 py-1 text-xs font-medium text-warn",children:"Unsaved"}):null,h?i.jsxs(H,{variant:"outline",onClick:()=>void $(),children:[i.jsx(Tc,{className:"h-4 w-4"}),"Export"]}):null,G&&ee?i.jsxs(H,{variant:"outline",className:"text-destructive hover:text-destructive",disabled:l,onClick:()=>void X(ee),children:[l?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(gn,{className:"h-4 w-4"}),"Delete"]}):null,i.jsxs(H,{onClick:()=>void ne(),disabled:s||!c||!h,children:[s?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(Xl,{className:"h-4 w-4"}),"Save"]})]})}),n?i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsx(ve,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex min-h-0 flex-1",children:[i.jsx(mx,{className:"min-h-0 flex-1",stages:x,selectedStageId:oe!==null?oe.id:null,selectedTaskTemplateId:v,onAddStage:O,onInsertStageAfter:A,onMoveStage:W,onSelectStage:N=>le(N,null),onSelectTaskTemplate:(N,I)=>le(N,I),onAddStageTask:N=>M(N),onAddSubtask:(N,I)=>P(N,I),onMoveTaskTemplate:(N,I,B)=>D(N,I,B)}),i.jsx("aside",{className:"flex w-[380px] shrink-0 flex-col border-l border-white/[0.07] bg-[#0a0a0a]",children:i.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:oe?i.jsx(fx,{stage:oe,stageCount:x.length,selectedTaskTemplateId:v,onChange:N=>{b!==null&&K(x.map((I,B)=>B===b?Ht(N):I))},onSelectTaskTemplate:g,onDeleteStage:()=>{if(b!==null){if(x.length<=1){Y.error("At least one stage is required");return}K(x.filter((N,I)=>I!==b).map((N,I)=>Object.assign({},N,{position:I}))),m(null),g(null)}},onClose:()=>{m(null),g(null)}}):null})})]})]})]}):null}const WC="Untitled library",VC="Untitled document";function HC(){const e=zt(),[t,n]=Tw(),[r,s]=p.useState([]),[o,l]=p.useState(null),[a,c]=p.useState(null),[u,d]=p.useState(null),[f,h]=p.useState(null),[y,x]=p.useState(""),[w,b]=p.useState(""),[m,v]=p.useState(""),[g,k]=p.useState(""),[j,E]=p.useState(!0),[S,C]=p.useState(!1),[U,T]=p.useState(!1),[V,_]=p.useState(!1),K=t.get("doc"),J=p.useCallback(async()=>{if(!e)return[];const M=await mv(e);return s(M),M},[e]),O=p.useCallback(async M=>{if(!e)return;const D=await gv(e,M);return c(D),x(D.title),b(D.description),D},[e]),A=p.useCallback(async M=>{if(!e)return;const D=await YN(e,M);return h(D),v(D.title),k(D.description),l(D.libraryId),d(D.id),D},[e]);p.useEffect(()=>{if(!e)return;let M=!0;async function D(){E(!0);try{const P=await J();if(!M)return;if(K){const N=await A(K);N&&await O(N.libraryId)}else if(P.length>0){const N=P[0];N&&l(N.id)}}catch(P){Y.error(P instanceof Error?P.message:"Failed to load library")}finally{M&&E(!1)}}return D(),()=>{M=!1}},[e,K,J,A,O]),p.useEffect(()=>{!e||!o||K||O(o).catch(M=>{Y.error(M instanceof Error?M.message:"Failed to load library")})},[e,o,K,O]),p.useEffect(()=>{if(!e||!u){h(null);return}A(u).catch(M=>{Y.error(M instanceof Error?M.message:"Failed to load document")})},[e,u,A]);const W=p.useMemo(()=>a!==null?a.documents:[],[a]),R=r.find(M=>M.id===o),$=R||null;function F(M){d(M),n({doc:M})}function X(M){l(M),d(null),n({})}async function ee(){if(e){T(!0);try{const M=await WN(e,{title:WC,id:null,description:null});await J(),l(M.id),c(M),x(M.title),b(M.description),d(null),n({}),Y.success("Library created")}catch(M){Y.error(M instanceof Error?M.message:"Failed to create library")}finally{T(!1)}}}async function G(){if(!(!e||!o)){C(!0);try{const M=await VN(e,o,{title:y,description:w});c(M),await J(),Y.success("Library saved")}catch(M){Y.error(M instanceof Error?M.message:"Failed to save library")}finally{C(!1)}}}async function ne(){if(!(!e||!o)&&window.confirm("Delete this library and all documents?"))try{await HN(e,o);const M=await J(),D=M.length>0?M[0]:null;l(D?D.id:null),d(null),n({}),Y.success("Library deleted")}catch(M){Y.error(M instanceof Error?M.message:"Failed to delete library")}}async function oe(){if(!(!e||!o)){_(!0);try{const M=await GN(e,o,{title:VC,id:null,description:null});await O(o),F(M.id),Y.success("Document created")}catch(M){Y.error(M instanceof Error?M.message:"Failed to create document")}finally{_(!1)}}}async function le(){if(!(!e||!o||!u)){C(!0);try{await KN(e,o,u,{title:m,description:g}),await O(o),Y.success("Document saved")}catch(M){Y.error(M instanceof Error?M.message:"Failed to save document")}finally{C(!1)}}}async function we(){if(!(!e||!o||!u)&&window.confirm("Delete this document?"))try{await QN(e,o,u),d(null),n({}),await O(o),Y.success("Document deleted")}catch(M){Y.error(M instanceof Error?M.message:"Failed to delete document")}}return e?i.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[i.jsx(bn,{title:"Library",subtitle:j?"Loading…":r.length>0?`${r.length} librar${r.length===1?"y":"ies"} · link docs to epics`:"Shared docs for epics"}),i.jsxs("div",{className:"flex min-h-0 flex-1",children:[i.jsxs("aside",{className:"flex w-[240px] shrink-0 flex-col border-r border-white/[0.07] bg-black",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-white/[0.07] px-3 py-3",children:[i.jsx("p",{className:"px-1 text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:"Libraries"}),i.jsx(H,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",disabled:U,onClick:()=>void ee(),children:U?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(Ct,{className:"h-4 w-4"})})]}),i.jsx("div",{className:"flex-1 space-y-0.5 overflow-y-auto p-2",children:j?i.jsx("div",{className:"flex justify-center py-8",children:i.jsx(ve,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):r.length===0?i.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No libraries yet. Use + to add one."}):r.map(M=>i.jsxs("button",{type:"button",onClick:()=>X(M.id),className:Z("w-full rounded-lg px-3 py-2.5 text-left transition-colors",o===M.id?"bg-white/[0.09] text-white":"text-muted-foreground hover:bg-white/[0.04] hover:text-foreground"),children:[i.jsx("p",{className:"truncate text-sm font-medium",children:M.title}),i.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[M.documentCount," document",M.documentCount===1?"":"s"]})]},M.id))})]}),i.jsxs("aside",{className:Z("flex w-[260px] shrink-0 flex-col border-r border-white/[0.07] bg-[#0a0a0a]",!o&&"opacity-60"),children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-white/[0.07] px-3 py-3",children:[i.jsx("p",{className:"px-1 text-[10px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:"Documents"}),i.jsx(H,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",disabled:!o||V,onClick:()=>void oe(),children:V?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(Ct,{className:"h-4 w-4"})})]}),i.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:o?W.length===0?i.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No documents yet. Use + to add one."}):W.map(M=>i.jsxs("button",{type:"button",onClick:()=>F(M.id),className:Z("mb-0.5 flex w-full items-start gap-2 rounded-lg px-3 py-2.5 text-left transition-colors",u===M.id?"bg-primary/15 text-primary":"text-foreground hover:bg-white/[0.04]"),children:[i.jsx(xa,{className:"mt-0.5 h-4 w-4 shrink-0 opacity-70"}),i.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:M.title})]},M.id)):i.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"Select a library first."})})]}),i.jsxs("section",{className:"flex min-w-0 flex-1 flex-col overflow-hidden bg-[#080808]",children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-white/[0.07] px-6 py-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[u?i.jsx(xa,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):i.jsx(Kl,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),i.jsx("h2",{className:"truncate text-base font-semibold tracking-tight text-white",children:u?m||"Document":$?y||$.title:"Library"})]}),u&&f?i.jsxs("p",{className:"mt-0.5 truncate pl-6 text-xs text-muted-foreground",children:[f.libraryTitle," · ",f.linkCount," epic link",f.linkCount===1?"":"s"]}):o?i.jsxs("p",{className:"mt-0.5 pl-6 text-xs text-muted-foreground",children:[W.length," document",W.length===1?"":"s"," in this library"]}):null]}),i.jsx("div",{className:"flex shrink-0 items-center gap-2",children:u?i.jsxs(i.Fragment,{children:[i.jsxs(H,{type:"button",variant:"outline",size:"sm",onClick:()=>void we(),children:[i.jsx(gn,{className:"h-4 w-4"}),"Delete"]}),i.jsxs(H,{type:"button",size:"sm",disabled:S,onClick:()=>void le(),children:[S?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(Xl,{className:"h-4 w-4"}),"Save"]})]}):o?i.jsxs(i.Fragment,{children:[i.jsxs(H,{type:"button",variant:"outline",size:"sm",onClick:()=>void ne(),children:[i.jsx(gn,{className:"h-4 w-4"}),"Delete"]}),i.jsxs(H,{type:"button",size:"sm",disabled:S,onClick:()=>void G(),children:[S?i.jsx(ve,{className:"h-4 w-4 animate-spin"}):i.jsx(Xl,{className:"h-4 w-4"}),"Save"]})]}):null})]}),i.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:u?i.jsxs("div",{className:"mx-auto max-w-2xl space-y-4",children:[i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Title"}),i.jsx(Ne,{value:m,onChange:M=>v(M.target.value),className:"border-white/[0.1] bg-[#111111]"})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Content"}),i.jsx(Kn,{value:g,onChange:M=>k(M.target.value),rows:18,className:"min-h-[360px] resize-y rounded-xl border-white/[0.1] bg-[#111111]",placeholder:"Notes, specs, links, acceptance criteria…"})]})]}):o?i.jsxs("div",{className:"mx-auto max-w-2xl space-y-4",children:[i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Title"}),i.jsx(Ne,{value:y,onChange:M=>x(M.target.value),className:"border-white/[0.10] bg-[#111111]"})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Description"}),i.jsx(Kn,{value:w,onChange:M=>b(M.target.value),rows:8,className:"resize-y rounded-xl border-white/[0.10] bg-[#111111]",placeholder:"What this library is for"})]}),W.length===0?i.jsxs("div",{className:"panel-card flex flex-col items-center px-6 py-10 text-center",children:[i.jsx(xa,{className:"mb-3 h-8 w-8 text-muted-foreground/50"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a document with +, then link it from an epic detail page."})]}):i.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a document from the list or create a new one with +."})]}):i.jsxs("div",{className:"panel-card mx-auto flex max-w-md flex-col items-center px-8 py-14 text-center",children:[i.jsx(Kl,{className:"mb-4 h-10 w-10 text-muted-foreground/50"}),i.jsx("p",{className:"text-sm font-medium text-white",children:"Create your first library"}),i.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Press + in the sidebar, then name it in the editor."})]})})]})]})]}):null}function GC({children:e}){const t=Jt();return t?t.mustChangePassword?i.jsx(qe,{to:"/change-password",replace:!0}):i.jsx(i.Fragment,{children:e}):i.jsx(qe,{to:"/login",replace:!0})}function YC({children:e}){const t=Jt();return t?t.mustChangePassword?i.jsx(i.Fragment,{children:e}):i.jsx(qe,{to:"/projects",replace:!0}):i.jsx(qe,{to:"/login",replace:!0})}function KC({children:e}){const t=Jt();return t?t.userRole!=="admin"?i.jsx(qe,{to:"/projects",replace:!0}):i.jsx(i.Fragment,{children:e}):i.jsx(qe,{to:"/login",replace:!0})}function QC(){return i.jsx("div",{className:"h-full",children:i.jsxs(pw,{children:[i.jsx(Oe,{path:"/login",element:i.jsx(uj,{})}),i.jsx(Oe,{path:"/setup",element:i.jsx(dj,{})}),i.jsx(Oe,{path:"/change-password",element:i.jsx(YC,{children:i.jsx(cj,{})})}),i.jsxs(Oe,{element:i.jsx(GC,{children:i.jsx(rj,{})}),children:[i.jsx(Oe,{path:"/projects",element:i.jsx(Cj,{})}),i.jsx(Oe,{path:"/workflow-templates",element:i.jsx(UC,{})}),i.jsx(Oe,{path:"/library",element:i.jsx(HC,{})}),i.jsx(Oe,{path:"/admin/users",element:i.jsx(KC,{children:i.jsx(fj,{})})}),i.jsxs(Oe,{path:"/projects/:projectId",element:i.jsx(sj,{}),children:[i.jsx(Oe,{index:!0,element:i.jsx(qe,{to:"tasks",replace:!0})}),i.jsx(Oe,{path:"board",element:i.jsx(qe,{to:"tasks",replace:!0})}),i.jsx(Oe,{path:"tasks",element:i.jsx(Rj,{})}),i.jsx(Oe,{path:"tasks/:taskId",element:i.jsx(K2,{})}),i.jsx(Oe,{path:"inbox",element:i.jsx(ij,{})}),i.jsx(Oe,{path:"mobile",element:i.jsx(Sj,{})}),i.jsx(Oe,{path:"workflow",element:i.jsx(BC,{})})]})]}),i.jsx(Oe,{path:"/",element:i.jsx(Pp,{})}),i.jsx(Oe,{path:"*",element:i.jsx(Pp,{})})]})})}function Pp(){const e=Jt();return e?e.mustChangePassword?i.jsx(qe,{to:"/change-password",replace:!0}):e.projectId?i.jsx(qe,{to:`/projects/${e.projectId}/tasks`,replace:!0}):i.jsx(qe,{to:"/projects",replace:!0}):i.jsx(qe,{to:"/login",replace:!0})}const _p=document.getElementById("root");_p!==null&&Ea.createRoot(_p).render(i.jsx(L.StrictMode,{children:i.jsx(kw,{basename:"/app",children:i.jsxs(gN,{children:[i.jsx(QC,{}),i.jsx(nb,{richColors:!0,closeButton:!0,position:"top-right"})]})})}));
|